From a6fb88d74c20cc28043d75e8a5097fce49cf9a78 Mon Sep 17 00:00:00 2001 From: 疯狂的狮子li <15040126243@163.com> Date: 星期五, 15 十月 2021 15:19:42 +0800 Subject: [PATCH] update [重大更新]全业务 增加 接口文档注解 格式化代码 --- ruoyi-ui/src/utils/request.js | 10 ++++++---- 1 files changed, 6 insertions(+), 4 deletions(-) diff --git a/ruoyi-ui/src/utils/request.js b/ruoyi-ui/src/utils/request.js index e95d01d..4acc3b4 100644 --- a/ruoyi-ui/src/utils/request.js +++ b/ruoyi-ui/src/utils/request.js @@ -5,6 +5,8 @@ import errorCode from '@/utils/errorCode' axios.defaults.headers['Content-Type'] = 'application/json;charset=utf-8' +// 瀵瑰簲鍥介檯鍖栬祫婧愭枃浠跺悗缂� +axios.defaults.headers['Content-Language'] = 'zh_CN' // 鍒涘缓axios瀹炰緥 const service = axios.create({ // axios涓姹傞厤缃湁baseURL閫夐」锛岃〃绀鸿姹俇RL鍏叡閮ㄥ垎 @@ -29,9 +31,9 @@ if (typeof value === 'object') { for (const key of Object.keys(value)) { if (value[key] !== null && typeof (value[key]) !== 'undefined') { - let params = propName + '[' + key + ']' - let subPart = encodeURIComponent(params) + '=' - url += subPart + encodeURIComponent(value[key]) + '&' + let params = propName + '[' + key + ']'; + let subPart = encodeURIComponent(params) + '='; + url += subPart + encodeURIComponent(value[key]) + '&'; } } } else { @@ -66,7 +68,7 @@ location.href = '/index'; }) }).catch(() => {}); - return Promise.reject('浠ょ墝楠岃瘉澶辫触') + return Promise.reject('鏃犳晥鐨勪細璇濓紝鎴栬�呬細璇濆凡杩囨湡锛岃閲嶆柊鐧诲綍銆�') } else if (code === 500) { Message({ message: msg, -- Gitblit v1.9.3