diff --git a/src/composables/first-visit.ts b/src/composables/first-visit.ts index c1fe630..1138a2f 100644 --- a/src/composables/first-visit.ts +++ b/src/composables/first-visit.ts @@ -4,14 +4,13 @@ import { db } from 'src/utils/db' import { localData } from 'src/utils/local-data' import { dialogOptions } from 'src/utils/values' import { onMounted } from 'vue' -import { useRoute, useRouter } from 'vue-router' +import { useRouter } from 'vue-router' export function useFirstVisit() { const $q = useQuasar() - const route = useRoute() const router = useRouter() onMounted(() => { - if (route.path === '/set-provider') { + if (location.pathname === '/set-provider') { localData.visited = true return } diff --git a/src/pages/SetProvider.vue b/src/pages/SetProvider.vue index f4480ab..910cd22 100644 --- a/src/pages/SetProvider.vue +++ b/src/pages/SetProvider.vue @@ -19,10 +19,19 @@ until(() => userPerfsStore.ready).toBeTruthy().then(() => { if (!new Validator(ProviderSchema).validate(provider)) { throw new Error('Invalid provider schema') } + const bak = userPerfsStore.perfs.provider userPerfsStore.perfs.provider = provider $q.notify({ - message: '已设置服务商', - color: 'positive' + message: `已设置服务商为:${provider.settings.baseURL}`, + color: 'positive', + actions: [{ + label: '还原', + handler: () => { + userPerfsStore.perfs.provider = bak + }, + color: 'white' + }], + timeout: 6000 }) } catch (e) { console.error(e) @@ -31,7 +40,7 @@ until(() => userPerfsStore.ready).toBeTruthy().then(() => { color: 'negative' }) } finally { - router.replace('/') + router.replace('/settings') } }) diff --git a/src/version.json b/src/version.json index a1bd9ea..6b0c3b9 100644 --- a/src/version.json +++ b/src/version.json @@ -1,5 +1,5 @@ { - "version": "v1.2.2-beta", - "versionCode": 10202, + "version": "v1.2.3-beta", + "versionCode": 10203, "forceUpdateFrom": 10199 }