修改用户登陆头像注册
This commit is contained in:
parent
674fbbc394
commit
1825a5bb7e
@ -281,6 +281,10 @@ class LoginService extends BaseService
|
|||||||
return fail(HttpEnumCode::HTTP_ERROR,"账号不存在,请联系客服");
|
return fail(HttpEnumCode::HTTP_ERROR,"账号不存在,请联系客服");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 获取用户默认头像oss地址
|
||||||
|
$UserService = new UserService();
|
||||||
|
$avatar = $UserService->getUserDefaultOssAvatar($user_type);
|
||||||
|
|
||||||
// 新增用户表
|
// 新增用户表
|
||||||
$data = array();
|
$data = array();
|
||||||
$data['user_name'] = substr($phone,-4);
|
$data['user_name'] = substr($phone,-4);
|
||||||
@ -288,6 +292,7 @@ class LoginService extends BaseService
|
|||||||
$data['wx_mobile'] = $phone;
|
$data['wx_mobile'] = $phone;
|
||||||
$data['user_type'] = $user_type;
|
$data['user_type'] = $user_type;
|
||||||
$data['register_method'] = 2;
|
$data['register_method'] = 2;
|
||||||
|
$data['avatar'] = $avatar;
|
||||||
$data['login_ip'] = (new Http())->getIp() ?? "";// 登陆ip
|
$data['login_ip'] = (new Http())->getIp() ?? "";// 登陆ip
|
||||||
$data['last_login_at'] = date('Y-m-d H:i:s', time());// 最后登陆时间
|
$data['last_login_at'] = date('Y-m-d H:i:s', time());// 最后登陆时间
|
||||||
$user = UserModel::addUser($data);
|
$user = UserModel::addUser($data);
|
||||||
@ -303,6 +308,7 @@ class LoginService extends BaseService
|
|||||||
$data['status'] = 1;
|
$data['status'] = 1;
|
||||||
$data['open_id'] = $open_id ?? '';
|
$data['open_id'] = $open_id ?? '';
|
||||||
$data['wx_session_key'] = $session_key ?? "";
|
$data['wx_session_key'] = $session_key ?? "";
|
||||||
|
$data['avatar'] = $avatar;
|
||||||
|
|
||||||
if ($user['user_type'] == 1) {
|
if ($user['user_type'] == 1) {
|
||||||
// 患者
|
// 患者
|
||||||
@ -340,7 +346,7 @@ class LoginService extends BaseService
|
|||||||
// 创建im账号
|
// 创建im账号
|
||||||
$account = new Account();
|
$account = new Account();
|
||||||
// 创建单个账号
|
// 创建单个账号
|
||||||
$account->createAccount($user->user_id,$user->user_name,"");
|
$account->createAccount($user->user_id,$user->user_name,$avatar);
|
||||||
} else {
|
} else {
|
||||||
// 已注册用户
|
// 已注册用户
|
||||||
if ($user_type != $user['user_type']) {
|
if ($user_type != $user['user_type']) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user