作者 王智

修改

@@ -185,6 +185,8 @@ class User extends Api @@ -185,6 +185,8 @@ class User extends Api
185 $miniProgram = $app->mini_program; 185 $miniProgram = $app->mini_program;
186 $sessionKey = $miniProgram->sns->getSessionKey($params['code']); 186 $sessionKey = $miniProgram->sns->getSessionKey($params['code']);
187 $Json = $miniProgram->encryptor->decryptData($sessionKey['session_key'], urldecode($params['iv']), urldecode($params['encryptData'])); 187 $Json = $miniProgram->encryptor->decryptData($sessionKey['session_key'], urldecode($params['iv']), urldecode($params['encryptData']));
  188 + dump($Json);
  189 + die;
188 $Mobile = $Json['phoneNumber']; 190 $Mobile = $Json['phoneNumber'];
189 $Res = Db::name('user')->where('id', $UserId)->update(['mobile' => $Mobile, 'updatetime' => time()]); 191 $Res = Db::name('user')->where('id', $UserId)->update(['mobile' => $Mobile, 'updatetime' => time()]);
190 if ($Res) $this->success('绑定成功', 1); 192 if ($Res) $this->success('绑定成功', 1);