|
@@ -119,7 +119,7 @@ class Login extends Api
|
|
$avatar=input('avatarUrl');
|
|
$avatar=input('avatarUrl');
|
|
$nickname=input('nickname');
|
|
$nickname=input('nickname');
|
|
$user=Db::table('q_user')->where('id',$user_id)->find();
|
|
$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']]);
|
|
$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参数错误');
|
|
$this->error('code参数错误');
|
|
}
|
|
}
|
|
$data=$app->auth->session($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();
|
|
$user=Db::table('q_user')->where('openid',$data['openid'])->find();
|
|
if(empty($user)){
|
|
if(empty($user)){
|
|
$id=Db::table('q_user')->insertGetId(['openid'=>$data['openid'],'session_key'=>$data['session_key']]);
|
|
$id=Db::table('q_user')->insertGetId(['openid'=>$data['openid'],'session_key'=>$data['session_key']]);
|