mirror of
https://github.com/m-xlsea/ruoyi-plus-soybean.git
synced 2025-09-24 07:49:47 +08:00
refactor(projects): perf code
This commit is contained in:
@ -32,7 +32,7 @@ export const useAppStore = defineStore(SetupStoreId.App, () => {
|
||||
*
|
||||
* @param duration Duration time
|
||||
*/
|
||||
async function reloadPage(duration = 0) {
|
||||
async function reloadPage(duration = 300) {
|
||||
setReloadFlag(false);
|
||||
|
||||
if (duration > 0) {
|
||||
|
@ -81,7 +81,7 @@ export const useAuthStore = defineStore(SetupStoreId.Auth, () => {
|
||||
// 2. store user info
|
||||
localStg.set('userInfo', info);
|
||||
|
||||
// 3. update auth route
|
||||
// 3. update store
|
||||
token.value = loginToken.token;
|
||||
Object.assign(userInfo, info);
|
||||
|
||||
|
@ -104,7 +104,7 @@ export const useRouteStore = defineStore(SetupStoreId.Route, () => {
|
||||
}
|
||||
|
||||
/**
|
||||
* Re-cache routes by route key
|
||||
* Re cache routes by route key
|
||||
*
|
||||
* @param routeKey
|
||||
*/
|
||||
@ -117,7 +117,7 @@ export const useRouteStore = defineStore(SetupStoreId.Route, () => {
|
||||
}
|
||||
|
||||
/**
|
||||
* Re-cache routes by route keys
|
||||
* Re cache routes by route keys
|
||||
*
|
||||
* @param routeKeys
|
||||
*/
|
||||
|
@ -1,8 +1,7 @@
|
||||
import type { RouteLocationNormalizedLoaded, RouteRecordRaw, _RouteRecordBase } from 'vue-router';
|
||||
import type { ElegantConstRoute, LastLevelRouteKey, RouteKey, RouteMap } from '@elegant-router/types';
|
||||
import { useSvgIconRender } from '@sa/hooks';
|
||||
import { $t } from '@/locales';
|
||||
import SvgIcon from '@/components/custom/svg-icon.vue';
|
||||
import { useSvgIcon } from '@/hooks/common/icon';
|
||||
|
||||
/**
|
||||
* Filter auth routes by roles
|
||||
@ -130,7 +129,7 @@ export function updateLocaleOfGlobalMenus(menus: App.Global.Menu[]) {
|
||||
* @param route
|
||||
*/
|
||||
function getGlobalMenuByBaseRoute(route: RouteLocationNormalizedLoaded | ElegantConstRoute) {
|
||||
const { SvgIconVNode } = useSvgIconRender(SvgIcon);
|
||||
const { SvgIconVNode } = useSvgIcon();
|
||||
|
||||
const { name, path } = route;
|
||||
const { title, i18nKey, icon = import.meta.env.VITE_MENU_ICON, localIcon } = route.meta ?? {};
|
||||
|
@ -78,7 +78,7 @@ export function getTabByRoute(route: App.Global.TabRoute) {
|
||||
}
|
||||
|
||||
/**
|
||||
* The vue router will automatically merge the metas of all matched items, and the icons here may be affected by other
|
||||
* The vue router will automatically merge the meta of all matched items, and the icons here may be affected by other
|
||||
* matching items, so they need to be processed separately
|
||||
*
|
||||
* @param route
|
||||
|
Reference in New Issue
Block a user