去除更新检测

This commit is contained in:
fofolee 2020-04-10 17:47:08 +08:00
parent 6f672b22fb
commit e80601389f

View File

@ -1,33 +1,33 @@
checkUpdate = () => { // checkUpdate = () => {
let p = window.pluginInfo; // let p = window.pluginInfo;
if (!utools.db.get(p.version)) { // if (!utools.db.get(p.version)) {
$.get(p.publishPage, data => { // $.get(p.publishPage, data => {
var re = new RegExp(`<title>\\[插件\\]\\[${p.pluginName} (.*?)\\](.*?) - 猿料<\\/title>`) // var re = new RegExp(`<title>\\[插件\\]\\[${p.pluginName} (.*?)\\](.*?) - 猿料<\\/title>`)
data = re.exec(data); // data = re.exec(data);
let lastVer = data[1], // let lastVer = data[1],
desc = data[2]; // desc = data[2];
if (lastVer != p.version) { // if (lastVer != p.version) {
options = { // options = {
type: 'info', // type: 'info',
title: '插件有可用更新', // title: '插件有可用更新',
icon: window.logo, // icon: window.logo,
cancelId: 1, // cancelId: 1,
message: `发现新版本 ${lastVer},是否前往更新?\n更新内容:\n${desc}`, // message: `发现新版本 ${lastVer},是否前往更新?\n更新内容\n${desc}`,
buttons: ['起驾', '朕知道了', '别再烦朕'] // buttons: ['起驾', '朕知道了', '别再烦朕']
}; // };
window.messageBox(options, index => { // window.messageBox(options, index => {
if (index == 0) { // if (index == 0) {
window.open(p.publishPage) // window.open(p.publishPage)
} else if (index == 2) { // } else if (index == 2) {
utools.db.put({ _id: p.version, data: "pass" }) // utools.db.put({ _id: p.version, data: "pass" })
} // }
}) // })
} else { // } else {
console.log('当前已是最新版本!'); // console.log('当前已是最新版本!');
} // }
}) // })
} // }
} // }
saveIcon = async tasks => { saveIcon = async tasks => {
if (window.isWin) { if (window.isWin) {
@ -128,7 +128,7 @@ show = text => {
utools.onPluginEnter(({ code, type, payload }) => { utools.onPluginEnter(({ code, type, payload }) => {
utools.setExpendHeight(0); utools.setExpendHeight(0);
checkUpdate(); // checkUpdate();
if (window.isWin) { if (window.isWin) {
utools.setExpendHeight(50); utools.setExpendHeight(50);
$("#tasklist").html(`<div class="load">Loading...</div>`); $("#tasklist").html(`<div class="load">Loading...</div>`);