Skip to content

Commit

Permalink
V1.10.1版本
Browse files Browse the repository at this point in the history
  • Loading branch information
szvone committed Sep 16, 2019
1 parent 5f4f617 commit ef8c1b2
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 5 deletions.
19 changes: 16 additions & 3 deletions application/admin/controller/Index.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public function getMain(){
}else{
$gd = '<font color="red">GD库未开启!</font>';
}

return json($this->getReturn(1,"成功",array(
"todayOrder"=>$todayOrder,
"todaySuccessOrder"=>$todaySuccessOrder,
Expand All @@ -83,7 +83,7 @@ public function getMain(){
"MySql"=>$v,
"Thinkphp"=>"v".App::VERSION,
"RunTime"=>$this->sys_uptime(),
"ver"=>"v1.10",
"ver"=>"v".config("ver"),
"gd"=>$gd,
)));

Expand All @@ -103,6 +103,19 @@ private function sys_uptime() {
if ($min !== 0) $output .= $min."分钟";
return $output;
}
public function checkUpdate(){
if (!Session::has("admin")){
return json($this->getReturn(-1,"没有登录"));
}
$ver = $this->getCurl("https://raw.githubusercontent.com/szvone/vmqphp/master/ver");
$ver = explode("|",$ver);

if (sizeof($ver)==2 && $ver[0]!=config("ver")){
return json($this->getReturn(1,"[v".$ver[0]."已于".$ver[1]."发布]","https://github.com/szvone/vmqphp"));
}else{
return json($this->getReturn(0,"程序是最新版"));
}
}

public function getSettings(){
if (!Session::has("admin")){
Expand Down Expand Up @@ -368,7 +381,7 @@ function getCurl($url, $post = 0, $cookie = 0, $header = 0, $nobaody = 0)
$klsf[] = 'Accept-Language:zh-cn';
//$klsf[] = 'Content-Type:application/json';
$klsf[] = 'User-Agent:Mozilla/5.0 (iPhone; CPU iPhone OS 11_2_1 like Mac OS X) AppleWebKit/604.4.7 (KHTML, like Gecko) Mobile/15C153 MicroMessenger/6.6.1 NetType/WIFI Language/zh_CN';
$klsf[] = 'Referer:https://servicewechat.com/wx7c8d593b2c3a7703/5/page-frame.html';
$klsf[] = 'Referer:'.$url;
curl_setopt($ch, CURLOPT_HTTPHEADER, $klsf);
if ($post) {
curl_setopt($ch, CURLOPT_POST, 1);
Expand Down
2 changes: 1 addition & 1 deletion application/index/controller/Index.php
Original file line number Diff line number Diff line change
Expand Up @@ -589,7 +589,7 @@ private function getCurl($url, $post = 0, $cookie = 0, $header = 0, $nobaody = 0
$klsf[] = 'Accept-Language:zh-cn';
//$klsf[] = 'Content-Type:application/json';
$klsf[] = 'User-Agent:Mozilla/5.0 (iPhone; CPU iPhone OS 11_2_1 like Mac OS X) AppleWebKit/604.4.7 (KHTML, like Gecko) Mobile/15C153 MicroMessenger/6.6.1 NetType/WIFI Language/zh_CN';
$klsf[] = 'Referer:https://servicewechat.com/wx7c8d593b2c3a7703/5/page-frame.html';
$klsf[] = 'Referer:'.$url;
curl_setopt($ch, CURLOPT_HTTPHEADER, $klsf);
if ($post) {
curl_setopt($ch, CURLOPT_POST, 1);
Expand Down
2 changes: 1 addition & 1 deletion config/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -142,5 +142,5 @@
'show_error_msg' => false,
// 异常处理handle类 留空使用 \think\exception\Handle
'exception_handle' => '',

'ver' => '1.10',
];
16 changes: 16 additions & 0 deletions public/aaa.html
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,22 @@
if (data == null || data == "" || data.code==-1) {
window.location.href = "index.html";
}
setTimeout(function () {
$.post("admin/index/checkUpdate",function (data) {
if (data.code==1) {

layer.confirm(data.msg, {
btn: ['去看看','算啦'],
title:"有更新啦"
}, function(){
window.location.href = data.data;
});

}
});
},2000);


console.log(data);
var out_menu = "";
for (var i = 0;i<data.length;i++){
Expand Down

0 comments on commit ef8c1b2

Please sign in to comment.