1
This commit is contained in:
@@ -23,7 +23,7 @@ class Account extends Base
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function createAccount(string $user_id,string $nick_name,string $avatar): array
|
||||
public function createAccount(string $user_id,string $nick_name = "",string $avatar = ""): array
|
||||
{
|
||||
try {
|
||||
$options = [
|
||||
|
||||
@@ -53,12 +53,13 @@ class Profile extends Base
|
||||
|
||||
/**
|
||||
* 拉取一个账户的多个资料
|
||||
* 返回未设置的字段
|
||||
* @param string $user_id
|
||||
* @param array $arg
|
||||
* @return array|string[]
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function getOneAccountPortraitList(string $user_id,array $arg = ['Tag_Profile_IM_Gender','Tag_Profile_Custom_Hname','Tag_Profile_Custom_Title']): array
|
||||
public function getOneAccountPortraitList(string $user_id,array $arg = ['Tag_Profile_IM_Gender','Tag_Profile_Custom_Hname','Tag_Profile_Custom_Title',"Tag_Profile_IM_Image"]): array
|
||||
{
|
||||
try {
|
||||
$options = [
|
||||
@@ -70,10 +71,20 @@ class Profile extends Base
|
||||
|
||||
$path = $this->config['base_url'] . $this->version . "/profile/portrait_get?" . $this->buildRequestParams();
|
||||
$result = $this->postRequest($path,$options);
|
||||
|
||||
$result_arg = [];
|
||||
if (!empty($result['UserProfileItem'])){
|
||||
foreach ($result['UserProfileItem'] as $user_profile_item){
|
||||
if(!empty($user_profile_item['ProfileItem'])){
|
||||
$result_arg = array_column($user_profile_item['ProfileItem'],"Tag");
|
||||
foreach ($user_profile_item['ProfileItem'] as $profile_item){
|
||||
if (!empty($profile_item['Value'])){
|
||||
// 性别为未知时跳过
|
||||
if ($profile_item['Tag'] == "Tag_Profile_IM_Gender" && $profile_item['Value'] == "Gender_Type_Unknown"){
|
||||
continue;
|
||||
}
|
||||
$result_arg[] = $profile_item['Tag'];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
namespace Extend\TencentIm;
|
||||
|
||||
class Safe extends Base
|
||||
{
|
||||
/**
|
||||
* 获取用户签名
|
||||
* @param string $user_id
|
||||
* @return string
|
||||
*/
|
||||
public function getUserSign(string $user_id = ""): string
|
||||
{
|
||||
return parent::getUserSign($user_id); // TODO: Change the autogenerated stub
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user