|
@@ -38,17 +38,16 @@ class Wechat extends Frontend
|
|
], 302);
|
|
], 302);
|
|
}
|
|
}
|
|
if ($this->request->isPost()) {
|
|
if ($this->request->isPost()) {
|
|
- $params = $this->request->post([ 'mobile', 'nickname', 'avatar','openid','unionid', "keep",
|
|
|
|
- 'registerType'=>"wx"]);
|
|
|
|
|
|
+ $params = $this->request->post(['openid','unionid', "keep", 'registerType'=>"wx"]);
|
|
$validate = new UserValidate();
|
|
$validate = new UserValidate();
|
|
try {
|
|
try {
|
|
$validate->scene("wechat")->check($params);
|
|
$validate->scene("wechat")->check($params);
|
|
- } catch (ValidateException $e) {
|
|
|
|
|
|
+ } catch (ValidateException $e){
|
|
$this->error($e->getMessage());
|
|
$this->error($e->getMessage());
|
|
}
|
|
}
|
|
$res = $this->auth->isWxUser($params['openid'], $params['unionid'], (bool)$params['keep']);
|
|
$res = $this->auth->isWxUser($params['openid'], $params['unionid'], (bool)$params['keep']);
|
|
if (!$res) {
|
|
if (!$res) {
|
|
- $res = $this->auth->WxRegister($params['nickname'], $params['mobile'], $params['openid'], $params['openid'],$params['avatar']);
|
|
|
|
|
|
+ $res = $this->auth->WxRegister( $params['openid'], $params['unionid']);
|
|
}
|
|
}
|
|
|
|
|
|
if (isset($res) && $res === true) {
|
|
if (isset($res) && $res === true) {
|