上传代码

This commit is contained in:
2025-08-18 14:20:34 +08:00
commit 527fd07910
2408 changed files with 427370 additions and 0 deletions

5
uniapp04/stores/index.ts Normal file
View File

@ -0,0 +1,5 @@
import { createPinia} from 'pinia'
const pinia = createPinia();
export default pinia

View File

@ -0,0 +1,31 @@
import { log } from 'console';
import { defineStore } from 'pinia'
import myAxios from "../API/myAxios";
export const userStore = defineStore('user', {
state: () => {
return {
loginUser:{
id:'',
username:'未登录',
avatarUrl:'',
userRole:'notLogin'
}
}
},
actions:{
//获取用户信息
// userStore.ts
async getLoginUser() {
const res: any = await myAxios.get('login/alipay');
if (res.code === 0 && res.data) {
this.loginUser = res.data; // 确保这里更新了loginUser对象
}
},
//更新用户信息
updateUser(payLoad: any) {
this.loginUser = payLoad;
}
}
})