refactor: 彻底删除UserEdit
This commit is contained in:
@@ -34,18 +34,6 @@ const routes: RouteRecordRaw[] = [
|
|||||||
component: () => import('../views/ScriptEdit.vue'),
|
component: () => import('../views/ScriptEdit.vue'),
|
||||||
meta: { title: '编辑脚本' },
|
meta: { title: '编辑脚本' },
|
||||||
},
|
},
|
||||||
{
|
|
||||||
path: '/scripts/:scriptId/users/add',
|
|
||||||
name: 'UserAdd',
|
|
||||||
component: () => import('../views/UserEdit.vue'),
|
|
||||||
meta: { title: '添加用户' },
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: '/scripts/:scriptId/users/:userId/edit',
|
|
||||||
name: 'UserEdit',
|
|
||||||
component: () => import('../views/UserEdit.vue'),
|
|
||||||
meta: { title: '编辑用户' },
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
path: '/scripts/:scriptId/users/add/maa',
|
path: '/scripts/:scriptId/users/add/maa',
|
||||||
name: 'MAAUserAdd',
|
name: 'MAAUserAdd',
|
||||||
|
|||||||
@@ -454,20 +454,31 @@ const handleDeleteScript = async (script: Script) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const handleAddUser = (script: Script) => {
|
const handleAddUser = (script: Script) => {
|
||||||
// 跳转到添加用户页面
|
// 根据条件判断跳转到 MAA 还是通用用户添加页面
|
||||||
router.push(`/scripts/${script.id}/users/add`)
|
if (script.type === 'MAA') {
|
||||||
|
router.push(`/scripts/${script.id}/users/add/maa`) // 跳转到 MAA 用户添加页面
|
||||||
|
} else {
|
||||||
|
router.push(`/scripts/${script.id}/users/add/general`) // 跳转到通用用户添加页面
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleEditUser = (user: User) => {
|
const handleEditUser = (user: User) => {
|
||||||
// 从用户数据中找到对应的脚本
|
// 从用户数据中找到对应的脚本
|
||||||
const script = scripts.value.find(s => s.users.some(u => u.id === user.id))
|
const script = scripts.value.find(s => s.users.some(u => u.id === user.id))
|
||||||
if (script) {
|
if (script) {
|
||||||
// 跳转到编辑用户页面
|
// 判断是 MAA 用户还是通用用户
|
||||||
router.push(`/scripts/${script.id}/users/${user.id}/edit`)
|
if (user.Info.Server) {
|
||||||
|
// 跳转到 MAA 用户编辑页面
|
||||||
|
router.push(`/scripts/${script.id}/users/${user.id}/edit/maa`)
|
||||||
|
} else {
|
||||||
|
// 跳转到通用用户编辑页面
|
||||||
|
router.push(`/scripts/${script.id}/users/${user.id}/edit/general`)
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
message.error('找不到对应的脚本')
|
message.error('找不到对应的脚本')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleDeleteUser = async (user: User) => {
|
const handleDeleteUser = async (user: User) => {
|
||||||
// 从用户数据中找到对应的脚本
|
// 从用户数据中找到对应的脚本
|
||||||
const script = scripts.value.find(s => s.users.some(u => u.id === user.id))
|
const script = scripts.value.find(s => s.users.some(u => u.id === user.id))
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user