Loading dist.zip −15.3 MiB (16.2 MiB) File changed.No diff preview for this file type. View original file View changed file src/utils/request.js +6 −6 Original line number Diff line number Diff line Loading @@ -30,12 +30,12 @@ service.interceptors.request.use(config => { config.headers['Authorization'] = 'Bearer ' + getToken() // 让每个请求携带自定义token 请根据实际情况自行修改 } // // get请求映射params参数 // if (config.method === 'get' && config.params) { // let url = config.url + '?' + tansParams(config.params); // url = url.slice(0, -1); // config.params = {}; // config.url = url; // } if (config.method === 'get' && config.params) { let url = config.url + '?' + tansParams(config.params); url = url.slice(0, -1); config.params = {}; config.url = url; } if (!isRepeatSubmit && (config.method === 'post' || config.method === 'put')) { const requestObj = { url: config.url, Loading src/utils/ruoyi.js +4 −2 Original line number Diff line number Diff line Loading @@ -206,11 +206,13 @@ export function handleTree(data, id, parentId, children) { * @param {*} params 参数 */ export function tansParams(params) { console.log(params) let result = '' for (const propName of Object.keys(params)) { const value = params[propName]; var part = encodeURIComponent(propName) + "="; if (value !== null && value !== "" && typeof (value) !== "undefined") { // && value !== "" 有的接口需要默认传空值 if (value !== null && typeof (value) !== "undefined") { if (typeof value === 'object') { for (const key of Object.keys(value)) { if (value[key] !== null && value[key] !== "" && typeof (value[key]) !== 'undefined') { Loading Loading
dist.zip −15.3 MiB (16.2 MiB) File changed.No diff preview for this file type. View original file View changed file
src/utils/request.js +6 −6 Original line number Diff line number Diff line Loading @@ -30,12 +30,12 @@ service.interceptors.request.use(config => { config.headers['Authorization'] = 'Bearer ' + getToken() // 让每个请求携带自定义token 请根据实际情况自行修改 } // // get请求映射params参数 // if (config.method === 'get' && config.params) { // let url = config.url + '?' + tansParams(config.params); // url = url.slice(0, -1); // config.params = {}; // config.url = url; // } if (config.method === 'get' && config.params) { let url = config.url + '?' + tansParams(config.params); url = url.slice(0, -1); config.params = {}; config.url = url; } if (!isRepeatSubmit && (config.method === 'post' || config.method === 'put')) { const requestObj = { url: config.url, Loading
src/utils/ruoyi.js +4 −2 Original line number Diff line number Diff line Loading @@ -206,11 +206,13 @@ export function handleTree(data, id, parentId, children) { * @param {*} params 参数 */ export function tansParams(params) { console.log(params) let result = '' for (const propName of Object.keys(params)) { const value = params[propName]; var part = encodeURIComponent(propName) + "="; if (value !== null && value !== "" && typeof (value) !== "undefined") { // && value !== "" 有的接口需要默认传空值 if (value !== null && typeof (value) !== "undefined") { if (typeof value === 'object') { for (const key of Object.keys(value)) { if (value[key] !== null && value[key] !== "" && typeof (value[key]) !== 'undefined') { Loading