mirror of
https://github.com/fofolee/uTools-quickcommand.git
synced 2025-06-08 22:51:25 +08:00
添加版本检测
This commit is contained in:
parent
cf612888fc
commit
17cf743e1f
@ -16,6 +16,15 @@ export default defineComponent({
|
||||
},
|
||||
methods: {
|
||||
pluginEnterEvent() {
|
||||
// 版本检测
|
||||
const requiredVersion = "2.6.1";
|
||||
let version = utools.getAppVersion();
|
||||
if (version < requiredVersion) {
|
||||
this.$router.push({
|
||||
path: `/needupdate/${version}-${requiredVersion}`,
|
||||
});
|
||||
return;
|
||||
}
|
||||
utools.onPluginEnter((enter) => {
|
||||
localStorage["enterData"] = JSON.stringify(enter);
|
||||
this.$router.push(enter.code);
|
||||
|
40
src/pages/NeedUpdate.vue
Normal file
40
src/pages/NeedUpdate.vue
Normal file
@ -0,0 +1,40 @@
|
||||
<template>
|
||||
<div
|
||||
class="fullscreen bg-blue text-white text-center q-pa-md flex flex-center"
|
||||
>
|
||||
<div>
|
||||
<div style="font-size: 20vh">需要升级</div>
|
||||
|
||||
<div class="text-h4" style="opacity: 0.4">
|
||||
uTools 当前版本 {{ version }}<br />然而这个插件是基于
|
||||
{{ requiredversion }} 版本开发的,低于该版本可能会出现不可预料的问题
|
||||
</div>
|
||||
|
||||
<q-btn
|
||||
class="q-mt-xl"
|
||||
color="white"
|
||||
text-color="blue"
|
||||
unelevated
|
||||
@click="update()"
|
||||
label="去官网升级"
|
||||
no-caps
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
requiredversion: this.$route.params.requiredversion,
|
||||
version: this.$route.params.version,
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
update() {
|
||||
utools.shellOpenExternal("https://u.tools/");
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
@ -18,6 +18,10 @@ const routes = [
|
||||
{
|
||||
path: '/panel_:tags(\\w+)',
|
||||
component: () => import('pages/QuickPanel.vue')
|
||||
},
|
||||
{
|
||||
path: '/needupdate/:version-:requiredversion',
|
||||
component: () => import('pages/NeedUpdate.vue')
|
||||
}
|
||||
|
||||
]
|
||||
|
Loading…
x
Reference in New Issue
Block a user