diff --git a/web/src/router/backEnd.ts b/web/src/router/backEnd.ts index f225125..7efe7c8 100644 --- a/web/src/router/backEnd.ts +++ b/web/src/router/backEnd.ts @@ -11,7 +11,7 @@ import { useRoutesList } from '/@/stores/routesList'; import { useTagsViewRoutes } from '/@/stores/tagsViewRoutes'; import { useMenuApi } from '/@/api/menu/index'; import { handleMenu } from '../utils/menu'; -import {BtnPermissionStore} from "/@/plugin/permission/store.permission"; +import { BtnPermissionStore } from '/@/plugin/permission/store.permission'; const menuApi = useMenuApi(); diff --git a/web/src/stores/systemConfig.ts b/web/src/stores/systemConfig.ts index 77896af..a823074 100644 --- a/web/src/stores/systemConfig.ts +++ b/web/src/stores/systemConfig.ts @@ -1,8 +1,7 @@ import { defineStore } from 'pinia'; import { ConfigStates } from './interface'; import { request } from '../utils/service'; - -export const urlPrefix = '/api/system/system_config/'; +export const urlPrefix = '/api/init/settings/'; /** * 系统配置数据 @@ -19,15 +18,7 @@ export const SystemConfigStore = defineStore('SystemConfig', { method: 'get', }).then((ret: { data: [] }) => { // 转换数据格式并保存到pinia - let dataList = ret.data; - dataList.forEach((item: any) => { - let childrens = item.children; - if (childrens.length > 1) { - this.systemConfig[item.key] = childrens; - } else { - this.systemConfig[item.key] = item.value; - } - }); + this.systemConfig = JSON.parse(JSON.stringify(ret.data)); }); }, }, diff --git a/web/src/views/system/login/component/account.vue b/web/src/views/system/login/component/account.vue index 9a98767..88a539d 100644 --- a/web/src/views/system/login/component/account.vue +++ b/web/src/views/system/login/component/account.vue @@ -27,7 +27,7 @@ - + { return formatAxis(new Date()); }); - - const showCaptcha = (): boolean => { - return SystemConfigStore().systemConfig.captcha_state; - }; + // 是否关闭验证码 + const isShowCaptcha = computed(() => { + return SystemConfigStore().systemConfig['base.captcha_state']; + }); const getCaptcha = async () => { loginApi.getCaptcha().then((ret: any) => { @@ -146,8 +146,7 @@ export default defineComponent({ getUserInfo(); //获取所有字典 DictionaryStore().getSystemDictionarys(); - //获取系统配置 - SystemConfigStore().getSystemConfigs(); + // 初始化登录成功时间问候语 let currentTimeInfo = currentTime.value; // 登录成功,跳到转首页 @@ -170,13 +169,15 @@ export default defineComponent({ }; onMounted(() => { getCaptcha(); + //获取系统配置 + SystemConfigStore().getSystemConfigs(); }); return { refreshCaptcha, loginClick, loginSuccess, - showCaptcha, + isShowCaptcha, ...toRefs(state), }; },