{"remainingRequest":"C:\\Users\\100zone\\Desktop\\baizong\\community\\SmartCommunity\\videoSurveillance\\node_modules\\babel-loader\\lib\\index.js!C:\\Users\\100zone\\Desktop\\baizong\\community\\SmartCommunity\\videoSurveillance\\src\\utils\\http.js","dependencies":[{"path":"C:\\Users\\100zone\\Desktop\\baizong\\community\\SmartCommunity\\videoSurveillance\\src\\utils\\http.js","mtime":1663828782934},{"path":"C:\\Users\\100zone\\Desktop\\baizong\\community\\SmartCommunity\\videoSurveillance\\babel.config.js","mtime":1663828782900},{"path":"C:\\Users\\100zone\\Desktop\\baizong\\community\\SmartCommunity\\videoSurveillance\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"C:\\Users\\100zone\\Desktop\\baizong\\community\\SmartCommunity\\videoSurveillance\\node_modules\\babel-loader\\lib\\index.js","mtime":315532800000}],"contextDependencies":[],"result":["import \"core-js/modules/es6.regexp.replace\";\nimport axios from 'axios';\nimport qs from 'qs';\nimport Vue from 'vue';\nimport ElementUI from 'element-ui';\nimport config from '@/config'; // 获取CancelToken\n\nvar CancelToken = axios.CancelToken;\nvar source = CancelToken.source();\nvar http = axios.create({\n timout: 30000\n}); // axios request 拦截器\n\nhttp.interceptors.request.use(function (config) {\n // if (config.url.indexOf('/sc-user-auth') !== -1) {\n // config.url = config.url;\n // }\n config.headers[localStorage.getItem('SC_token') && 'Authorization'] = 'Bearer ' + localStorage.getItem('SC_token'); // 全局添加cancelToken\n\n config.cancelToken = source.token;\n return config;\n}, function (err) {\n return Promise.reject(err);\n}); // axios响应拦截\n\nhttp.interceptors.response.use(function (res) {\n return Promise.resolve(res.data);\n}, function (err) {\n if (err.response.status == 401) {\n axios({\n url: '/sc-user-auth/user/getUserStatus?accessToken=' + localStorage.getItem('SC_token'),\n method: 'get'\n }).then(function (response) {\n if (window.relogin) return false;\n window.relogin = true;\n var data = response.data.data;\n\n if (data == 0) {\n Vue.prototype.$msgBox('你的登录已超时,请重新登录', '', 'warning', {\n width: '290px',\n showCancelButton: false,\n confirmButtonText: '确定',\n showClose: false\n }).then(function () {\n window.open(config.loginUrl, '_self');\n window.relogin = false;\n localStorage.removeItem('SC_token');\n }).catch(function () {});\n } else if (data == 1) {\n Vue.prototype.$msgBox('该账号已在其他地址登录,如需访问请重新登录', '', 'warning', {\n width: '290px',\n showCancelButton: false,\n confirmButtonText: '确定',\n showClose: false\n }).then(function () {\n window.open(config.loginUrl, '_self');\n window.relogin = false;\n localStorage.removeItem('SC_token');\n }).catch(function () {});\n } else {\n Vue.prototype.$msgBox('你的账号已被停用,如有问题请联系管理员', '', 'warning', {\n width: '290px',\n showCancelButton: false,\n confirmButtonText: '确定',\n showClose: false\n }).then(function () {\n window.open(config.loginUrl, '_self');\n window.relogin = false;\n localStorage.removeItem('SC_token');\n }).catch(function () {});\n }\n });\n return;\n }\n\n if (axios.isCancel(err)) return new Promise(function () {}); // 取消请求的情况下,终端Promise调用链\n\n return Promise.reject(err);\n});\nexport default {\n vm: '',\n post: function post(url, data) {\n var _this = this;\n\n return new Promise(function (resolve, reject) {\n http.post(url, data).then(function (res) {\n _this.callback(resolve, res);\n }).catch(function (err) {\n _this.reject(reject, err);\n });\n });\n },\n postForm: function postForm(url, data) {\n var _this2 = this;\n\n return new Promise(function (resolve, reject) {\n http.post(url, qs.stringify(data)).then(function (res) {\n _this2.callback(resolve, res);\n }).catch(function (err) {\n _this2.reject(reject, err);\n });\n });\n },\n get: function get(url, data) {\n var _this3 = this;\n\n for (var item in data) {\n if (data[item] && 'string' == typeof data[item]) {\n data[item] = data[item].replace(/[`!@#$%^&*()\\[\\]\\\\{}=\\'\\\"\\/<>]/g, '');\n }\n }\n\n return new Promise(function (resolve, reject) {\n http.get(url, {\n params: data\n }).then(function (res) {\n _this3.callback(resolve, res);\n }).catch(function (err) {\n _this3.reject(reject, err);\n });\n });\n },\n delete: function _delete(url, data) {\n var _this4 = this;\n\n return new Promise(function (resolve, reject) {\n http.delete(url, {\n params: data\n }).then(function (res) {\n _this4.callback(resolve, res);\n }).catch(function (err) {\n _this4.reject(reject, err);\n });\n });\n },\n deleteJSON: function deleteJSON(url, data) {\n var _this5 = this;\n\n return new Promise(function (resolve, reject) {\n http.delete(url, {\n data: data\n }).then(function (res) {\n _this5.callback(resolve, res);\n }).catch(function (err) {\n _this5.reject(reject, err);\n });\n });\n },\n putForm: function putForm(url, data) {\n var _this6 = this;\n\n return new Promise(function (resolve, reject) {\n http.put(url, qs.stringify(data)).then(function (res) {\n _this6.callback(resolve, res);\n }).catch(function (err) {\n _this6.reject(reject, err);\n });\n });\n },\n put: function put(url, data) {\n var _this7 = this;\n\n return new Promise(function (resolve, reject) {\n http.put(url, data).then(function (res) {\n _this7.callback(resolve, res);\n }).catch(function (err) {\n _this7.reject(reject, err);\n });\n });\n },\n callback: function callback(resolve, res) {\n resolve(res);\n },\n reject: function reject(_reject, err) {\n if (err instanceof Error) {\n ElementUI.Message.error(err.message);\n }\n\n _reject(err);\n }\n};",{"version":3,"sources":["C:/Users/100zone/Desktop/baizong/community/SmartCommunity/videoSurveillance/src/utils/http.js"],"names":["axios","qs","Vue","ElementUI","config","CancelToken","source","http","create","timout","interceptors","request","use","headers","localStorage","getItem","cancelToken","token","err","Promise","reject","response","res","resolve","data","status","url","method","then","window","relogin","prototype","$msgBox","width","showCancelButton","confirmButtonText","showClose","open","loginUrl","removeItem","catch","isCancel","vm","post","callback","postForm","stringify","get","item","replace","params","delete","deleteJSON","putForm","put","Error","Message","error","message"],"mappings":";AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,EAAP,MAAe,IAAf;AACA,OAAOC,GAAP,MAAgB,KAAhB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,MAAP,MAAmB,UAAnB,C,CAEA;;AACA,IAAMC,WAAW,GAAGL,KAAK,CAACK,WAA1B;AACA,IAAMC,MAAM,GAAGD,WAAW,CAACC,MAAZ,EAAf;AACA,IAAIC,IAAI,GAAGP,KAAK,CAACQ,MAAN,CAAa;AAC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d,EACKI,IADL,CACU,UAACN,GAAD,EAAS;AACX,QAAA,MAAI,CAACsB,QAAL,CAAcrB,OAAd,EAAuBD,GAAvB;AACH,OAHL,EAIKkB,KAJL,CAIW,UAACtB,GAAD,EAAS;AACZ,QAAA,MAAI,CAACE,MAAL,CAAYA,MAAZ,EAAoBF,GAApB;AACH,OANL;AAOH,KARM,CAAP;AASH,GAzFU;AA0FX0B,EAAAA,QA1FW,oBA0FFrB,OA1FE,EA0FOD,GA1FP,EA0FY;AACnBC,IAAAA,OAAO,CAACD,GAAD,CAAP;AACH,GA5FU;AA6FXF,EAAAA,MA7FW,kBA6FJA,OA7FI,EA6FIF,GA7FJ,EA6FS;AAChB,QAAIA,GAAG,YAAYqC,KAAnB,EAA0B;AACtBpD,MAAAA,SAAS,CAACqD,OAAV,CAAkBC,KAAlB,CAAwBvC,GAAG,CAACwC,OAA5B;AACH;;AACDtC,IAAAA,OAAM,CAACF,GAAD,CAAN;AACH;AAlGU,CAAf","sourcesContent":["import axios from 'axios';\r\nimport qs from 'qs';\r\nimport Vue from 'vue';\r\nimport ElementUI from 'element-ui';\r\nimport config from '@/config';\r\n\r\n// 获取CancelToken\r\nconst CancelToken = axios.CancelToken;\r\nconst source = CancelToken.source();\r\nvar http = axios.create({\r\n timout: 30000\r\n});\r\n\r\n// axios request 拦截器\r\nhttp.interceptors.request.use(\r\n (config) => {\r\n // if (config.url.indexOf('/sc-user-auth') !== -1) {\r\n // config.url = config.url;\r\n // }\r\n config.headers[localStorage.getItem('SC_token') && 'Authorization'] = 'Bearer ' + localStorage.getItem('SC_token');\r\n // 全局添加cancelToken\r\n config.cancelToken = source.token;\r\n return config;\r\n },\r\n (err) => {\r\n return Promise.reject(err);\r\n }\r\n);\r\n// axios响应拦截\r\nhttp.interceptors.response.use(\r\n (res) => {\r\n return Promise.resolve(res.data);\r\n },\r\n (err) => {\r\n if (err.response.status == 401) {\r\n axios({\r\n url: '/sc-user-auth/user/getUserStatus?accessToken=' + localStorage.getItem('SC_token'),\r\n method: 'get'\r\n }).then((response) => {\r\n if (window.relogin) return false;\r\n window.relogin = true;\r\n let data = response.data.data;\r\n if (data == 0) {\r\n Vue.prototype\r\n .$msgBox('你的登录已超时,请重新登录', '', 'warning', {\r\n width: '290px',\r\n showCancelButton: false,\r\n confirmButtonText: '确定',\r\n showClose: false\r\n })\r\n .then(() => {\r\n window.open(config.loginUrl, '_self');\r\n window.relogin = false;\r\n localStorage.removeItem('SC_token');\r\n })\r\n .catch(() => { });\r\n } else if (data == 1) {\r\n Vue.prototype\r\n .$msgBox('该账号已在其他地址登录,如需访问请重新登录', '', 'warning', {\r\n width: '290px',\r\n showCancelButton: false,\r\n confirmButtonText: '确定',\r\n showClose: false\r\n })\r\n .then(() => {\r\n window.open(config.loginUrl, '_self');\r\n window.relogin = false;\r\n localStorage.removeItem('SC_token');\r\n })\r\n .catch(() => { });\r\n } else {\r\n Vue.prototype\r\n .$msgBox('你的账号已被停用,如有问题请联系管理员', '', 'warning', {\r\n width: '290px',\r\n showCancelButton: false,\r\n confirmButtonText: '确定',\r\n showClose: false\r\n })\r\n .then(() => {\r\n window.open(config.loginUrl, '_self');\r\n window.relogin = false;\r\n localStorage.removeItem('SC_token');\r\n })\r\n .catch(() => { });\r\n }\r\n });\r\n return;\r\n }\r\n if (axios.isCancel(err)) return new Promise(() => { }); // 取消请求的情况下,终端Promise调用链\r\n return Promise.reject(err);\r\n }\r\n);\r\n\r\nexport default {\r\n vm: '',\r\n post(url, data) {\r\n return new Promise((resolve, reject) => {\r\n http.post(url, data)\r\n .then((res) => {\r\n this.callback(resolve, res);\r\n })\r\n .catch((err) => {\r\n this.reject(reject, err);\r\n });\r\n });\r\n },\r\n postForm(url, data) {\r\n return new Promise((resolve, reject) => {\r\n http.post(url, qs.stringify(data))\r\n .then((res) => {\r\n this.callback(resolve, res);\r\n })\r\n .catch((err) => {\r\n this.reject(reject, err);\r\n });\r\n });\r\n },\r\n get(url, data) {\r\n for (let item in data) {\r\n if (data[item] && 'string' == typeof data[item]) {\r\n data[item] = data[item].replace(/[`!@#$%^&*()\\[\\]\\\\{}=\\'\\\"\\/<>]/g, '');\r\n }\r\n }\r\n return new Promise((resolve, reject) => {\r\n http.get(url, {\r\n params: data\r\n })\r\n .then((res) => {\r\n this.callback(resolve, res);\r\n })\r\n .catch((err) => {\r\n this.reject(reject, err);\r\n });\r\n });\r\n },\r\n delete(url, data) {\r\n return new Promise((resolve, reject) => {\r\n http.delete(url, {\r\n params: data\r\n })\r\n .then((res) => {\r\n this.callback(resolve, res);\r\n })\r\n .catch((err) => {\r\n this.reject(reject, err);\r\n });\r\n });\r\n },\r\n deleteJSON(url, data) {\r\n return new Promise((resolve, reject) => {\r\n http.delete(url, {\r\n data: data\r\n })\r\n .then((res) => {\r\n this.callback(resolve, res);\r\n })\r\n .catch((err) => {\r\n this.reject(reject, err);\r\n });\r\n });\r\n },\r\n putForm(url, data) {\r\n return new Promise((resolve, reject) => {\r\n http.put(url, qs.stringify(data))\r\n .then((res) => {\r\n this.callback(resolve, res);\r\n })\r\n .catch((err) => {\r\n this.reject(reject, err);\r\n });\r\n });\r\n },\r\n put(url, data) {\r\n return new Promise((resolve, reject) => {\r\n http.put(url, data)\r\n .then((res) => {\r\n this.callback(resolve, res);\r\n })\r\n .catch((err) => {\r\n this.reject(reject, err);\r\n });\r\n });\r\n },\r\n callback(resolve, res) {\r\n resolve(res);\r\n },\r\n reject(reject, err) {\r\n if (err instanceof Error) {\r\n ElementUI.Message.error(err.message);\r\n }\r\n reject(err);\r\n }\r\n};\r\n"]}]}