|  |  |  | @ -1,4 +1,3 @@ | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  | /* | 
			
		
	
		
			
				
					|  |  |  |  |  * @LastEditors: Please set LastEditors | 
			
		
	
		
			
				
					|  |  |  |  |  * @LastEditTime: 2022-04-28 10:25:38 | 
			
		
	
	
		
			
				
					|  |  |  | @ -15,9 +14,9 @@ import store from "@/store"; | 
			
		
	
		
			
				
					|  |  |  |  | import {isRelogin} from "@/api/utils/request"; | 
			
		
	
		
			
				
					|  |  |  |  | // import cache from "@/plugins/cache";
 | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  | let baseUrl =`http://127.0.0.1:9002/` | 
			
		
	
		
			
				
					|  |  |  |  | let baseUrl = process.env.VUE_APP_BASE_API | 
			
		
	
		
			
				
					|  |  |  |  | const CancelToken = axios.CancelToken; | 
			
		
	
		
			
				
					|  |  |  |  | export { baseUrl }; | 
			
		
	
		
			
				
					|  |  |  |  | export {baseUrl}; | 
			
		
	
		
			
				
					|  |  |  |  | // axios.defaults.withCredentials = true;
 | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
	
		
			
				
					|  |  |  | @ -217,20 +216,20 @@ service.interceptors.response.use( | 
			
		
	
		
			
				
					|  |  |  |  | // }
 | 
			
		
	
		
			
				
					|  |  |  |  | //处理是否加密数据
 | 
			
		
	
		
			
				
					|  |  |  |  | let isEncryptionParam = (params) => { | 
			
		
	
		
			
				
					|  |  |  |  |     return params | 
			
		
	
		
			
				
					|  |  |  |  |   return params | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  | } | 
			
		
	
		
			
				
					|  |  |  |  | export const GET = async (url, params) => { | 
			
		
	
		
			
				
					|  |  |  |  |     try { | 
			
		
	
		
			
				
					|  |  |  |  |         params = isEncryptionParam(params) | 
			
		
	
		
			
				
					|  |  |  |  |         const data = await axios.get(`${baseUrl}${url}`, { | 
			
		
	
		
			
				
					|  |  |  |  |             params: params, | 
			
		
	
		
			
				
					|  |  |  |  |             headers: false, | 
			
		
	
		
			
				
					|  |  |  |  |         }, false); | 
			
		
	
		
			
				
					|  |  |  |  |         return data; | 
			
		
	
		
			
				
					|  |  |  |  |     } catch (error) { | 
			
		
	
		
			
				
					|  |  |  |  |         return error; | 
			
		
	
		
			
				
					|  |  |  |  |     } | 
			
		
	
		
			
				
					|  |  |  |  |   try { | 
			
		
	
		
			
				
					|  |  |  |  |     params = isEncryptionParam(params) | 
			
		
	
		
			
				
					|  |  |  |  |     const data = await axios.get(`${baseUrl}${url}`, { | 
			
		
	
		
			
				
					|  |  |  |  |       params: params, | 
			
		
	
		
			
				
					|  |  |  |  |       headers: false, | 
			
		
	
		
			
				
					|  |  |  |  |     }, false); | 
			
		
	
		
			
				
					|  |  |  |  |     return data; | 
			
		
	
		
			
				
					|  |  |  |  |   } catch (error) { | 
			
		
	
		
			
				
					|  |  |  |  |     return error; | 
			
		
	
		
			
				
					|  |  |  |  |   } | 
			
		
	
		
			
				
					|  |  |  |  | } | 
			
		
	
		
			
				
					|  |  |  |  | //没有基地址 访问根目录下文件
 | 
			
		
	
		
			
				
					|  |  |  |  | // export function GETNOBASE(url,query) {
 | 
			
		
	
	
		
			
				
					|  |  |  | @ -241,42 +240,42 @@ export const GET = async (url, params) => { | 
			
		
	
		
			
				
					|  |  |  |  | //   });
 | 
			
		
	
		
			
				
					|  |  |  |  | // }
 | 
			
		
	
		
			
				
					|  |  |  |  | export const GETNOBASE = async (url, params) => { | 
			
		
	
		
			
				
					|  |  |  |  |     try { | 
			
		
	
		
			
				
					|  |  |  |  |         const data = await axios.get(url, { | 
			
		
	
		
			
				
					|  |  |  |  |             params: params, | 
			
		
	
		
			
				
					|  |  |  |  |         }); | 
			
		
	
		
			
				
					|  |  |  |  |         return data; | 
			
		
	
		
			
				
					|  |  |  |  |     } catch (error) { | 
			
		
	
		
			
				
					|  |  |  |  |         return error; | 
			
		
	
		
			
				
					|  |  |  |  |     } | 
			
		
	
		
			
				
					|  |  |  |  |   try { | 
			
		
	
		
			
				
					|  |  |  |  |     const data = await axios.get(url, { | 
			
		
	
		
			
				
					|  |  |  |  |       params: params, | 
			
		
	
		
			
				
					|  |  |  |  |     }); | 
			
		
	
		
			
				
					|  |  |  |  |     return data; | 
			
		
	
		
			
				
					|  |  |  |  |   } catch (error) { | 
			
		
	
		
			
				
					|  |  |  |  |     return error; | 
			
		
	
		
			
				
					|  |  |  |  |   } | 
			
		
	
		
			
				
					|  |  |  |  | } | 
			
		
	
		
			
				
					|  |  |  |  | export const POST = async (url, params) => { | 
			
		
	
		
			
				
					|  |  |  |  |     try { | 
			
		
	
		
			
				
					|  |  |  |  |         params = isEncryptionParam(params) | 
			
		
	
		
			
				
					|  |  |  |  |         const data = await axios.post(`${baseUrl}${url}`, params, false); | 
			
		
	
		
			
				
					|  |  |  |  |         return data; | 
			
		
	
		
			
				
					|  |  |  |  |     } catch (error) { | 
			
		
	
		
			
				
					|  |  |  |  |         return error; | 
			
		
	
		
			
				
					|  |  |  |  |     } | 
			
		
	
		
			
				
					|  |  |  |  |   try { | 
			
		
	
		
			
				
					|  |  |  |  |     params = isEncryptionParam(params) | 
			
		
	
		
			
				
					|  |  |  |  |     const data = await axios.post(`${baseUrl}${url}`, params, false); | 
			
		
	
		
			
				
					|  |  |  |  |     return data; | 
			
		
	
		
			
				
					|  |  |  |  |   } catch (error) { | 
			
		
	
		
			
				
					|  |  |  |  |     return error; | 
			
		
	
		
			
				
					|  |  |  |  |   } | 
			
		
	
		
			
				
					|  |  |  |  | } | 
			
		
	
		
			
				
					|  |  |  |  | export const PUT = async (url, params) => { | 
			
		
	
		
			
				
					|  |  |  |  |     try { | 
			
		
	
		
			
				
					|  |  |  |  |         params = isEncryptionParam(params) | 
			
		
	
		
			
				
					|  |  |  |  |         const data = await axios.put(`${baseUrl}${url}`, params, false); | 
			
		
	
		
			
				
					|  |  |  |  |         return data; | 
			
		
	
		
			
				
					|  |  |  |  |     } catch (error) { | 
			
		
	
		
			
				
					|  |  |  |  |         return error; | 
			
		
	
		
			
				
					|  |  |  |  |     } | 
			
		
	
		
			
				
					|  |  |  |  |   try { | 
			
		
	
		
			
				
					|  |  |  |  |     params = isEncryptionParam(params) | 
			
		
	
		
			
				
					|  |  |  |  |     const data = await axios.put(`${baseUrl}${url}`, params, false); | 
			
		
	
		
			
				
					|  |  |  |  |     return data; | 
			
		
	
		
			
				
					|  |  |  |  |   } catch (error) { | 
			
		
	
		
			
				
					|  |  |  |  |     return error; | 
			
		
	
		
			
				
					|  |  |  |  |   } | 
			
		
	
		
			
				
					|  |  |  |  | } | 
			
		
	
		
			
				
					|  |  |  |  | export const DELETE = async (url, params) => { | 
			
		
	
		
			
				
					|  |  |  |  |     // console.log(params)
 | 
			
		
	
		
			
				
					|  |  |  |  |     try { | 
			
		
	
		
			
				
					|  |  |  |  |         params = isEncryptionParam(params) | 
			
		
	
		
			
				
					|  |  |  |  |         const data = await axios.delete(`${baseUrl}${url}`, { data: params, headers: configs_ENC.headers }, configs_ENC); | 
			
		
	
		
			
				
					|  |  |  |  |         return data; | 
			
		
	
		
			
				
					|  |  |  |  |     } catch (error) { | 
			
		
	
		
			
				
					|  |  |  |  |         return error; | 
			
		
	
		
			
				
					|  |  |  |  |     } | 
			
		
	
		
			
				
					|  |  |  |  |   // console.log(params)
 | 
			
		
	
		
			
				
					|  |  |  |  |   try { | 
			
		
	
		
			
				
					|  |  |  |  |     params = isEncryptionParam(params) | 
			
		
	
		
			
				
					|  |  |  |  |     const data = await axios.delete(`${baseUrl}${url}`, {data: params, headers: configs_ENC.headers}, configs_ENC); | 
			
		
	
		
			
				
					|  |  |  |  |     return data; | 
			
		
	
		
			
				
					|  |  |  |  |   } catch (error) { | 
			
		
	
		
			
				
					|  |  |  |  |     return error; | 
			
		
	
		
			
				
					|  |  |  |  |   } | 
			
		
	
		
			
				
					|  |  |  |  | } | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
	
		
			
				
					|  |  |  | @ -284,29 +283,29 @@ export const DELETE = async (url, params) => { | 
			
		
	
		
			
				
					|  |  |  |  |  * @文件类型提交方法 | 
			
		
	
		
			
				
					|  |  |  |  |  */ | 
			
		
	
		
			
				
					|  |  |  |  | let configs = { | 
			
		
	
		
			
				
					|  |  |  |  |     headers: { 'Content-Type': 'multipart/form-data' }, | 
			
		
	
		
			
				
					|  |  |  |  |   headers: {'Content-Type': 'multipart/form-data'}, | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  | } | 
			
		
	
		
			
				
					|  |  |  |  | export const FILESubmit = async (url, params, config) => { | 
			
		
	
		
			
				
					|  |  |  |  |     try { | 
			
		
	
		
			
				
					|  |  |  |  |         const data = await axios.post(`${baseUrl}${url}`, params, { | 
			
		
	
		
			
				
					|  |  |  |  |             ...configs, | 
			
		
	
		
			
				
					|  |  |  |  |             cancelToken: new CancelToken(function executor(c) { | 
			
		
	
		
			
				
					|  |  |  |  |                 config.setCancel && config.setCancel(c) | 
			
		
	
		
			
				
					|  |  |  |  |             }), | 
			
		
	
		
			
				
					|  |  |  |  |             onUploadProgress: (e) => { | 
			
		
	
		
			
				
					|  |  |  |  |                 if (e.total > 0) { | 
			
		
	
		
			
				
					|  |  |  |  |                     e.percent = e.loaded / e.total * 100; | 
			
		
	
		
			
				
					|  |  |  |  |                 } | 
			
		
	
		
			
				
					|  |  |  |  |                 // console.log(config)
 | 
			
		
	
		
			
				
					|  |  |  |  |                 config.onProgress && config.onProgress(e) | 
			
		
	
		
			
				
					|  |  |  |  |             }, | 
			
		
	
		
			
				
					|  |  |  |  |   try { | 
			
		
	
		
			
				
					|  |  |  |  |     const data = await axios.post(`${baseUrl}${url}`, params, { | 
			
		
	
		
			
				
					|  |  |  |  |       ...configs, | 
			
		
	
		
			
				
					|  |  |  |  |       cancelToken: new CancelToken(function executor(c) { | 
			
		
	
		
			
				
					|  |  |  |  |         config.setCancel && config.setCancel(c) | 
			
		
	
		
			
				
					|  |  |  |  |       }), | 
			
		
	
		
			
				
					|  |  |  |  |       onUploadProgress: (e) => { | 
			
		
	
		
			
				
					|  |  |  |  |         if (e.total > 0) { | 
			
		
	
		
			
				
					|  |  |  |  |           e.percent = e.loaded / e.total * 100; | 
			
		
	
		
			
				
					|  |  |  |  |         } | 
			
		
	
		
			
				
					|  |  |  |  |         // console.log(config)
 | 
			
		
	
		
			
				
					|  |  |  |  |         config.onProgress && config.onProgress(e) | 
			
		
	
		
			
				
					|  |  |  |  |       }, | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |         }); | 
			
		
	
		
			
				
					|  |  |  |  |         return data; | 
			
		
	
		
			
				
					|  |  |  |  |     } catch (err) { | 
			
		
	
		
			
				
					|  |  |  |  |         return err; | 
			
		
	
		
			
				
					|  |  |  |  |     } | 
			
		
	
		
			
				
					|  |  |  |  |     }); | 
			
		
	
		
			
				
					|  |  |  |  |     return data; | 
			
		
	
		
			
				
					|  |  |  |  |   } catch (err) { | 
			
		
	
		
			
				
					|  |  |  |  |     return err; | 
			
		
	
		
			
				
					|  |  |  |  |   } | 
			
		
	
		
			
				
					|  |  |  |  | } | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  | /** | 
			
		
	
	
		
			
				
					|  |  |  | @ -314,26 +313,26 @@ export const FILESubmit = async (url, params, config) => { | 
			
		
	
		
			
				
					|  |  |  |  |  * @param {config.responseType} 下载文件流根据后端 配置   arraybuffer || blod | 
			
		
	
		
			
				
					|  |  |  |  |  */ | 
			
		
	
		
			
				
					|  |  |  |  | export const FILE = async (config = {}, body, params) => { | 
			
		
	
		
			
				
					|  |  |  |  |     try { | 
			
		
	
		
			
				
					|  |  |  |  |         const data = await axios({ | 
			
		
	
		
			
				
					|  |  |  |  |             method: config.method || 'get', | 
			
		
	
		
			
				
					|  |  |  |  |             url: `${baseUrl}${config.url}`, | 
			
		
	
		
			
				
					|  |  |  |  |             data: body, | 
			
		
	
		
			
				
					|  |  |  |  |             params: params, | 
			
		
	
		
			
				
					|  |  |  |  |             responseType: config.responseType || 'blob', | 
			
		
	
		
			
				
					|  |  |  |  |             onDownloadProgress: (e) => { | 
			
		
	
		
			
				
					|  |  |  |  |                 // console.log(e,e.currentTarget)
 | 
			
		
	
		
			
				
					|  |  |  |  |                 // if (e.currentTarget.response.size > 0) {
 | 
			
		
	
		
			
				
					|  |  |  |  |                 //     e.percent = e.loaded / e.currentTarget.response.size * 100;
 | 
			
		
	
		
			
				
					|  |  |  |  |                 // }
 | 
			
		
	
		
			
				
					|  |  |  |  |                 // event.srcElement.getResponseHeader('content-length')
 | 
			
		
	
		
			
				
					|  |  |  |  |                 config.onProgress && config.onProgress(e) | 
			
		
	
		
			
				
					|  |  |  |  |             }, | 
			
		
	
		
			
				
					|  |  |  |  |         }); | 
			
		
	
		
			
				
					|  |  |  |  |         return data; | 
			
		
	
		
			
				
					|  |  |  |  |     } catch (err) { | 
			
		
	
		
			
				
					|  |  |  |  |         return err; | 
			
		
	
		
			
				
					|  |  |  |  |     } | 
			
		
	
		
			
				
					|  |  |  |  |   try { | 
			
		
	
		
			
				
					|  |  |  |  |     const data = await axios({ | 
			
		
	
		
			
				
					|  |  |  |  |       method: config.method || 'get', | 
			
		
	
		
			
				
					|  |  |  |  |       url: `${baseUrl}${config.url}`, | 
			
		
	
		
			
				
					|  |  |  |  |       data: body, | 
			
		
	
		
			
				
					|  |  |  |  |       params: params, | 
			
		
	
		
			
				
					|  |  |  |  |       responseType: config.responseType || 'blob', | 
			
		
	
		
			
				
					|  |  |  |  |       onDownloadProgress: (e) => { | 
			
		
	
		
			
				
					|  |  |  |  |         // console.log(e,e.currentTarget)
 | 
			
		
	
		
			
				
					|  |  |  |  |         // if (e.currentTarget.response.size > 0) {
 | 
			
		
	
		
			
				
					|  |  |  |  |         //     e.percent = e.loaded / e.currentTarget.response.size * 100;
 | 
			
		
	
		
			
				
					|  |  |  |  |         // }
 | 
			
		
	
		
			
				
					|  |  |  |  |         // event.srcElement.getResponseHeader('content-length')
 | 
			
		
	
		
			
				
					|  |  |  |  |         config.onProgress && config.onProgress(e) | 
			
		
	
		
			
				
					|  |  |  |  |       }, | 
			
		
	
		
			
				
					|  |  |  |  |     }); | 
			
		
	
		
			
				
					|  |  |  |  |     return data; | 
			
		
	
		
			
				
					|  |  |  |  |   } catch (err) { | 
			
		
	
		
			
				
					|  |  |  |  |     return err; | 
			
		
	
		
			
				
					|  |  |  |  |   } | 
			
		
	
		
			
				
					|  |  |  |  | } | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
	
		
			
				
					|  |  |  | 
 |