@@ -56,10 +56,33 @@ class TencentProvider {
5656 return  constants . providerName 
5757 } 
5858
59+  async  getUserCred ( options )  { 
60+  if  ( ! options . credentials  ||  ! options . credentials . tencent_secret_id )  { 
61+  const  tencentTemp  =  await  this . getTempKey ( ) 
62+  this . options . credentials  =  { 
63+  tencent_secret_id : tencentTemp . tencent_secret_id , 
64+  tencent_secret_key : tencentTemp . tencent_secret_key , 
65+  tencent_appid : tencentTemp . tencent_appid , 
66+  tencent_owneruin : tencentTemp . tencent_owneruin 
67+  } 
68+  options . token  =  tencentTemp . token 
69+  options . timestamp  =  tencentTemp . timestamp 
70+  } 
71+  if  ( ! options . credentials . tencent_owneruin  ||  ! options . credentials . tencent_appid )  { 
72+  const  appid  =  await  this . getAppid ( { 
73+  SecretId : options . credentials . tencent_secret_id , 
74+  SecretKey : options . credentials . tencent_secret_key 
75+  } ) 
76+  options . credentials . tencent_appid  =  appid . AppId 
77+  options . credentials . tencent_owneruin  =  appid . OwnerUin 
78+  } 
79+  return  options 
80+  } 
81+ 
5982 async  getUserAuth ( uin )  { 
6083 try  { 
6184 const  getUserAuthInfo  =  new  GetUserAuthInfo ( ) 
62-  const  result  =  await  getUserAuthInfo . isAuth ( uin ) 
85+  const  result  =  await  getUserAuthInfo . isAuth ( uin ,   'plugin' ) 
6386 if  ( result [ 'Error' ]  ==  true )  { 
6487 console . log ( 'Failed to get real name authentication result.' ) 
6588 process . exit ( - 1 ) 
0 commit comments