|
@@ -7,6 +7,7 @@ use fast\Random;
|
|
|
use fast\Tree;
|
|
|
use think\Config;
|
|
|
use think\Cookie;
|
|
|
+use think\Env;
|
|
|
use think\Hook;
|
|
|
use think\Request;
|
|
|
use think\Session;
|
|
@@ -89,7 +90,13 @@ class Auth extends \fast\Auth
|
|
|
}else{
|
|
|
$admin->seat_id = 0;
|
|
|
}
|
|
|
- Db::name('real_exam')->where(['user_username'=>$username,'exam_status'=>0])->update(['exam_status'=>1]);
|
|
|
+ //登录成功,如果是学员请求地址,更新座号和考试、训练状态
|
|
|
+ if(Env::get('app.is_fault')){
|
|
|
+ $url = config('site.url_type').'/sim/real-exam/student/exam/login-success?userId='.$admin->id.'&ip='.$server_ip;
|
|
|
+ $ret = json_decode(send_get($url),true);
|
|
|
+ }else{
|
|
|
+ Db::name('real_exam')->where(['user_username'=>$username,'exam_status'=>['in',[0,1]]])->update(['exam_status'=>1,'seat_id'=>1]);
|
|
|
+ }
|
|
|
}
|
|
|
Session::set("admin", $admin->toArray());
|
|
|
Session::set("admin.safecode", $this->getEncryptSafecode($admin));
|
|
@@ -162,7 +169,13 @@ class Auth extends \fast\Auth
|
|
|
}else{
|
|
|
$admin->seat_id = 0;
|
|
|
}
|
|
|
- Db::name('real_exam')->where(['user_username'=>$admin->username,'exam_status'=>0])->update(['exam_status'=>1]);
|
|
|
+ //登录成功,如果是学员请求地址,更新座号和考试、训练状态
|
|
|
+ if(Env::get('app.is_fault')){
|
|
|
+ $url = config('site.url_type').'/sim/real-exam/student/exam/login-success?userId='.$admin->id.'&ip='.$server_ip;
|
|
|
+ $ret = json_decode(send_get($url),true);
|
|
|
+ }else{
|
|
|
+ Db::name('real_exam')->where(['user_username'=>$admin->username,'exam_status'=>['in',[0,1]]])->update(['exam_status'=>1,'seat_id'=>1]);
|
|
|
+ }
|
|
|
}
|
|
|
Session::set("admin", $admin->toArray());
|
|
|
Session::set("admin.safecode", $this->getEncryptSafecode($admin));
|