pref: remove unused import

This commit is contained in:
wzp 2024-12-10 12:56:00 +08:00
parent f5e61ec9ff
commit 4809a1eb85
5 changed files with 11 additions and 15 deletions

View File

@ -6,7 +6,7 @@
</el-icon>
</template>
<template #append>
<el-button v-if="model.verifyImage === 'none'" @click="getVerifyImage">获取验证码</el-button>
<el-button v-if="model.verifyImage === 'none'" @click="updateVerifyImage">获取验证码</el-button>
<el-icon v-else-if="model.verifyImage === 'fetching'" class="is-loading">
<icon-ep-loading />
</el-icon>
@ -18,7 +18,7 @@
alt="验证码"
class="verify-image"
draggable="false"
@click="getVerifyImage"
@click="updateVerifyImage"
/>
</template>
</el-popover>
@ -84,7 +84,7 @@ async function cooldown() {
}
}
async function getVerifyImage() {
async function updateVerifyImage() {
if (model.value.verifyImage === 'fetching' || !canRefresh.value) {
return;
}
@ -106,7 +106,7 @@ async function getVerifyImage() {
key: key,
img
};
cooldown();
cooldown().then();
succeed = true;
} catch (e) {
if (e instanceof AxiosError) {

View File

@ -1,8 +1,6 @@
import { useUserStore } from '@/stores';
import { type PageErrorReason, usePageStore } from '@/stores/page';
import { IdPool, waitRef } from '@/utils';
import { useThrottleFn } from '@vueuse/core';
import { toRef } from 'vue';
import { IdPool } from '@/utils';
import { createRouter, createWebHistory, type RouteRecordRaw } from 'vue-router';
import { RoutePermissionId } from './permissions';
@ -90,7 +88,7 @@ router.beforeEach(async (to, from) => {
case 'initializing':
return false;
}
if (permissionId !== undefined) {
if (permissionId) {
if (userStore.hasPermission(permissionId)) {
return true;
} else {

View File

@ -1,5 +1,5 @@
import { defineStore } from 'pinia';
import { reactive, readonly, ref } from 'vue';
import { reactive, ref } from 'vue';
export type BackgroundURL = string | undefined;
export type BackgroundOptions = {
@ -71,7 +71,7 @@ export const useBackgroundStore = defineStore('background', () => {
}
return {
taskQueue: readonly(taskQueue),
taskQueue: taskQueue,
getURL,
addURL,
newCompId,

View File

@ -1,6 +1,6 @@
import axiosInstance, { type RawResp } from '@/api';
import type { UserInfo } from '@/schemas';
import { userInfoResponseSchema, type idAndNameSchema } from '@/schemas';
import { type idAndNameSchema, userInfoResponseSchema } from '@/schemas';
import { errorMessage } from '@/utils';
import { StorageSerializers, useLocalStorage } from '@vueuse/core';
import { AxiosError } from 'axios';

View File

@ -87,10 +87,8 @@ onBeforeMount(async () => {
return;
}
userInfo.value = userInfoResponse.data;
if (!userInfo.value.avatar) {
}
} catch (e) {
} finally {
if (!userInfo.value.avatar) { /* empty */ }
} catch (e) { /* empty */ } finally {
initialized.value = true;
}
}