| | |
| | | |
| | | <script setup> |
| | | import request from '@/utils/http' |
| | | import { guardRequestWithMessage } from '@/utils/sys/requestGuard' |
| | | import { |
| | | fetchDeleteUser, |
| | | fetchGetDeptTree, |
| | |
| | | |
| | | const loadLookups = async () => { |
| | | try { |
| | | const [roles, depts] = await Promise.all([fetchGetRoleOptions({}), fetchGetDeptTree({})]) |
| | | const lookupPayload = await guardRequestWithMessage( |
| | | Promise.all([fetchGetRoleOptions({}), fetchGetDeptTree({})]), |
| | | null, |
| | | { |
| | | timeoutMessage: '用户页字典加载超时,已停止等待' |
| | | } |
| | | ) |
| | | if (!lookupPayload) { |
| | | roleOptions.value = [] |
| | | deptTreeOptions.value = [] |
| | | return |
| | | } |
| | | const [roles, depts] = lookupPayload |
| | | roleOptions.value = normalizeRoleOptions(roles) |
| | | deptTreeOptions.value = normalizeDeptTreeOptions(depts) |
| | | } catch (error) { |