add cache for getting user info and system configs

This commit is contained in:
RockYang
2024-08-08 14:37:33 +08:00
parent 167c59a159
commit 2d4959aa7d
36 changed files with 185 additions and 110 deletions

View File

@@ -208,7 +208,7 @@ import {Delete, InfoFilled, Picture} from "@element-plus/icons-vue";
import {httpGet, httpPost} from "@/utils/http";
import {ElMessage, ElMessageBox, ElNotification} from "element-plus";
import Clipboard from "clipboard";
import {checkSession} from "@/action/session";
import {checkSession, getSystemInfo} from "@/store/cache";
import {useSharedStore} from "@/store/sharedata";
import TaskList from "@/components/TaskList.vue";
import BackTop from "@/components/BackTop.vue";
@@ -263,7 +263,7 @@ onMounted(() => {
ElMessage.error('复制失败!');
})
httpGet("/api/config/get?key=system").then(res => {
getSystemInfo().then(res => {
dallPower.value = res.data["dall_power"]
}).catch(e => {
ElMessage.error("获取系统配置失败:" + e.message)