重构前端代码架构, 完善我的内容区
This commit is contained in:
@@ -48,27 +48,7 @@ export default {
|
||||
HomeworkTab,
|
||||
},
|
||||
onShow() {
|
||||
// 非教务老师角色,禁止停留在教务页,自动跳回接待
|
||||
try {
|
||||
// 从登录成功时缓存的后端响应中读取角色名称
|
||||
const roleName = uni.getStorageSync('backend-role-name') || '';
|
||||
const hasEduRole = roleName === 'speaking_training_teacher';
|
||||
|
||||
if (!hasEduRole) {
|
||||
uni.showToast({
|
||||
title: '当前账号无教务权限',
|
||||
icon: 'none',
|
||||
duration: 1500,
|
||||
});
|
||||
setTimeout(() => {
|
||||
uni.switchTab({
|
||||
url: '/pages/reception/reception',
|
||||
});
|
||||
}, 800);
|
||||
}
|
||||
} catch (e) {
|
||||
console.warn('检查教务权限失败:', e);
|
||||
}
|
||||
// 所有登录人都可以访问,已移除权限限制
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user