|
@@ -41,8 +41,8 @@ class Common extends Base
|
|
|
$validate = new \think\Validate([
|
|
|
['openid', 'max:50'],
|
|
|
['unionid', 'max:50'],
|
|
|
- ['nickname|昵称', 'max:50'],
|
|
|
- ['head_pic|头像', 'max:255'],
|
|
|
+// ['nickname|昵称', 'max:50'],
|
|
|
+// ['headimgurl|头像', 'max:255'],
|
|
|
// ['sex|性别', 'in:0,1,2'],
|
|
|
// ['country|国家', 'max:50'],
|
|
|
// ['province|省份', 'max:50'],
|
|
@@ -73,10 +73,10 @@ class Common extends Base
|
|
|
'openid' => $post['openid']??'',
|
|
|
'unionid' => $post['unionid']??'',
|
|
|
'passport' => $passport,
|
|
|
- 'nickname' => $post['nickname']??'',
|
|
|
+ 'nickname' => limitStrLen('nickname', $post['nickname']??'', 50),
|
|
|
'user_type' => User::TYPE_WECHAT,
|
|
|
'user_cate' => User::CATE_USER,
|
|
|
- 'head_pic' => $post['head_pic']??'',
|
|
|
+ 'head_pic' => limitStrLen('headimgurl', $post['headimgurl']??'', 255),
|
|
|
'status' => User::STATUS_PASS,
|
|
|
'ip' => $this->request->ip(),
|
|
|
'sex' => $post['sex']??0,
|
|
@@ -94,6 +94,7 @@ class Common extends Base
|
|
|
"login_time" => time(),
|
|
|
'openid' => $post['openid']??'',
|
|
|
'unionid' => $post['unionid']??'',
|
|
|
+ 'head_pic' => limitStrLen('headimgurl', $post['headimgurl']??'', 255),
|
|
|
];
|
|
|
$user->allowField(true)->save($data);
|
|
|
}
|