王新凯 há 3 anos atrás
pai
commit
a93e302352
1 ficheiros alterados com 3 adições e 2 exclusões
  1. 3 2
      application/api/controller/Login.php

+ 3 - 2
application/api/controller/Login.php

@@ -119,7 +119,7 @@ class Login extends Api
             $avatar=input('avatarUrl');
             $nickname=input('nickname');
             $user=Db::table('q_user')->where('id',$user_id)->find();
-            $decryptedData = $app->encryptor->decryptData($user['session_key'], input('iv'), input('encryptedData'));
+
 
 
             $res=Db::table('q_user')->where('id',$user_id)->update(['headimg'=>$avatar,'nickname'=>$nickname,'phone'=>$decryptedData['phoneNumber']]);
@@ -140,8 +140,9 @@ class Login extends Api
             $this->error('code参数错误');
         }
         $data=$app->auth->session($code);
+        $decryptedData = $app->encryptor->decryptData($decryptedData['session_key'], input('iv'), input('encryptedData'));
 
-
+        dump($decryptedData);die();
         $user=Db::table('q_user')->where('openid',$data['openid'])->find();
         if(empty($user)){
             $id=Db::table('q_user')->insertGetId(['openid'=>$data['openid'],'session_key'=>$data['session_key']]);