登录处理
This commit is contained in:
parent
0892a4771e
commit
4c541c9861
@ -180,3 +180,10 @@ export const jzXsQjListApi = async (params: any) => {
|
|||||||
export const jzXsQjActivitiHistoryApi = async (params: any) => {
|
export const jzXsQjActivitiHistoryApi = async (params: any) => {
|
||||||
return await get("/activiti/history/historicFlow", params);
|
return await get("/activiti/history/historicFlow", params);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取用户最新信息(包含学生信息)
|
||||||
|
*/
|
||||||
|
export const getUserLatestInfoApi = async () => {
|
||||||
|
return await get("/open/login/getLatestInfo");
|
||||||
|
};
|
||||||
|
|||||||
@ -75,14 +75,60 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref } from "vue";
|
import { ref, computed, onMounted, watch } from "vue";
|
||||||
|
import { onShow } from "@dcloudio/uni-app";
|
||||||
import XsPicker from "@/pages/base/components/XsPicker/index.vue"
|
import XsPicker from "@/pages/base/components/XsPicker/index.vue"
|
||||||
import { cmsArticlePageApi } from "@/api/base/server";
|
import { cmsArticlePageApi, getUserLatestInfoApi } from "@/api/base/server";
|
||||||
import { useUserStore } from "@/store/modules/user";
|
import { useUserStore } from "@/store/modules/user";
|
||||||
import { useDataStore } from "@/store/modules/data";
|
import { useDataStore } from "@/store/modules/data";
|
||||||
const { getCurXs } = useUserStore();
|
const { getCurXs } = useUserStore();
|
||||||
const { setData, getAppCode } = useDataStore();
|
const { setData, getAppCode } = useDataStore();
|
||||||
|
|
||||||
|
// 刷新相关变量
|
||||||
|
const { getLastRefreshTime, getRefreshInterval, setLastRefreshTime, updateStudentInfo, updateStudentList } = useUserStore();
|
||||||
|
const REFRESH_INTERVAL = 10 * 60 * 1000; // 10分钟刷新一次(测试用)
|
||||||
|
|
||||||
|
// 检查是否需要刷新学生信息
|
||||||
|
const checkAndRefreshStudentInfo = async () => {
|
||||||
|
const lastRefreshTime = getLastRefreshTime;
|
||||||
|
const currentTime = Date.now();
|
||||||
|
|
||||||
|
if (!lastRefreshTime || (currentTime - lastRefreshTime) > REFRESH_INTERVAL) {
|
||||||
|
await refreshStudentInfo();
|
||||||
|
setLastRefreshTime(currentTime);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// 刷新学生信息
|
||||||
|
const refreshStudentInfo = async () => {
|
||||||
|
try {
|
||||||
|
const response = await getUserLatestInfoApi();
|
||||||
|
if (response && response.result) {
|
||||||
|
// 更新学生列表
|
||||||
|
if (response.result.xsList && response.result.xsList.length > 0) {
|
||||||
|
updateStudentList(response.result.xsList);
|
||||||
|
|
||||||
|
// 更新当前学生信息(保持当前选中的学生)
|
||||||
|
const currentXsId = curXs.value?.id;
|
||||||
|
if (currentXsId) {
|
||||||
|
const currentStudent = response.result.xsList.find((xs: any) => xs.id === currentXsId);
|
||||||
|
if (currentStudent) {
|
||||||
|
updateStudentInfo(currentStudent);
|
||||||
|
} else {
|
||||||
|
// 如果当前学生不在列表中,选择第一个学生
|
||||||
|
updateStudentInfo(response.result.xsList[0]);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// 如果没有当前学生,选择第一个学生
|
||||||
|
updateStudentInfo(response.result.xsList[0]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
// 处理错误,静默失败
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
// 菜单项数据
|
// 菜单项数据
|
||||||
const menuItems = ref([
|
const menuItems = ref([
|
||||||
{
|
{
|
||||||
@ -161,7 +207,6 @@ const goToGlxs = () => {
|
|||||||
|
|
||||||
// 处理菜单点击
|
// 处理菜单点击
|
||||||
function handleMenuClick(item: any) {
|
function handleMenuClick(item: any) {
|
||||||
console.log("点击菜单:", item.title);
|
|
||||||
if (item.path) {
|
if (item.path) {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: item.path,
|
url: item.path,
|
||||||
@ -183,19 +228,46 @@ function goToDetail(notice: any) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const getArticleList = async () => {
|
const getArticleList = async () => {
|
||||||
|
if (curXs.value && curXs.value.njmcId) {
|
||||||
const params = Object.assign({}, pageParams.value, { njmcId: curXs.value.njmcId });
|
const params = Object.assign({}, pageParams.value, { njmcId: curXs.value.njmcId });
|
||||||
|
|
||||||
cmsArticlePageApi(params).then(res => {
|
cmsArticlePageApi(params).then(res => {
|
||||||
announcements.value = res.rows;
|
announcements.value = res.rows;
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
// 接口调用失败
|
// 接口调用失败
|
||||||
console.error("调用检查通知公告接口失败:", error);
|
|
||||||
});
|
});
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
|
// 确保有学生年级信息才获取通知公告
|
||||||
|
if (curXs.value && curXs.value.njmcId) {
|
||||||
getArticleList();
|
getArticleList();
|
||||||
|
} else {
|
||||||
|
// 如果store中没有学生信息,等待一下再尝试
|
||||||
|
setTimeout(() => {
|
||||||
|
if (curXs.value && curXs.value.njmcId) {
|
||||||
|
getArticleList();
|
||||||
|
}
|
||||||
|
}, 100);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 初始化时检查是否需要刷新学生信息
|
||||||
|
await checkAndRefreshStudentInfo();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// 页面显示时检查是否需要刷新
|
||||||
|
onShow(async () => {
|
||||||
|
await checkAndRefreshStudentInfo();
|
||||||
|
});
|
||||||
|
|
||||||
|
// 监听学生信息变化,当学生信息更新时重新获取通知公告
|
||||||
|
watch(curXs, (newXs, oldXs) => {
|
||||||
|
if (newXs && newXs.njmcId) {
|
||||||
|
getArticleList();
|
||||||
|
}
|
||||||
|
}, { immediate: false });
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
|||||||
@ -24,11 +24,11 @@
|
|||||||
<view class="notice-content">
|
<view class="notice-content">
|
||||||
<view v-if="!descExpanded">
|
<view v-if="!descExpanded">
|
||||||
<text class="desc-preview">{{ descPreview }}</text>
|
<text class="desc-preview">{{ descPreview }}</text>
|
||||||
<u-button type="text" size="mini" @click="descExpanded = true">更多</u-button>
|
<u-button type="text" size="mini" class="more-btn" @click="descExpanded = true">更多</u-button>
|
||||||
</view>
|
</view>
|
||||||
<view v-else>
|
<view v-else>
|
||||||
<rich-text :nodes="noticeDetail.jlms" class="desc-rich-text"></rich-text>
|
<rich-text :nodes="noticeDetail.jlms" class="desc-rich-text"></rich-text>
|
||||||
<u-button type="text" size="mini" @click="descExpanded = false">收起</u-button>
|
<u-button type="text" size="mini" class="more-btn" @click="descExpanded = false">收起</u-button>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@ -53,10 +53,7 @@
|
|||||||
v-for="stu in studentList"
|
v-for="stu in studentList"
|
||||||
:key="stu.id || stu.xsId"
|
:key="stu.id || stu.xsId"
|
||||||
class="name-tag"
|
class="name-tag"
|
||||||
:class="{
|
:class="{ received: stu.jlwc_status === 'A' }"
|
||||||
received: stu.jlwc_status === 'A',
|
|
||||||
currentStudent: isCurrentStudent(stu)
|
|
||||||
}"
|
|
||||||
>
|
>
|
||||||
<text>{{ stu.xsxm || stu.name }}</text>
|
<text>{{ stu.xsxm || stu.name }}</text>
|
||||||
<view v-if="stu.jlwc_status === 'A'" class="checkmark-icon">
|
<view v-if="stu.jlwc_status === 'A'" class="checkmark-icon">
|
||||||
@ -68,29 +65,24 @@
|
|||||||
</view>
|
</view>
|
||||||
<view v-else class="empty-state">通知详情未找到</view>
|
<view v-else class="empty-state">通知详情未找到</view>
|
||||||
</view>
|
</view>
|
||||||
<!-- 添加签名组件 -->
|
<!-- 添加签名组件 - 只在需要时显示 -->
|
||||||
<BasicSign ref="signCompRef" :title="signTitle" @confirm="onSignConfirm"/>
|
<BasicSign v-if="showSignature" ref="signCompRef" :title="signTitle"></BasicSign>
|
||||||
<template #bottom>
|
<template #bottom>
|
||||||
<view class="flex-row items-center pb-10 pt-5">
|
<view class="bottom-actions">
|
||||||
<u-button
|
<button class="action-btn publish-btn" @click="onRelayClick">接龙</button>
|
||||||
text="点击接龙"
|
|
||||||
class="mr-15 mr-7"
|
|
||||||
type="primary"
|
|
||||||
@click="onRelayClick"
|
|
||||||
/>
|
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
</BasicLayout>
|
</BasicLayout>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import {ref, computed, watch} from "vue";
|
import { ref, computed, watch, nextTick } from "vue";
|
||||||
import { onLoad } from "@dcloudio/uni-app";
|
import { onLoad } from "@dcloudio/uni-app";
|
||||||
import { getByJlIdApi, jlzxFindByJlParamsApi, relayFinishApi } from "@/api/base/server";
|
import { getByJlIdApi, jlzxFindByJlParamsApi, relayFinishApi } from "@/api/base/server";
|
||||||
import { imagUrl } from "@/utils";
|
import { imagUrl } from "@/utils";
|
||||||
import { BASE_IMAGE_URL } from "@/config";
|
import { BASE_IMAGE_URL } from "@/config";
|
||||||
import { useUserStore } from "@/store/modules/user";
|
import { useUserStore } from "@/store/modules/user";
|
||||||
import {navigateBack, showLoading, hideLoading} from "@/utils/uniapp";
|
import { showLoading, hideLoading } from "@/utils/uniapp";
|
||||||
|
|
||||||
const noticeId = ref<string>("");
|
const noticeId = ref<string>("");
|
||||||
const noticeDetail = ref<any>(null);
|
const noticeDetail = ref<any>(null);
|
||||||
@ -102,6 +94,7 @@ const descExpanded = ref(false);
|
|||||||
const signCompRef = ref<any>(null);
|
const signCompRef = ref<any>(null);
|
||||||
const signTitle = ref<string>("签名");
|
const signTitle = ref<string>("签名");
|
||||||
const sign_file = ref<string>("");
|
const sign_file = ref<string>("");
|
||||||
|
const showSignature = ref<boolean>(false);
|
||||||
|
|
||||||
// 获取当前学生信息
|
// 获取当前学生信息
|
||||||
const userStore = useUserStore();
|
const userStore = useUserStore();
|
||||||
@ -123,16 +116,11 @@ const getFileName = (filePath: string) => {
|
|||||||
|
|
||||||
// Computed properties for feedback status
|
// Computed properties for feedback status
|
||||||
const receivedCount = computed(() => {
|
const receivedCount = computed(() => {
|
||||||
return studentList.value.filter((s) => s.jlwc_status === '1').length;
|
return studentList.value.filter((s) => s.jlwc_status === 'A').length;
|
||||||
});
|
});
|
||||||
const totalStudents = computed(() => studentList.value.length);
|
const totalStudents = computed(() => studentList.value.length);
|
||||||
|
|
||||||
// 判断是否为当前学生
|
// 接龙按钮点击逻辑
|
||||||
const isCurrentStudent = (student: any) => {
|
|
||||||
return currentStudent.value && student.xsId === currentStudent.value.id;
|
|
||||||
};
|
|
||||||
|
|
||||||
// 新增:接龙按钮点击逻辑
|
|
||||||
async function onRelayClick() {
|
async function onRelayClick() {
|
||||||
try {
|
try {
|
||||||
const res = await getByJlIdApi({ jlId: noticeId.value });
|
const res = await getByJlIdApi({ jlId: noticeId.value });
|
||||||
@ -149,38 +137,24 @@ async function onRelayClick() {
|
|||||||
}
|
}
|
||||||
if (detail && detail.mdqz == 1) {
|
if (detail && detail.mdqz == 1) {
|
||||||
// 需要签名
|
// 需要签名
|
||||||
|
showSignature.value = true;
|
||||||
sign_file.value = '';
|
sign_file.value = '';
|
||||||
if (signCompRef.value) {
|
// 等待组件渲染完成
|
||||||
onSignConfirm();
|
await nextTick();
|
||||||
}
|
const data = await signCompRef.value.getSyncSignature();
|
||||||
|
sign_file.value = data.base64;
|
||||||
|
showSignature.value = false;
|
||||||
|
submitRelay();
|
||||||
} else {
|
} else {
|
||||||
submitRelay();
|
submitRelay();
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
showSignature.value = false;
|
||||||
uni.showToast({title: '获取详情失败', icon: 'none'});
|
uni.showToast({title: '获取详情失败', icon: 'none'});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 新增:签名确认
|
// 提交接龙
|
||||||
async function onSignConfirm() {
|
|
||||||
try {
|
|
||||||
if (!sign_file.value) {
|
|
||||||
if (signCompRef.value && signCompRef.value.getSyncSignature) {
|
|
||||||
const data = await signCompRef.value.getSyncSignature();
|
|
||||||
sign_file.value = data.base64;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (!sign_file.value) {
|
|
||||||
uni.showToast({title: '请完成签名', icon: 'none'});
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
submitRelay();
|
|
||||||
} catch (e) {
|
|
||||||
uni.showToast({title: '签名流程异常', icon: 'none'});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 新增:提交接龙
|
|
||||||
async function submitRelay() {
|
async function submitRelay() {
|
||||||
const params: any = {
|
const params: any = {
|
||||||
jl_id: noticeId.value,
|
jl_id: noticeId.value,
|
||||||
@ -196,7 +170,6 @@ async function submitRelay() {
|
|||||||
if (res && res.resultCode === 1 ) {
|
if (res && res.resultCode === 1 ) {
|
||||||
uni.showToast({title: '接龙成功', icon: 'success'});
|
uni.showToast({title: '接龙成功', icon: 'success'});
|
||||||
await refreshStudentList();
|
await refreshStudentList();
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
uni.showToast({title: res?.msg || '接龙失败', icon: 'none'});
|
uni.showToast({title: res?.msg || '接龙失败', icon: 'none'});
|
||||||
}
|
}
|
||||||
@ -206,7 +179,7 @@ async function submitRelay() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 新增:刷新学生完成状态
|
// 刷新学生完成状态
|
||||||
async function refreshStudentList() {
|
async function refreshStudentList() {
|
||||||
try {
|
try {
|
||||||
const stuRes = await jlzxFindByJlParamsApi({ jlId: noticeId.value });
|
const stuRes = await jlzxFindByJlParamsApi({ jlId: noticeId.value });
|
||||||
@ -235,7 +208,7 @@ onLoad(async (options) => {
|
|||||||
uni.showToast({ title: "加载学生状态失败", icon: "none" });
|
uni.showToast({ title: "加载学生状态失败", icon: "none" });
|
||||||
}
|
}
|
||||||
isLoading.value = false;
|
isLoading.value = false;
|
||||||
uni.setNavigationBarTitle({title: "点击接龙"});
|
uni.setNavigationBarTitle({ title: "接龙情况" });
|
||||||
} else {
|
} else {
|
||||||
uni.showToast({ title: "加载失败,缺少通知ID", icon: "none" });
|
uni.showToast({ title: "加载失败,缺少通知ID", icon: "none" });
|
||||||
}
|
}
|
||||||
@ -300,13 +273,17 @@ watch(noticeDetail, (val) => {
|
|||||||
// 监听数据变化
|
// 监听数据变化
|
||||||
}, { immediate: true, deep: true });
|
}, { immediate: true, deep: true });
|
||||||
|
|
||||||
// 在studentList渲染前打印每个学生的jlwc_status和姓名
|
// 添加学生列表数据监听器,处理状态字段兼容性
|
||||||
watch(studentList, (list) => {
|
watch(studentList, (list) => {
|
||||||
list.forEach(stu => {
|
list.forEach(stu => {
|
||||||
// 兼容后端返回的驼峰写法
|
// 兼容后端返回的驼峰写法
|
||||||
if (stu.jlwcStatus && !stu.jlwc_status) {
|
if (stu.jlwcStatus && !stu.jlwc_status) {
|
||||||
stu.jlwc_status = stu.jlwcStatus;
|
stu.jlwc_status = stu.jlwcStatus;
|
||||||
}
|
}
|
||||||
|
// 兼容数字状态,将'1'转换为'A'
|
||||||
|
if (stu.jlwc_status === '1') {
|
||||||
|
stu.jlwc_status = 'A';
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}, { immediate: true, deep: true });
|
}, { immediate: true, deep: true });
|
||||||
</script>
|
</script>
|
||||||
@ -578,14 +555,12 @@ watch(studentList, (list) => {
|
|||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
// 调整为每行4个,确保能显示4个汉字
|
// 调整为每行4个,确保能显示4个汉字
|
||||||
flex-basis: calc((100% - 30px) / 4); // 4个学生,3个间隔
|
flex-basis: calc((100% - 30px) / 4); // 4个学生,3个间隔
|
||||||
min-width: 60px; // 最小宽度确保能显示4个汉字
|
|
||||||
height: 30px; // Slightly taller height
|
height: 30px; // Slightly taller height
|
||||||
line-height: 20px; // Adjust line-height for vertical centering
|
line-height: 20px; // Adjust line-height for vertical centering
|
||||||
border: 1px solid #f4f4f5;
|
border: 1px solid #f4f4f5;
|
||||||
// 允许文字换行
|
// 允许文字换行
|
||||||
white-space: normal;
|
white-space: normal;
|
||||||
word-break: keep-all; // 保持汉字完整性
|
word-break: break-all; // Break long names if they don't fit
|
||||||
overflow: hidden;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.name-tag {
|
.name-tag {
|
||||||
@ -635,6 +610,13 @@ watch(studentList, (list) => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* 更多按钮样式 */
|
||||||
|
.more-btn {
|
||||||
|
font-size: 16px !important;
|
||||||
|
color: #409eff !important;
|
||||||
|
font-weight: 500;
|
||||||
|
}
|
||||||
|
|
||||||
/* 列表项样式的卡片 */
|
/* 列表项样式的卡片 */
|
||||||
.list-item-card {
|
.list-item-card {
|
||||||
padding: 5px 15px; // 减少上下 padding
|
padding: 5px 15px; // 减少上下 padding
|
||||||
|
|||||||
@ -206,7 +206,6 @@ const openDicPicker = (xs: any) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const dicChanged = (dicArr: any) => {
|
const dicChanged = (dicArr: any) => {
|
||||||
console.log(dicArr);
|
|
||||||
const dic = dicOptions.value[0][dicArr[0]];
|
const dic = dicOptions.value[0][dicArr[0]];
|
||||||
curXs.value.jzxsgxId = dic.dictionaryValue;
|
curXs.value.jzxsgxId = dic.dictionaryValue;
|
||||||
curXs.value.jzxsgxmc = dic.dictionaryCode;
|
curXs.value.jzxsgxmc = dic.dictionaryCode;
|
||||||
@ -224,11 +223,9 @@ async function afterRead(event: any, index: number) {
|
|||||||
const result = res.result;
|
const result = res.result;
|
||||||
if (result && result.length > 0 && result[0].filePath) {
|
if (result && result.length > 0 && result[0].filePath) {
|
||||||
students.value[index].xstx = result[0].filePath;
|
students.value[index].xstx = result[0].filePath;
|
||||||
console.log(`Student ${index} avatar uploaded:`, result[0].filePath);
|
|
||||||
showToast({ title: "上传成功" });
|
showToast({ title: "上传成功" });
|
||||||
} else {
|
} else {
|
||||||
showToast({ title: "上传失败,请重试", icon: "none" });
|
showToast({ title: "上传失败,请重试", icon: "none" });
|
||||||
console.error("Upload result format error:", result);
|
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
showToast({ title: "上传出错", icon: "none" });
|
showToast({ title: "上传出错", icon: "none" });
|
||||||
@ -313,7 +310,7 @@ async function submit() {
|
|||||||
showToast({ title: res.message || "提交失败", icon: "none" });
|
showToast({ title: res.message || "提交失败", icon: "none" });
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log(error);
|
// 处理错误
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -12,9 +12,11 @@ interface UserState {
|
|||||||
userdata: any;
|
userdata: any;
|
||||||
curXs: any;
|
curXs: any;
|
||||||
token: string;
|
token: string;
|
||||||
auth: string[],
|
auth: string[];
|
||||||
ws: any,
|
lastRefreshTime: number; // 上次刷新时间
|
||||||
wsCallback: any
|
refreshInterval: number; // 刷新间隔(毫秒)
|
||||||
|
ws: any;
|
||||||
|
wsCallback: any;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const useUserStore = defineStore({
|
export const useUserStore = defineStore({
|
||||||
@ -28,6 +30,8 @@ export const useUserStore = defineStore({
|
|||||||
token: '',
|
token: '',
|
||||||
//用户注册信息
|
//用户注册信息
|
||||||
auth: [],
|
auth: [],
|
||||||
|
lastRefreshTime: 0, // 上次刷新时间
|
||||||
|
refreshInterval: 7 * 24 * 60 * 60 * 1000, // 刷新间隔(毫秒)
|
||||||
ws: null,
|
ws: null,
|
||||||
wsCallback: defWsCallback
|
wsCallback: defWsCallback
|
||||||
}),
|
}),
|
||||||
@ -43,6 +47,12 @@ export const useUserStore = defineStore({
|
|||||||
},
|
},
|
||||||
getAuth(): string[] {
|
getAuth(): string[] {
|
||||||
return this.auth;
|
return this.auth;
|
||||||
|
},
|
||||||
|
getLastRefreshTime(): number {
|
||||||
|
return this.lastRefreshTime;
|
||||||
|
},
|
||||||
|
getRefreshInterval(): number {
|
||||||
|
return this.refreshInterval;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
actions: {
|
actions: {
|
||||||
@ -58,6 +68,22 @@ export const useUserStore = defineStore({
|
|||||||
setAuth(data: string[]) {
|
setAuth(data: string[]) {
|
||||||
this.auth = data;
|
this.auth = data;
|
||||||
},
|
},
|
||||||
|
setLastRefreshTime(time: number) {
|
||||||
|
this.lastRefreshTime = time;
|
||||||
|
},
|
||||||
|
setRefreshInterval(interval: number) {
|
||||||
|
this.refreshInterval = interval;
|
||||||
|
},
|
||||||
|
// 更新学生信息
|
||||||
|
updateStudentInfo(studentInfo: any) {
|
||||||
|
this.setCurXs(studentInfo);
|
||||||
|
},
|
||||||
|
// 更新学生列表
|
||||||
|
updateStudentList(studentList: any[]) {
|
||||||
|
if (this.userdata) {
|
||||||
|
this.userdata.xsList = studentList;
|
||||||
|
}
|
||||||
|
},
|
||||||
setWsCallback(callback: any) {
|
setWsCallback(callback: any) {
|
||||||
this.wsCallback = callback;
|
this.wsCallback = callback;
|
||||||
},
|
},
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user