feat: 工作进度管理页面,优化用户资料更新,优化部分接口请求
This commit is contained in:
@ -6,14 +6,25 @@ export const useUser = defineStore("user", () => {
|
||||
const token = ref<string | null>(null);
|
||||
const userinfo = ref<User | null>(null);
|
||||
|
||||
/**
|
||||
* 判断是否有权限
|
||||
* @param tag A: 课程制作教师(3) B: 课程制作方沟通联络人(2) C: 课程购买方项目负责人(1) D: 系统制作方项目负责人(4)
|
||||
* @returns 是否有权限
|
||||
*/
|
||||
function hasJobTag(tag: "A" | "B" | "C" | "D") {
|
||||
if (!userinfo.value) return false;
|
||||
return userinfo.value?.jobs.some((job) => job.description === tag) || false;
|
||||
}
|
||||
|
||||
function logout() {
|
||||
token.value = null
|
||||
userinfo.value = null
|
||||
token.value = null;
|
||||
userinfo.value = null;
|
||||
}
|
||||
|
||||
return {
|
||||
token,
|
||||
userinfo,
|
||||
hasJobTag,
|
||||
logout,
|
||||
};
|
||||
});
|
||||
|
Reference in New Issue
Block a user