qsh 2 months ago
parent 3678c5fcc4
commit 3e714a0bc8
  1. 2
      src/config/axios/service.ts
  2. 8
      src/views/Basic/User/DeptTree.vue
  3. 15
      src/views/Basic/User/UserForm.vue

@ -205,6 +205,8 @@ service.interceptors.response.use(
if (msg === '无效的刷新令牌') {
// hard coding:忽略这个提示,直接登出
console.log(msg)
} else if (code == 18888) {
return { data }
} else {
ElNotification.error({ title: msg })
if (code == 403) {

@ -1,11 +1,4 @@
<template>
<div class="head-container">
<el-input v-model="deptName" class="mb-20px" clearable placeholder="请输入部门名称">
<template #prefix>
<Icon icon="ep:search" />
</template>
</el-input>
</div>
<div class="head-container">
<el-tree
ref="treeRef"
@ -26,7 +19,6 @@ import { ElTree } from 'element-plus'
import * as DeptApi from '@/api/system/dept'
import { defaultProps, handleTree } from '@/utils/tree'
const deptName = ref('')
const deptList = ref<Tree[]>([]) //
const treeRef = ref<InstanceType<typeof ElTree>>()

@ -139,7 +139,8 @@ const formData = ref({
remark: '',
status: CommonStatusEnum.ENABLE,
roleIds: [],
hireDate: ''
hireDate: '',
isNewUserConfirm: false
})
const formRules = ref<any>({
username: [{ required: true, message: '登录账号不能为空', trigger: 'blur' }],
@ -192,8 +193,15 @@ const submitForm = async () => {
try {
const data = formData.value as unknown as UserApi.UserVO
if (formType.value === 'create') {
await UserApi.createUser(data)
const resp = await UserApi.createUser(data)
debugger
if (resp.code == 18888) {
await message.confirm(resp.msg)
formData.value.isNewUserConfirm = true
submitForm()
} else {
message.success(t('common.createSuccess'))
}
} else {
await UserApi.updateUser(data)
message.success(t('common.updateSuccess'))
@ -220,7 +228,8 @@ const resetForm = () => {
remark: '',
status: CommonStatusEnum.ENABLE,
roleIds: [],
hireDate: formatDate(new Date(), 'YYYY-MM-DD')
hireDate: formatDate(new Date(), 'YYYY-MM-DD'),
isNewUserConfirm: undefined
}
formRef.value?.resetFields()
}

Loading…
Cancel
Save