|
|
@@ -47,14 +47,14 @@ class User
|
|
|
$token = $this->request->param('token');
|
|
|
|
|
|
if (!$token) {
|
|
|
- return json(['code' => 400, 'msg' => 'user.token_error']);
|
|
|
+ return ret(lang('user.token_error'));
|
|
|
}
|
|
|
|
|
|
try {
|
|
|
Db::startTrans();
|
|
|
$user_id = UserSession::where('token',$token)->where('expire_time','>', time())->value('user_id');
|
|
|
if(!$user_id){
|
|
|
- return json(['code' => 400, 'msg' => 'user.token_error']);
|
|
|
+ return ret(lang('user.token_error'));
|
|
|
}
|
|
|
|
|
|
$cs_uid = getAutoCsUid();
|
|
|
@@ -77,8 +77,8 @@ class User
|
|
|
$userInfo['setting']=$setting;
|
|
|
}
|
|
|
|
|
|
- if($userInfo['status']==0){
|
|
|
- return warning(lang('user.forbid'));
|
|
|
+ if($userInfo['status']==1){
|
|
|
+ return ret(lang('user.forbid'));
|
|
|
}
|
|
|
|
|
|
$update=[
|
|
|
@@ -102,7 +102,7 @@ class User
|
|
|
Db::commit();
|
|
|
} catch (\Exception $e) {
|
|
|
Db::rollback();
|
|
|
- return json(['code' => 400, 'msg' => $e->getMessage()]);
|
|
|
+ return error($e->getMessage());
|
|
|
}
|
|
|
|
|
|
//如果登录信息中含有client——id则自动进行绑定
|
|
|
@@ -132,7 +132,7 @@ class User
|
|
|
$params=request()->param();
|
|
|
$where['role'] = 0;
|
|
|
if (empty($params['account']) || empty($params['uid']) || empty($params['from'])) {
|
|
|
- return json(['code' => 400, 'msg' => '参数错误']);
|
|
|
+ return ret(lang('参数错误'));
|
|
|
}
|
|
|
if (!empty($params['account'])) {
|
|
|
$where[] = ['account', '=', $params['account']];
|
|
|
@@ -185,8 +185,8 @@ class User
|
|
|
$userInfo['setting']=$setting;
|
|
|
}
|
|
|
}
|
|
|
- if($userInfo['status']==0){
|
|
|
- return warning(lang('user.forbid'));
|
|
|
+ if($userInfo['status']==1){
|
|
|
+ return ret(lang('user.forbid'));
|
|
|
}
|
|
|
|
|
|
$update=[
|
|
|
@@ -211,7 +211,7 @@ class User
|
|
|
Db::commit();
|
|
|
} catch (\Exception $e) {
|
|
|
Db::rollback();
|
|
|
- return json(['code' => 400, 'msg' => $e->getMessage()]);
|
|
|
+ return error($e->getMessage());
|
|
|
}
|
|
|
|
|
|
//如果登录信息中含有client——id则自动进行绑定
|