|
|
@@ -23,7 +23,7 @@ export default {
|
|
|
name: 'Home',
|
|
|
data() {
|
|
|
return {
|
|
|
- autoUpdate: false,//自动升级
|
|
|
+ testMode: false, //是否测试模式
|
|
|
aSideState: false,
|
|
|
thisClick: 0,
|
|
|
tabwildState: 1,
|
|
|
@@ -51,7 +51,7 @@ export default {
|
|
|
//浏览器默认的
|
|
|
// localStorage.eqSn = '30:9C:23:0C:8B:1E';
|
|
|
localStorage.eqSn = 'd104bd6ffec3d5ba';
|
|
|
- localStorage.version = '2.0';
|
|
|
+ localStorage.version = '2.1.6';
|
|
|
|
|
|
if (window.plus) {
|
|
|
plusReady();
|
|
|
@@ -83,51 +83,30 @@ export default {
|
|
|
// 获取转发端口地址
|
|
|
that.getServeIpAddress(e.uuid);
|
|
|
|
|
|
- // 公司测试机用公司版本升级
|
|
|
- // if (uuid == "a1f2d679c1624d3a" || uuid == "8e501b0bde9ce600") {
|
|
|
- if (uuid == "1277fcb4c81e29d2" || uuid == "8e501b0bde9ce600") {
|
|
|
- //首发版本 '1.1.0' 在线版不需要自动升级
|
|
|
- // 内测版自动升级
|
|
|
- let url = 'http://192.168.0.3:19096/v1/Sensors/QueryVueFramework';
|
|
|
- let param = {};
|
|
|
- let postdata = qs.stringify(param);
|
|
|
- axios.post(url, postdata).then(function (data) {
|
|
|
- let json = data.data;
|
|
|
- if (json.Code == 0) {
|
|
|
- if (localStorage.version != json.VueFramework.Version) {
|
|
|
- // 测试版本下载
|
|
|
- console.log(332);
|
|
|
- let downUrl = "http://192.168.0.3:19096/v1/Sensors/DownloadVueFramework";
|
|
|
- that.downWgt(downUrl);
|
|
|
- }
|
|
|
- } else {
|
|
|
- console.log(json.Memo);
|
|
|
- }
|
|
|
- }, function (response) {
|
|
|
- console.info(response);
|
|
|
- })
|
|
|
- } else {
|
|
|
- console.log(223);
|
|
|
- // 正式版
|
|
|
- //开启自动升级
|
|
|
- // 教室版本自动升级,户外版禁用自动升级
|
|
|
- if (runVersion == 'outDoor') {
|
|
|
- console.log('户外版禁用自动升级');
|
|
|
- return false
|
|
|
- } else {
|
|
|
- // that.checkUpdate();
|
|
|
-
|
|
|
- // 每10分钟检测一下升级信息
|
|
|
- setInterval(() => {
|
|
|
- // console.log("$route.path: " + this.$route.path);
|
|
|
- // console.log("$route.name: " + this.$route.name);
|
|
|
- if (this.$route.name == "Wait") {
|
|
|
- console.log("===> checkUpdate");
|
|
|
- that.checkUpdate();
|
|
|
- }
|
|
|
- }, 600000);
|
|
|
- }
|
|
|
+ // 公司测试机用公司版本升级
|
|
|
+ // if (uuid == "1277fcb4c81e29d2" || uuid == "8e501b0bde9ce600") {
|
|
|
+ if (uuid == "d104bd6ffec3d5ba") { // 内测版
|
|
|
+ that.testMode = true;
|
|
|
+ } else { // 正式版
|
|
|
+ that.testMode = false;
|
|
|
+ }
|
|
|
|
|
|
+ // 教室版本自动升级,户外版禁用自动升级
|
|
|
+ if (runVersion == 'outDoor') {
|
|
|
+ console.log('户外版禁用自动升级');
|
|
|
+ return false
|
|
|
+ } else {
|
|
|
+ that.checkUpdate();
|
|
|
+
|
|
|
+ // 每10分钟检测一下升级信息
|
|
|
+ setInterval(() => {
|
|
|
+ // console.log("$route.path: " + that.$route.path);
|
|
|
+ // console.log("$route.name: " + that.$route.name);
|
|
|
+ if (that.$route.name == "Wait") {
|
|
|
+ console.log("===> checkUpdate");
|
|
|
+ that.checkUpdate();
|
|
|
+ }
|
|
|
+ }, 600000);
|
|
|
}
|
|
|
},
|
|
|
fail: function (e) {
|
|
|
@@ -143,8 +122,8 @@ export default {
|
|
|
vfType: 3 //新版电视端-Http接口
|
|
|
};
|
|
|
let postdata = qs.stringify(param);
|
|
|
- const h = this.$createElement;
|
|
|
- QueryVueFramework(postdata).then(res => {
|
|
|
+ const h = that.$createElement;
|
|
|
+ QueryVueFramework(postdata, that.testMode).then(res => {
|
|
|
let json = res;
|
|
|
if (json.Code == 0) {
|
|
|
console.log('localStorage.version: ' + localStorage.version);
|
|
|
@@ -153,8 +132,8 @@ export default {
|
|
|
if (localStorage.version != json.VueFramework.Version) {
|
|
|
// 正式
|
|
|
plus.nativeUI.toast("发现新版本 " + json.VueFramework.Version + ",准备升级...");
|
|
|
- let url = DownloadVueFramework();
|
|
|
- this.downWgt(url);
|
|
|
+ let url = DownloadVueFramework(that.testMode);
|
|
|
+ that.downWgt(url);
|
|
|
}
|
|
|
}
|
|
|
})
|