1
0
Fork 0
management/front/dkha-web-sz-main/node_modules/.cache/babel-loader/4899b9fbb716db858c770d87574...

1 line
8.6 KiB
JSON
Raw Normal View History

2023-12-18 13:12:25 +08:00
{"remainingRequest":"C:\\Users\\27446\\Desktop\\up\\front\\dkha-web-sz-main\\node_modules\\babel-loader\\lib\\index.js!C:\\Users\\27446\\Desktop\\up\\front\\dkha-web-sz-main\\src\\utils\\request.js","dependencies":[{"path":"C:\\Users\\27446\\Desktop\\up\\front\\dkha-web-sz-main\\src\\utils\\request.js","mtime":1614735254000},{"path":"C:\\Users\\27446\\Desktop\\up\\front\\dkha-web-sz-main\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"C:\\Users\\27446\\Desktop\\up\\front\\dkha-web-sz-main\\node_modules\\babel-loader\\lib\\index.js","mtime":499162500000}],"contextDependencies":[],"result":["import \"core-js/modules/es7.object.get-own-property-descriptors\";\nimport \"core-js/modules/web.dom.iterable\";\nimport \"core-js/modules/es6.object.keys\";\nimport \"core-js/modules/es6.regexp.replace\";\nimport _defineProperty from \"C:\\\\Users\\\\27446\\\\Desktop\\\\up\\\\front\\\\dkha-web-sz-main\\\\node_modules\\\\@babel\\\\runtime-corejs2/helpers/esm/defineProperty\";\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nimport axios from 'axios';\nimport Cookies from 'js-cookie';\nimport router from '@/router';\nimport qs from 'qs';\nimport { clearLoginInfo } from '@/utils';\nimport isPlainObject from 'lodash/isPlainObject';\nimport store from '@/store';\nimport { Message } from 'element-ui';\nvar http = axios.create({\n baseURL: window.SITE_CONFIG['apiURL'],\n timeout: 1000 * 180,\n withCredentials: true\n});\n/**\n * 请求拦截\n */\n\nhttp.interceptors.request.use(function (config) {\n config.headers['Accept-Language'] = Cookies.get('language') || 'zh-CN';\n\n if (config.url !== '/auth/oauth/token') {\n config.headers['Authorization'] = 'Bearer ' + Cookies.get('access_token') || '';\n } // 默认参数\n\n\n var defaults = {}; // 防止缓存GET请求默认带_t参数\n\n if (config.method === 'get') {\n config.params = _objectSpread({}, config.params, {}, {\n '_t': new Date().getTime()\n });\n }\n\n if (isPlainObject(config.params)) {\n config.params = _objectSpread({}, defaults, {}, config.params);\n }\n\n if (isPlainObject(config.data)) {\n config.data = _objectSpread({}, defaults, {}, config.data);\n\n if (/^application\\/x-www-form-urlencoded/.test(config.headers['content-type'])) {\n config.data = qs.stringify(config.data);\n }\n }\n\n return config;\n}, function (error) {\n return Promise.reject(error);\n});\n/**\n * 响应拦截\n */\n\nhttp.interceptors.response.use(function (response) {\n if (response.data.code === 401 || response.data.code === 10001) {\n clearLoginInfo();\n router.replace({\n name: 'login'\n });\n return Promise.reject(response.data.msg);\n }\n\n return response;\n}, function (error) {\n if (error.request.status === 0 && error.response === undefined && store.state.user.id) {\n // 加入 store.state.user.id 避免多个请求 重复提示\n clearLoginInfo();\n Message.warning('系统升级中,请稍后重试!');\n router.replace({\n name: 'login'\n });\n }\n\n return Promise.reject(error);\n});\nexport default http;",{"version":3,"sources":["C:\\Users\\27446\\Desktop\\up\\front\\dkha-web-sz-main\\src\\utils\\request.js"],"names":["axios","Cookies","router","qs","clearLogi