前端状态数据修复 (#207)

前端状态数据修复
样式修复

Co-authored-by: jinnrry <i@jinnrry.com>
This commit is contained in:
Jinnrryandjinnrry authored and GitHub committed 2024-09-24 20:22:15 +08:00
1 parent f137d59c72
commit b1926807f2
5 files changed
+206 -43

No files matched your search

+19 -4
View File
@@ -1,14 +1,29 @@
import {defineStore} from "pinia";
import {http} from "@/utils/axios";
const useGlobalStatusStore = defineStore('useGlobalStatusStore', {
state() {
return {
isLogin: true,
userInfos:{}
userInfos: {}
}
},
getters: {},
actions: {}
getters: {
isLogin(state) {
return Object.keys(state.userInfos) !== 0
}
},
actions: {
init(callback) {
let that = this
http.post("/api/user/info", {}).then(res => {
if (res.errorNo === 0) {
Object.assign(that.userInfos, res.data)
console.log("userInfos")
callback()
}
})
}
}
})