登录注册

This commit is contained in:
李志鹏
2026-05-18 15:22:08 +08:00
parent 4af58134fd
commit d327797236
16 changed files with 734 additions and 14 deletions

30
src/stores/userInfo.ts Normal file
View File

@@ -0,0 +1,30 @@
// 每一个存储的模块命名规则use开头store结尾
import { defineStore } from 'pinia'
import { ref, computed } from 'vue'
export const useUserInfoStore = defineStore('userInfo', () => {
const state = ref({
userInfo: {},
token: '',
})
// actions
const setUserInfo = (data: any) => {
state.value.userInfo = data
}
const setToken = (data: string) => {
state.value.token = data
}
const logOut = async () => {
}
return {
state,
setToken,
setUserInfo,
logOut,
}
})