ios 上架版本过滤处理
This commit is contained in:
@@ -3,6 +3,7 @@
|
|||||||
namespace app\common\controller;
|
namespace app\common\controller;
|
||||||
|
|
||||||
use think\Controller;
|
use think\Controller;
|
||||||
|
use think\Db;
|
||||||
|
|
||||||
|
|
||||||
class BaseCom extends Controller
|
class BaseCom extends Controller
|
||||||
@@ -24,22 +25,40 @@ class BaseCom extends Controller
|
|||||||
if($is_maintenance == 2){
|
if($is_maintenance == 2){
|
||||||
return V(203, '系统维护中');
|
return V(203, '系统维护中');
|
||||||
}
|
}
|
||||||
$token = input('token', '');
|
//检测是什么系统
|
||||||
if (empty($token)) {
|
$system = input('system','');
|
||||||
$token = request()->header('token');
|
if(empty($system)){
|
||||||
if(empty($token)){
|
$system = request()->header('system');
|
||||||
return V(301, '登录失效');
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
//版本号
|
||||||
$reslut = model('UserToken')->check_login_token($token);
|
$version = input('App-Version','');
|
||||||
if($reslut['code'] != 1) {
|
if(empty($version)){
|
||||||
model('UserToken')->where('token', $token)->update(['token' => 1]);
|
$version = request()->header('App-Version');
|
||||||
return V($reslut['code'], $reslut['msg'],$reslut['data']);
|
}
|
||||||
} else {
|
$zhenshi_version = db::name('version')->where('type', 2)->value('oldversion');
|
||||||
$this->uid = $reslut['data'];
|
$result = version_compare($version,$zhenshi_version);
|
||||||
|
if($system == 'iOS' && $result > 0){
|
||||||
|
$this->uid = 0;
|
||||||
//定义一个常量
|
//定义一个常量
|
||||||
define('UID', $this->uid);
|
define('UID', $this->uid);
|
||||||
|
}else{
|
||||||
|
$token = input('token', '');
|
||||||
|
if (empty($token)) {
|
||||||
|
$token = request()->header('token');
|
||||||
|
if(empty($token)){
|
||||||
|
return V(301, '登录失效');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$reslut = model('UserToken')->check_login_token($token);
|
||||||
|
if($reslut['code'] != 1) {
|
||||||
|
model('UserToken')->where('token', $token)->update(['token' => 1]);
|
||||||
|
return V($reslut['code'], $reslut['msg'],$reslut['data']);
|
||||||
|
} else {
|
||||||
|
$this->uid = $reslut['data'];
|
||||||
|
//定义一个常量
|
||||||
|
define('UID', $this->uid);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user