|
...
|
...
|
@@ -18,6 +18,7 @@ use App\Models\Service\Service; |
|
|
|
use App\Models\Sms\SmsLog;
|
|
|
|
use App\Models\User\User as UserModel;
|
|
|
|
use App\Utils\EncryptUtils;
|
|
|
|
use \Illuminate\Support\Facades\Cache;
|
|
|
|
use Mrgoon\AliSms\AliSms;
|
|
|
|
|
|
|
|
class LoginController extends BaseController
|
|
...
|
...
|
@@ -157,6 +158,19 @@ class LoginController extends BaseController |
|
|
|
public function globalSo_v6_login(){
|
|
|
|
$common = new Common();
|
|
|
|
$arr = $common->decrypt($this->param['token']);
|
|
|
|
$this->response('success',Code::SUCCESS,$arr);
|
|
|
|
if(empty($arr)){
|
|
|
|
$this->response('登录失败',Code::USER_ERROR);
|
|
|
|
}
|
|
|
|
$userModel = new UserModel();
|
|
|
|
$info = $userModel->read(['mobile'=>$arr['phone']]);
|
|
|
|
if($info === false){
|
|
|
|
$this->response('当前用户不存在请联系管理员',Code::USER_ERROR);
|
|
|
|
}
|
|
|
|
//生成新token
|
|
|
|
$token = md5(uniqid().$info['id']);
|
|
|
|
//存储缓存
|
|
|
|
$info['token'] = $token;
|
|
|
|
Cache::add($token,$info,3600);
|
|
|
|
$this->response('success',Code::SUCCESS,['token'=>$token]);
|
|
|
|
}
|
|
|
|
} |
...
|
...
|
|