libushang 2 weeks ago
parent
commit
d257186d87
1 changed files with 19 additions and 0 deletions
  1. 19 0
      routers/prod_api/auth.py

+ 19 - 0
routers/prod_api/auth.py

@@ -267,6 +267,7 @@ async def yzy(
     state = data['state']
     logger.info("code:{}, {}", code, state)
 
+    '''
     resp = YzyApi.get_user_info(code)
     if resp['errcode'] != 0:
         return {
@@ -275,6 +276,24 @@ async def yzy(
         }
 
     user_id = resp['UserId']
+    '''
+    # 管理中心通过授权码获取用户信息接口
+    # 获取用户基本信息
+    result = YzyApi.getuserbycode(code)
+    errcode = int(result['errcode'])
+    if errcode == 0:
+        data = result['data']
+        user_id = data['userid']
+        username = data['username']
+
+        phone = ''    
+        try:
+            # 敏感数据加密算法(DES 对称加密)
+            phone = YzyApi.desDecryptValue(settings.YZY_CORPSECRET, data['mobile'])
+        except:
+            traceback.print_exc()
+
+
 
     '''
     row = db.query(YzyOrgUserEntity).filter(YzyOrgUserEntity.userid == user_id).first()