作者 xwp
1 个管道 的构建 通过 耗费 1 秒

登录注册调试

... ... @@ -121,7 +121,9 @@ class User extends Api
public function miniLogin()
{
$code = $this->request->request('code');
$mobile = $this->request->request('mobile');
$iv = $this->request->request('iv');
$encryptedData = $this->request->request('encryptedData');
if (!$code) {
$this->error(__('Invalid code'));
}
... ... @@ -134,6 +136,12 @@ class User extends Api
}
$openid = $session['openid'];
$sessionKey = $session['session_key'];
$mini = new \WeMini\Crypt($this->config);
$getUserInfo = $mini->decode($iv,$sessionKey,$encryptedData);
echo json_encode($getUserInfo['purePhoneNumber']);exit;
$mobile = $getUserInfo['purePhoneNumber'];
if(isset($mobile)){
$user = new \app\admin\model\User;
... ...