# ks.openUserProfile

更新时间:2024-07-23 11:06:59

打开官方帐号profile

请求 object

字段名 类型 描述 values
accountType string 要关注的用户类型 CPServiceAccount : CP的服务号 MiniGameOfficialAccount:快手小游戏官方号 说明:不需要填具体的帐号,就填这两个字符串就可以了
callback callback 回调信息

callback

字段名 类型 描述 values
errorCode int 1表示成功
errorMsg string 错误信息
openMiniGameOfficialProfile() {  
  this.content.string = "open MiniGame Official Profile";  
  ks.checkFollowState({  
    accountType: "MiniGameOfficialAccount",  
    callback: (result) => {  
      if (result.errorCode === -10005) {  
          // 表明暂不支持官方号,可以隐藏官方号入口,或者cp根据自己业务处理 this.content.string = `not support MiniGameOfficialAccount`  
      } else {  
        // 支持该业务,正常处理业务逻辑即可,包含正确以及错误逻辑   
        ks.openUserProfile({  
          accountType: "MiniGameOfficialAccount",  
          callback: (result) => {  
            this.content.string = `open MiniGame Official Profile, result: ${JSON.stringify(result)}`;  
          }  
        })  
      }  
    }  
  })   
}  
Copyright ©2025, All Rights Reserved