fix: 用户管理内教师角色只能新增学生

This commit is contained in:
TsMask
2024-06-20 10:28:01 +08:00
parent eb38211e3b
commit 42827796c7

View File

@@ -441,6 +441,11 @@ function fnModalOk() {
.then(() => {
modalState.confirmLoading = true;
const from = toRaw(modalState.from);
// 教师角色只能新增学生
if (!from.userId && userStore.roles.includes('teacher')) {
from.postIds = ['3'];
from.roleIds = ['4'];
}
const user = from.userId ? updateUser(from) : addUser(from);
const key = 'user';
message.loading({ content: t('common.loading'), key });