TIMProfileModifySelfUserProfile
功能介绍
修改自己的个人资料
参数详解
返回模板
Promise<commonResult<string>>
{
code: TIMResult | TIMErrCode;
desc?: string | undefined;
json_param?: string | undefined;
json_params?: string | undefined;
user_data?: string | undefined;
}
返回值详解
名称 |
数值类型 |
描述 |
code |
TIMResult | TIMErrCode |
返回状态码 |
desc |
string | undefined |
返回描述 |
json_param |
string | undefined |
根据具具体接口返回 |
json_params |
string | undefined |
兼容的字段,某些情况下会返回这个,根据具体接口返回 |
user_data |
string | undefined |
ImSDK负责透传的用户自定义数据,未做任何处理 |
代码示例
import TimRender from "im_electron_sdk/dist/renderer";
const timRenderInstance = new TimRender();
import {UserProfileItem,TIMProfileModifySelfUserProfileParam,UserProfileCustemStringInfo } from "im_electron_sdk/dist/interfaces";
let nickname = "";
let faceUrl = "";
let signature = "";
let customInfo:UserProfileCustemStringInfo = {
user_profile_custom_string_info_key:"",
user_profile_custom_string_info_value:""
}
let profileParam:UserProfileItem = {
user_profile_item_nick_name: nickname,
user_profile_item_gender: 0,
user_profile_item_face_url: faceUrl,
user_profile_item_self_signature: signature,
user_profile_item_add_permission: 0,
user_profile_item_location: 0,
user_profile_item_language: 0,
user_profile_item_birthday: 0,
user_profile_item_level: 0,
user_profile_item_role: 0,
user_profile_item_custom_string_array: [customInfo],
}
let param:TIMProfileModifySelfUserProfileParam={
json_modify_self_user_profile_param: profileParam,
user_data: "",
}
let {code} = await timRenderInstance.TIMProfileModifySelfUserProfile(param)
if(code == 0){
}