From 2c8125e218d38fe4a515b8b33d140234bd0af3f1 Mon Sep 17 00:00:00 2001 From: panda <1565636758@qq.com> Date: Mon, 11 Nov 2024 15:19:05 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E6=B2=A1=E6=9C=89z-index?= =?UTF-8?q?=E4=BC=9A=E8=A2=AB=E8=A1=A8=E6=A0=BC=E5=B1=82=E8=A6=86=E7=9B=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/layout/components/Setting/src/Setting.vue | 1 + 1 file changed, 1 insertion(+) diff --git a/src/layout/components/Setting/src/Setting.vue b/src/layout/components/Setting/src/Setting.vue index 306cb238..2973674b 100644 --- a/src/layout/components/Setting/src/Setting.vue +++ b/src/layout/components/Setting/src/Setting.vue @@ -297,5 +297,6 @@ $prefix-cls: #{$namespace}-setting; .#{$prefix-cls} { border-radius: 6px 0 0 6px; + z-index: 1200;/*修正没有z-index会被表格层覆盖,值不要超过4000*/ } From c119e910d038083dd7892e3ecfb339f6a04846dc Mon Sep 17 00:00:00 2001 From: preschooler Date: Mon, 18 Nov 2024 11:38:42 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=F0=9F=90=9E=20fix:=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E5=AF=B9=20axios=20=E7=9A=84=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/login/oauth2/index.ts | 2 +- src/config/axios/index.ts | 12 ++++-------- src/config/axios/service.ts | 30 +++--------------------------- 3 files changed, 8 insertions(+), 36 deletions(-) diff --git a/src/api/login/oauth2/index.ts b/src/api/login/oauth2/index.ts index aef1820d..f4a67fbe 100644 --- a/src/api/login/oauth2/index.ts +++ b/src/api/login/oauth2/index.ts @@ -27,7 +27,7 @@ export const authorize = ( return request.post({ url: '/system/oauth2/authorize', headers: { - 'Content-type': 'application/x-www-form-urlencoded' + 'Content-Type': 'application/x-www-form-urlencoded' }, params: { response_type: responseType, diff --git a/src/config/axios/index.ts b/src/config/axios/index.ts index 79e558da..07719a20 100644 --- a/src/config/axios/index.ts +++ b/src/config/axios/index.ts @@ -5,16 +5,12 @@ import { config } from './config' const { default_headers } = config const request = (option: any) => { - const { url, method, params, data, headersType, responseType, ...config } = option + const { headersType, headers, ...otherOption } = option return service({ - url: url, - method, - params, - data, - ...config, - responseType: responseType, + ...otherOption, headers: { - 'Content-Type': headersType || default_headers + 'Content-Type': headersType || default_headers, + ...headers } }) } diff --git a/src/config/axios/service.ts b/src/config/axios/service.ts index 3df813f2..f0eccc56 100644 --- a/src/config/axios/service.ts +++ b/src/config/axios/service.ts @@ -1,13 +1,6 @@ -import axios, { - AxiosError, - AxiosInstance, - AxiosRequestHeaders, - AxiosResponse, - InternalAxiosRequestConfig -} from 'axios' +import axios, { AxiosError, AxiosInstance, AxiosResponse, InternalAxiosRequestConfig } from 'axios' import { ElMessage, ElMessageBox, ElNotification } from 'element-plus' -import qs from 'qs' import { config } from '@/config/axios/config' import { getAccessToken, getRefreshToken, getTenantId, removeToken, setToken } from '@/utils/auth' import errorCode from './errorCode' @@ -52,29 +45,12 @@ service.interceptors.request.use( } }) if (getAccessToken() && !isToken) { - ;(config as Recordable).headers.Authorization = 'Bearer ' + getAccessToken() // 让每个请求携带自定义token + config.headers.Authorization = 'Bearer ' + getAccessToken() // 让每个请求携带自定义token } // 设置租户 if (tenantEnable && tenantEnable === 'true') { const tenantId = getTenantId() - if (tenantId) (config as Recordable).headers['tenant-id'] = tenantId - } - const params = config.params || {} - const data = config.data || false - if ( - config.method?.toUpperCase() === 'POST' && - (config.headers as AxiosRequestHeaders)['Content-Type'] === - 'application/x-www-form-urlencoded' - ) { - config.data = qs.stringify(data) - } - // get参数编码 - if (config.method?.toUpperCase() === 'GET' && params) { - config.params = {} - const paramsStr = qs.stringify(params, { allowDots: true }) - if (paramsStr) { - config.url = config.url + '?' + paramsStr - } + if (tenantId) config.headers['tenant-id'] = tenantId } return config }, From 6cd64291029114acd9e8fc27ec8bd7243edf82ab Mon Sep 17 00:00:00 2001 From: preschooler Date: Tue, 19 Nov 2024 19:24:49 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=F0=9F=90=9E=20fix:=E6=81=A2=E5=A4=8D=20axi?= =?UTF-8?q?os=20=E8=87=AA=E5=AE=9A=E4=B9=89=E5=8F=82=E6=95=B0=E5=BA=8F?= =?UTF-8?q?=E5=88=97=E5=8C=96=E5=87=BD=E6=95=B0=EF=BC=8C=E5=B9=B6=E6=94=AF?= =?UTF-8?q?=E6=8C=81=E6=89=80=E6=9C=89=E8=AF=B7=E6=B1=82=E7=9A=84=20params?= =?UTF-8?q?=20=E8=87=AA=E5=AE=9A=E4=B9=89=E5=BA=8F=E5=88=97=E5=8C=96?= =?UTF-8?q?=EF=BC=8C=E4=BF=AE=E5=A4=8D=E5=88=B7=E6=96=B0=20token=20?= =?UTF-8?q?=E5=90=8E=E4=BA=8C=E6=AC=A1=E8=AF=B7=E6=B1=82=E5=8F=82=E6=95=B0?= =?UTF-8?q?=E4=B8=A2=E5=A4=B1=E9=97=AE=E9=A2=98=EF=BC=8C=E4=BC=98=E5=8C=96?= =?UTF-8?q?=20GET=20=E8=AF=B7=E6=B1=82=E7=BC=93=E5=AD=98=E9=97=AE=E9=A2=98?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/config/axios/service.ts | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/src/config/axios/service.ts b/src/config/axios/service.ts index f0eccc56..ae3845c0 100644 --- a/src/config/axios/service.ts +++ b/src/config/axios/service.ts @@ -1,6 +1,7 @@ import axios, { AxiosError, AxiosInstance, AxiosResponse, InternalAxiosRequestConfig } from 'axios' import { ElMessage, ElMessageBox, ElNotification } from 'element-plus' +import qs from 'qs' import { config } from '@/config/axios/config' import { getAccessToken, getRefreshToken, getTenantId, removeToken, setToken } from '@/utils/auth' import errorCode from './errorCode' @@ -30,7 +31,11 @@ const whiteList: string[] = ['/login', '/refresh-token'] const service: AxiosInstance = axios.create({ baseURL: base_url, // api 的 base_url timeout: request_timeout, // 请求超时时间 - withCredentials: false // 禁用 Cookie 等信息 + withCredentials: false, // 禁用 Cookie 等信息 + // 自定义参数序列化函数 + paramsSerializer: (params) => { + return qs.stringify(params, { allowDots: true }) + } }) // request拦截器 @@ -52,6 +57,21 @@ service.interceptors.request.use( const tenantId = getTenantId() if (tenantId) config.headers['tenant-id'] = tenantId } + const method = config.method?.toUpperCase() + // 防止 GET 请求缓存 + if (method === 'GET') { + config.headers['Cache-Control'] = 'no-cache' + config.headers['Pragma'] = 'no-cache' + } + // 自定义参数序列化函数 + else if (method === 'POST') { + const contentType = config.headers['Content-Type'] || config.headers['content-type'] + if (contentType === 'application/x-www-form-urlencoded') { + if (config.data && typeof config.data !== 'string') { + config.data = qs.stringify(config.data) + } + } + } return config }, (error: AxiosError) => { From 2d1b31a841f76ac63732fb4dc1079990b1fd435b Mon Sep 17 00:00:00 2001 From: shifeng Date: Thu, 21 Nov 2024 08:34:43 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E5=88=A4=E6=96=AD=E5=A6=82=E6=9E=9C?= =?UTF-8?q?=E6=B2=A1=E6=9C=89=E6=9D=83=E9=99=90=E8=AE=BE=E7=BD=AE=E4=B8=8D?= =?UTF-8?q?=E8=BF=9B=E8=A1=8C=E5=8F=AF=E7=BC=96=E8=BE=91=E8=A1=A8=E5=8D=95?= =?UTF-8?q?=E8=BF=87=E6=BB=A4=EF=BC=8C=E9=81=BF=E5=85=8D=E8=A1=A8=E5=8D=95?= =?UTF-8?q?=E5=8F=98=E9=87=8F=E8=A2=AB=E8=BF=87=E6=BB=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/bpm/processInstance/detail/index.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/views/bpm/processInstance/detail/index.vue b/src/views/bpm/processInstance/detail/index.vue index 11bdeedf..aa6ad5fe 100644 --- a/src/views/bpm/processInstance/detail/index.vue +++ b/src/views/bpm/processInstance/detail/index.vue @@ -271,7 +271,7 @@ const handleAudit = async (task, pass) => { data.variables = approveForms.value[index].value } // 获取表单可编辑字段的值 - if (fApi.value) { + if (fApi.value && task.fieldsPermission !== null) { data.variables = getWritableValueOfForm(task.fieldsPermission) }