|
@@ -22,10 +22,8 @@ class UserLoginLogic |
|
@@ -22,10 +22,8 @@ class UserLoginLogic |
|
22
|
|
22
|
|
|
23
|
public function __construct()
|
23
|
public function __construct()
|
|
24
|
{
|
24
|
{
|
|
25
|
- //验证账号密码
|
|
|
|
26
|
$this->param = request()->all();
|
25
|
$this->param = request()->all();
|
|
27
|
$this->model = new User();
|
26
|
$this->model = new User();
|
|
28
|
-
|
|
|
|
29
|
}
|
27
|
}
|
|
30
|
|
28
|
|
|
31
|
/**
|
29
|
/**
|
|
@@ -86,7 +84,6 @@ class UserLoginLogic |
|
@@ -86,7 +84,6 @@ class UserLoginLogic |
|
86
|
if(isset($info['token']) && !empty($info['token'])){
|
84
|
if(isset($info['token']) && !empty($info['token'])){
|
|
87
|
//清除上一次用户缓存
|
85
|
//清除上一次用户缓存
|
|
88
|
Cache::pull($info['token']);
|
86
|
Cache::pull($info['token']);
|
|
89
|
- Cache::pull('login-project-'.$this->param['mobile']);
|
|
|
|
90
|
}
|
87
|
}
|
|
91
|
//生成新token
|
88
|
//生成新token
|
|
92
|
$token = md5(uniqid().$info['id']);
|
89
|
$token = md5(uniqid().$info['id']);
|
|
@@ -178,7 +175,7 @@ class UserLoginLogic |
|
@@ -178,7 +175,7 @@ class UserLoginLogic |
|
178
|
|
175
|
|
|
179
|
/**
|
176
|
/**
|
|
180
|
* @remark :组装返回数据
|
177
|
* @remark :组装返回数据
|
|
181
|
- * @name :getProjectInfo
|
178
|
+ * @name :assembleParam
|
|
182
|
* @author :lyh
|
179
|
* @author :lyh
|
|
183
|
* @method :post
|
180
|
* @method :post
|
|
184
|
* @time :2023/8/29 15:26
|
181
|
* @time :2023/8/29 15:26
|
|
@@ -343,10 +340,7 @@ class UserLoginLogic |
|
@@ -343,10 +340,7 @@ class UserLoginLogic |
|
343
|
public function wechatLogin($wechat){
|
340
|
public function wechatLogin($wechat){
|
|
344
|
$info = $this->model->read(['wechat'=>$wechat]);
|
341
|
$info = $this->model->read(['wechat'=>$wechat]);
|
|
345
|
if($info === false){
|
342
|
if($info === false){
|
|
346
|
- $data = [
|
|
|
|
347
|
- 'code'=>0,
|
|
|
|
348
|
- 'message'=>'当前用户未绑定账户,请绑定后登录',
|
|
|
|
349
|
- ];
|
343
|
+ $data = ['code'=>0, 'message'=>'当前用户未绑定账户,请绑定后登录',];
|
|
350
|
}else {
|
344
|
}else {
|
|
351
|
//获取项目详情
|
345
|
//获取项目详情
|
|
352
|
$info = $this->autoAssembleParam($info,User::LOGIN_PASSWORD_SOURCE);
|
346
|
$info = $this->autoAssembleParam($info,User::LOGIN_PASSWORD_SOURCE);
|
|
@@ -366,8 +360,7 @@ class UserLoginLogic |
|
@@ -366,8 +360,7 @@ class UserLoginLogic |
|
366
|
'message'=>'登陆成功',
|
360
|
'message'=>'登陆成功',
|
|
367
|
'data'=>$info
|
361
|
'data'=>$info
|
|
368
|
];
|
362
|
];
|
|
369
|
- Common::set_user_login(['user_id'=>$info['id'],'ip'=>request()->ip(),
|
|
|
|
370
|
- 'project_id'=>$info['project_id'], 'type'=>2 ,'remark' => '自动登录,用户微信扫码']);
|
363
|
+ Common::set_user_login(['user_id'=>$info['id'],'ip'=>request()->ip(), 'project_id'=>$info['project_id'], 'type'=>2 ,'remark' => '自动登录,用户微信扫码']);
|
|
371
|
}
|
364
|
}
|
|
372
|
return $this->success($data);
|
365
|
return $this->success($data);
|
|
373
|
}
|
366
|
}
|