更新时间:2025-01-22 GMT+08:00
分享

登录

loginByAppId

接口描述

该接口用于AppID登录。

注意事项

创建会议,被邀入会等功能只有在登录后才能使用,若不登录,将无法体验完整会议功能。

方法定义

1
loginByAppId(appIdAuthInfo: HWMOpenAppIdAuthInfoModel): Promise<HWMLoginResult>;

参数描述

表1 HWMOpenAppIdAuthInfoModel 参数说明

参数

是否必须

类型

描述

appid

是

string

App ID。App ID的申请,请参考《开发指南》的"App ID的申请"章节。

signature

是

string

从第三方服务端获取的鉴权签名。

corpId

否

string

设置该用户所在的企业ID。仅在SP模式下需要填写,单企业模式不要填写,否则会鉴权失败。

thirdUserId

是

string

第三方用户ID。

expireTime

是

number

从第三方服务端获取的鉴权签名有效期的时间戳。0表示永不超时。

nonce

是

string

从第三方服务端获取的Nonce值,用于华为云服务端验证鉴权签名有效性。

userName

是

string

用户名称。

userEmail

否

string

用户邮箱信息。

userPhone

否

string

用户手机号码。

deptCode

否

string

部门ID

返回值

表2 HWMLoginResult参数说明

参数

类型

描述

code

SDKERR

接口调用结果,HWM_SDKERR_SUCCESS表示成功,详细请参考错误码参考。

desc

string

错误描述。

detail

HWMLoginPrivateResultInfoModel

登录结果返回信息。

表3 HWMLoginPrivateResultInfoModel参数说明

参数

类型

描述

uuid

SDKERR

账号uuid。

thirdAccount

string

appid登录的三方账号。

示例代码

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
/**
* 登录处理
*/
handleLoginByAppId() {
    const info: HWMOpenAppIdAuthInfoModel = {
       appid: this.getAppId(),
       signature: this.getSignature(),
       corpId: this.getCorpId(),
       thirdUserId: this.getAccount(),
       expireTime: this.getExpireTime(),
       nonce: this.getNonce(),
       userName: this.getUserName(),
       userEmail: this.getUserEmail(),
       userPhone: this.getUserPhone(),
       deptCode: this.getDeptCode()
    };
    UISDK.getLoginApi().loginByAppId(info).then((res: HWMLoginResult) => {
      const message: string = res.code === SDKERR.HWM_SDKERR_SUCCESS ? '登录成功' : '登录失败' + res.code;
      console.log(message);
    });
}

相关文档