From 86c164db35da4a3237ed7fc8cab68a12a6c39b7e Mon Sep 17 00:00:00 2001 From: weiweiw <14335254+weiweiw22@user.noreply.gitee.com> Date: Thu, 12 Sep 2024 18:02:17 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=94=AF=E6=8C=81=E9=A1=B6?= =?UTF-8?q?=E7=BA=A7=E9=83=A8=E9=97=A8=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/configure.js | 10 ++++++---- src/utils/request.js | 2 +- src/views/system/dept/index.vue | 19 ++++++++++++++----- 3 files changed, 21 insertions(+), 10 deletions(-) diff --git a/src/utils/configure.js b/src/utils/configure.js index 20854905..1cd9e793 100644 --- a/src/utils/configure.js +++ b/src/utils/configure.js @@ -43,10 +43,12 @@ const CONFIG = { IS_CODE_LOGIN: LOGIN_CONFIG.CODE_EMAIL_LOGIN || LOGIN_CONFIG.CODE_PHONE_LOGIN, // 是否开启短信登录 // 数据设置 dataSettings: { - integrityCheck: DATA_SETTINGS.OPEN, // 数据完整性校验(true:开启,false:关闭) - encryptRequest: DATA_SETTINGS.OPEN, // 数据传输加密(true:开启,false:关闭) - encryptResponse: DATA_SETTINGS.OPEN // 数据返回解密(true:开启,false:关闭) - } + integrityCheck: DATA_SETTINGS.CLOSE, // 数据完整性校验(true:开启,false:关闭) + encryptRequest: DATA_SETTINGS.CLOSE, // 数据传输加密(true:开启,false:关闭) + encryptResponse: DATA_SETTINGS.CLOSE, // 数据返回解密(true:开启,false:关闭) + }, + // 增加配置以支持增加根节点公司的添加和删除功能,added by weiweiwang,2024/9/12 + IS_ADD_ROOT_COMPANY: DATA_SETTINGS.OPEN, } // 获取占位符文本的函数 diff --git a/src/utils/request.js b/src/utils/request.js index d4be3306..d27fc556 100644 --- a/src/utils/request.js +++ b/src/utils/request.js @@ -79,7 +79,7 @@ service.interceptors.request.use(config => { if (!isRepeatSubmit && (config.method === 'post' || config.method === 'put')) { let data = typeof config.data === 'object' ? JSON.stringify(config.data) : config.data let contentType = config.headers['Content-Type'] - if (contentType.includes('application/json')) { + if (contentType.includes('application/json') && typeof data !== 'undefined') { // 数据完整性校验 if (CONFIG.dataSettings.integrityCheck && checkIntegrity) { config.headers['Params-Hash'] = hashWithSM3AndSalt(data) diff --git a/src/views/system/dept/index.vue b/src/views/system/dept/index.vue index 066b3565..372d7dec 100644 --- a/src/views/system/dept/index.vue +++ b/src/views/system/dept/index.vue @@ -85,7 +85,7 @@ v-hasPermi="['system:dept:add']" >新增 - + @@ -161,9 +166,15 @@ import { listDept, getDept, delDept, addDept, updateDept, listDeptExcludeChild } from "@/api/system/dept"; import Treeselect from "@riophae/vue-treeselect"; import "@riophae/vue-treeselect/dist/vue-treeselect.css"; +import {CONFIG} from "@/utils/configure"; export default { name: "Dept", + computed: { + CONFIG() { + return CONFIG + } + }, dicts: ['sys_normal_disable'], components: { Treeselect }, data() { @@ -193,9 +204,7 @@ export default { form: {}, // 表单校验 rules: { - parentId: [ - { required: true, message: "上级部门不能为空", trigger: "blur" } - ], + parentId: CONFIG.IS_ADD_ROOT_COMPANY ? [] : [{ required: true, message: "上级部门不能为空", trigger: "blur" } ] , deptName: [ { required: true, message: "部门名称不能为空", trigger: "blur" } ],