| 
						
						
						
					 | 
					@ -1,59 +1,68 @@ | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					import axios from 'axios' | 
					 | 
					 | 
					import axios from "axios"; | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					import Cookies from 'js-cookie' | 
					 | 
					 | 
					import Cookies from "js-cookie"; | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					import router from '@/router' | 
					 | 
					 | 
					import router from "@/router"; | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					import qs from 'qs' | 
					 | 
					 | 
					import qs from "qs"; | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					import { clearLoginInfo } from '@/utils' | 
					 | 
					 | 
					import { clearLoginInfo } from "@/utils"; | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					import isPlainObject from 'lodash/isPlainObject' | 
					 | 
					 | 
					import isPlainObject from "lodash/isPlainObject"; | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					const http = axios.create({ | 
					 | 
					 | 
					const http = axios.create({ | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					  baseURL: window.SITE_CONFIG['apiURL'], | 
					 | 
					 | 
					  baseURL: window.SITE_CONFIG["apiURL"], | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					  timeout: 1000 * 900, | 
					 | 
					 | 
					  timeout: 1000 * 900, | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					  withCredentials: true | 
					 | 
					 | 
					  withCredentials: true, | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					}) | 
					 | 
					 | 
					}); | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					/** | 
					 | 
					 | 
					/** | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 * 请求拦截 | 
					 | 
					 | 
					 * 请求拦截 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 */ | 
					 | 
					 | 
					 */ | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					http.interceptors.request.use(config => { | 
					 | 
					 | 
					http.interceptors.request.use( | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					  config.headers['Accept-Language'] = localStorage.getItem('language') || 'zh-CN' | 
					 | 
					 | 
					  (config) => { | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					  config.headers['token'] = localStorage.getItem('token') || '' | 
					 | 
					 | 
					    config.headers["Accept-Language"] = | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					  config.headers['Authorization'] = localStorage.getItem('token') || '' | 
					 | 
					 | 
					      localStorage.getItem("language") || "zh-CN"; | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					    config.headers["token"] = localStorage.getItem("token") || ""; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					    config.headers["Authorization"] = localStorage.getItem("token") || ""; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    // 默认参数
 | 
					 | 
					 | 
					    // 默认参数
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					  var defaults = {} | 
					 | 
					 | 
					    var defaults = {}; | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					    // 防止缓存,GET请求默认带_t参数
 | 
					 | 
					 | 
					    // 防止缓存,GET请求默认带_t参数
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					  if (config.method == 'get') { | 
					 | 
					 | 
					    if (config.method == "get") { | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					      config.params = { | 
					 | 
					 | 
					      config.params = { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        ...config.params, | 
					 | 
					 | 
					        ...config.params, | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					      ...{ '_t': new Date().getTime() } | 
					 | 
					 | 
					        ...{ _t: new Date().getTime() }, | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					    } | 
					 | 
					 | 
					      }; | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					    } | 
					 | 
					 | 
					    } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    if (isPlainObject(config.params)) { | 
					 | 
					 | 
					    if (isPlainObject(config.params)) { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					      config.params = { | 
					 | 
					 | 
					      config.params = { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        ...defaults, | 
					 | 
					 | 
					        ...defaults, | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					      ...config.params | 
					 | 
					 | 
					        ...config.params, | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					    } | 
					 | 
					 | 
					      }; | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					    } | 
					 | 
					 | 
					    } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    if (isPlainObject(config.data)) { | 
					 | 
					 | 
					    if (isPlainObject(config.data)) { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					      config.data = { | 
					 | 
					 | 
					      config.data = { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        ...defaults, | 
					 | 
					 | 
					        ...defaults, | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					      ...config.data | 
					 | 
					 | 
					        ...config.data, | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					      }; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					      if ( | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        /^application\/x-www-form-urlencoded/.test( | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					          config.headers["content-type"] | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        ) | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					      ) { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        config.data = qs.stringify(config.data); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					      } | 
					 | 
					 | 
					      } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    if (/^application\/x-www-form-urlencoded/.test(config.headers['content-type'])) { | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					      config.data = qs.stringify(config.data) | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    } | 
					 | 
					 | 
					    } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					    return config; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					  }, | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					  (error) => { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					    return Promise.reject(error); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					  } | 
					 | 
					 | 
					  } | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					  return config | 
					 | 
					 | 
					); | 
				
			
			
				
				
			
		
	
		
		
			
				
					 | 
					 | 
					}, error => { | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					  return Promise.reject(error) | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					}) | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					/** | 
					 | 
					 | 
					/** | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 * 响应拦截 | 
					 | 
					 | 
					 * 响应拦截 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 */ | 
					 | 
					 | 
					 */ | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					http.interceptors.response.use(response => { | 
					 | 
					 | 
					http.interceptors.response.use( | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					  const code = [10007, 401, 10001, 10005] | 
					 | 
					 | 
					  (response) => { | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					    const code = [10007, 401, 10001, 10005]; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    if (code.includes(response.data.code)) { | 
					 | 
					 | 
					    if (code.includes(response.data.code)) { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					    clearLoginInfo() | 
					 | 
					 | 
					      clearLoginInfo(); | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					      // localStorage.setItem('userType', 'work')
 | 
					 | 
					 | 
					      // localStorage.setItem('userType', 'work')
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					      // let userType = localStorage.getItem("userType");
 | 
					 | 
					 | 
					      // let userType = localStorage.getItem("userType");
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					      // if (userType === 'work'){
 | 
					 | 
					 | 
					      // if (userType === 'work'){
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					@ -61,14 +70,34 @@ http.interceptors.response.use(response => { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					      // }else {
 | 
					 | 
					 | 
					      // }else {
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					      //   router.replace({ name: 'login' })
 | 
					 | 
					 | 
					      //   router.replace({ name: 'login' })
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					      // }
 | 
					 | 
					 | 
					      // }
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					    router.replace({ name: 'login' }) | 
					 | 
					 | 
					      router.replace({ name: "login" }); | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					    return Promise.reject(response.data.msg) | 
					 | 
					 | 
					      return Promise.reject(response.data.msg); | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					    } | 
					 | 
					 | 
					    } | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					  return response | 
					 | 
					 | 
					    return response; | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					}, error => { | 
					 | 
					 | 
					  }, | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					  console.error(error) | 
					 | 
					 | 
					  (error) => { | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					  return Promise.reject(error) | 
					 | 
					 | 
					    console.error(error); | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					}) | 
					 | 
					 | 
					    return Promise.reject(error); | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					  } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					// http.put = function (url, data, config) {
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					//   http.post(url, data, {
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					//     ...config,
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					//     headers: {
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					//       "X-HTTP-Method-Override": "PUT",
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					//     },
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					//   });
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					// };
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					// http.delete = function (url, config) {
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					//   http.post(url, config.data || {}, {
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					//     ...config,
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					//     headers: {
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					//       "X-HTTP-Method-Override": "DELETE",
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					//     },
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					//   });
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					// };
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					export default http | 
					 | 
					 | 
					export default http; | 
				
			
			
				
				
			
		
	
		
		
	
	
		
		
			
				
					| 
						
						
						
					 | 
					
  |