...
|
...
|
@@ -231,20 +231,98 @@ class IndexController extends RestBaseController |
|
|
}
|
|
|
|
|
|
/**
|
|
|
* @title 更新版本
|
|
|
* @title IOS更新版本
|
|
|
* @description 接口说明
|
|
|
* @author 开发者
|
|
|
* @url /api/home/index/updateVersion
|
|
|
* @url /api/home/index/updateIOSVersion
|
|
|
* @method GET
|
|
|
*
|
|
|
* @header name:token require:1 default: desc:header
|
|
|
*
|
|
|
* @return project_id:项目id
|
|
|
* @return project_name:项目名称
|
|
|
* @param name:version_number type:string require:1 default: other desc:版本号
|
|
|
*
|
|
|
* @return status:状态(0:无更新,1:有更新-强制,2:有更新-非强制)
|
|
|
* @return update_content:更新内容
|
|
|
*/
|
|
|
public function updateVersion(){
|
|
|
public function updateIOSVersion(){
|
|
|
if($this->request->isGet()){
|
|
|
$this->error('请联系管理员分配公司!');
|
|
|
$version_number = $this->request->get('version_number');
|
|
|
$rule = config('site.version');
|
|
|
$validate = new Validate($rule['rule'],$rule['msg']);
|
|
|
if (!$validate->check(['version_number'=>$version_number])) {
|
|
|
$this->error($validate->getError());
|
|
|
}
|
|
|
|
|
|
$common = new CommonController();
|
|
|
$res = $common->getVersion(0,'id,last_version,update_content,force_update');
|
|
|
if($res){
|
|
|
if($res['last_version'] > $version_number){
|
|
|
$data['update_content'] = $res['update_content'];
|
|
|
if($res['force_update'] == 0){
|
|
|
//强制更新
|
|
|
$data['status'] = 1;
|
|
|
$this->success('成功',$data);
|
|
|
}else{
|
|
|
//不强制更新
|
|
|
$data['status'] = 2;
|
|
|
$this->success('成功',$data);
|
|
|
}
|
|
|
}else{
|
|
|
$this->success('成功',['status'=>0]);
|
|
|
}
|
|
|
}
|
|
|
}else{
|
|
|
$this->error('请求方式错误!');
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* @title Android更新版本
|
|
|
* @description 接口说明
|
|
|
* @author 开发者
|
|
|
* @url /api/home/index/updateAndroidVersion
|
|
|
* @method GET
|
|
|
*
|
|
|
* @header name:token require:1 default: desc:header
|
|
|
*
|
|
|
* @param name:version_number type:string require:1 default: other desc:版本号
|
|
|
*
|
|
|
* @return status:状态(0:无更新,1:有更新-强制,2:有更新-非强制)
|
|
|
* @return update_content:更新内容
|
|
|
* @return soft_size:软件大小
|
|
|
* @return download_url:下载地址
|
|
|
*/
|
|
|
public function updateAndroidVersion(){
|
|
|
if($this->request->isGet()){
|
|
|
$version_number = $this->request->get('version_number');
|
|
|
$rule = config('site.version');
|
|
|
$validate = new Validate($rule['rule'],$rule['msg']);
|
|
|
if (!$validate->check(['version_number'=>$version_number])) {
|
|
|
$this->error($validate->getError());
|
|
|
}
|
|
|
|
|
|
$common = new CommonController();
|
|
|
$res = $common->getVersion(1,'id,last_version,update_content,force_update,soft_size,download_url');
|
|
|
if($res){
|
|
|
if($res['last_version'] > $version_number){
|
|
|
$data = [
|
|
|
'update_content'=>$res['update_content'],
|
|
|
'soft_size'=>$res['soft_size'],
|
|
|
'download_url'=>$res['download_url']
|
|
|
];
|
|
|
if($res['force_update'] == 0){
|
|
|
//强制更新
|
|
|
$data['status'] = 1;
|
|
|
$this->success('成功',$data);
|
|
|
}else{
|
|
|
//不强制更新
|
|
|
$data['status'] = 2;
|
|
|
$this->success('成功',$data);
|
|
|
}
|
|
|
}else{
|
|
|
$this->success('成功',['status'=>0]);
|
|
|
}
|
|
|
}
|
|
|
}else{
|
|
|
$this->error('请求方式错误!');
|
|
|
}
|
...
|
...
|
|