测试调整pre

This commit is contained in:
ywyonui 2025-10-22 12:20:00 +08:00
parent 7c7a34ad2a
commit 091411cda0
5 changed files with 21 additions and 4 deletions

View File

@ -30,6 +30,9 @@ const loadByDb = async (data: any) => {
console.log("用户未登录,跳过处理");
return;
}
// tick
await nextTick();
try {
// urlidXxts
const xxtsRes = await xxtsFindByIdApi({ id: data.id });
@ -37,12 +40,23 @@ const loadByDb = async (data: any) => {
const xxts = xxtsRes.result;
setXxts(xxts);
}
const xsList = getUser.xsList || [];
// tick
await nextTick();
// store
const currentUser = useUserStore().getUser;
const xsList = currentUser.xsList || [];
if (xsList && xsList.length > 0) {
//
const curXs = xsList.find((xs: any) => xs.id == data.xsId);
if (curXs) {
setCurXs(curXs);
// tick
await nextTick();
//
PageUtils.checkQkLogic(data.xkLxId);
}

View File

@ -59,6 +59,7 @@ export const useCommonStore = defineStore({
actions: {
cleanData() {
this.data = {};
this.$reset();
},
setData(key: string, data: any) {
this.data[key] = data;

View File

@ -68,6 +68,7 @@ export const useDataStore = defineStore({
this.jcBz = {};
this.lcgl = {};
this.xxts = {};
this.$reset();
},
setData(data: any) {
this.data = data;

View File

@ -19,6 +19,7 @@ export const useDicStore = defineStore({
actions: {
cleanData() {
this.data = {};
this.$reset();
},
setData(data: any) {
this.data = data;

View File

@ -163,6 +163,7 @@ export const useUserStore = defineStore({
if (this.userdata && this.userdata.openId && this.userdata.userType === "JZ"
&& openId && this.userdata.openId === openId
) {
this.afterLoginAction(this.userdata);
return true;
}
// 如果当前登录的用户的openid和传入的openid不匹配则调用checkOpenId接口进行校验
@ -192,9 +193,7 @@ export const useUserStore = defineStore({
*/
afterLoginAction(value: any) {
// 为了避免数据加载异常。这里清理一下缓存
useDicStore().cleanData()
useCommonStore().cleanData();
useDataStore().cleanData();
this.logout();
// 设置用户数据
this.setUser(value)
if (value.xsList && value.xsList.length > 0) {
@ -228,6 +227,7 @@ export const useUserStore = defineStore({
this.setXsPickerInitialized(false); // 注销时重置学生选择器状态
this.exitWs();
this.wsCallback = defWsCallback;
this.$reset();
useDicStore().cleanData()
useCommonStore().cleanData();
useDataStore().cleanData();