win增加内存排序、显示用户名功能

This commit is contained in:
fofolee
2019-05-03 23:19:27 +08:00
parent d30887651f
commit f629b8ef71
5 changed files with 34 additions and 22 deletions

View File

@@ -1,27 +1,29 @@
checkUpdate = () => {
let cv = 'v0.0.5',
pg = 'https://yuanliao.info/d/296';
if (!utools.db.get(cv)) {
$.get(pg, data => {
data = /<title>\[插件\]\[关闭进程 ProcessKiller (.*?)\](.*?) - 猿料<\/title>/.exec(data);
let lv = data[1],
let p = window.pluginInfo;
if (!utools.db.get(p.version)) {
$.get(p.publishPage, data => {
var re = new RegExp(`<title>\\[插件\\]\\[${p.pluginName} (.*?)\\](.*?) - 猿料<\\/title>`)
data = re.exec(data);
let lastVer = data[1],
desc = data[2];
if (lv != cv) {
if (lastVer != p.version) {
options = {
type: 'info',
title: '插件有可用更新',
icon: window.getLogo(),
icon: window.logo,
cancelId: 1,
message: `发现新版本 ${lv},是否前往更新?\n更新内容:\n${desc}`,
message: `发现新版本 ${lastVer},是否前往更新?\n更新内容:\n${desc}`,
buttons: ['起驾', '朕知道了', '别再烦朕']
};
window.messageBox(options, index => {
if (index == 0) {
window.open(pg)
window.open(p.publishPage)
} else if (index == 2) {
utools.db.put({ _id: cv, data: "pass" })
utools.db.put({ _id: p.version, data: "pass" })
}
})
} else {
console.log('当前已是最新版本!');
}
})
}