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 === '无效的刷新令牌') { if (msg === '无效的刷新令牌') {
// hard coding:忽略这个提示,直接登出 // hard coding:忽略这个提示,直接登出
console.log(msg) console.log(msg)
} else if (code == 18888) {
return { data }
} else { } else {
ElNotification.error({ title: msg }) ElNotification.error({ title: msg })
if (code == 403) { if (code == 403) {

@ -1,11 +1,4 @@
<template> <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"> <div class="head-container">
<el-tree <el-tree
ref="treeRef" ref="treeRef"
@ -26,7 +19,6 @@ import { ElTree } from 'element-plus'
import * as DeptApi from '@/api/system/dept' import * as DeptApi from '@/api/system/dept'
import { defaultProps, handleTree } from '@/utils/tree' import { defaultProps, handleTree } from '@/utils/tree'
const deptName = ref('')
const deptList = ref<Tree[]>([]) // const deptList = ref<Tree[]>([]) //
const treeRef = ref<InstanceType<typeof ElTree>>() const treeRef = ref<InstanceType<typeof ElTree>>()

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

Loading…
Cancel
Save