提交 164063c7 编写于 作者: KK's avatar KK

调试

上级 7e44eb2a
...@@ -29,7 +29,6 @@ export class DingTalkService { ...@@ -29,7 +29,6 @@ export class DingTalkService {
*/ */
private static readonly instance = new DingTalkService(store); private static readonly instance = new DingTalkService(store);
public isAuthentication :any= false;
/** /**
* 用户信息缓存key * 用户信息缓存key
* *
...@@ -107,7 +106,9 @@ export class DingTalkService { ...@@ -107,7 +106,9 @@ export class DingTalkService {
*/ */
private async dd_ready() { private async dd_ready() {
// 设置导航标题 // 设置导航标题
this.login();
this.setNavBack(); this.setNavBack();
this.doAuthentication();
} }
...@@ -366,17 +367,20 @@ export class DingTalkService { ...@@ -366,17 +367,20 @@ export class DingTalkService {
} }
/** /**
* 钉钉开放事件 * 鉴权
*
* @memberof DingTalkService
*/ */
public async ddEvent(tag: string, arg: any) { public async doAuthentication() {
if(!this.isAuthentication){
const reAccess_token = await this.getAccess_token(); const reAccess_token = await this.getAccess_token();
alert(JSON.stringify(reAccess_token)); alert(JSON.stringify(reAccess_token));
this.authentication(reAccess_token.agentId, reAccess_token.corpId, reAccess_token.data.timeStamp, reAccess_token.data.nonceStr, reAccess_token.data.signature); this.authentication(reAccess_token.agentId, reAccess_token.corpId, reAccess_token.data.timeStamp, reAccess_token.data.nonceStr, reAccess_token.data.signature);
this.isAuthentication = true;
} }
/**
* 钉钉开放事件
*
* @memberof DingTalkService
*/
public async ddEvent(tag: string, arg: any) {
if (Object.is(tag, 'startRecord')) { if (Object.is(tag, 'startRecord')) {
return this.startRecord(); return this.startRecord();
} }
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册