doway-coms 1.1.25 → 1.1.27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/doway-coms.common.js +248 -227
- package/lib/doway-coms.umd.js +248 -227
- package/lib/doway-coms.umd.min.js +3 -3
- package/package.json +1 -1
package/lib/doway-coms.umd.js
CHANGED
|
@@ -78941,6 +78941,11 @@ __webpack_require__.d(__webpack_exports__, "getFormValidErrors", function() { re
|
|
|
78941
78941
|
__webpack_require__.d(__webpack_exports__, "stringUrlQuery", function() { return /* reexport */ common_stringUrlQuery; });
|
|
78942
78942
|
__webpack_require__.d(__webpack_exports__, "getRouteFullPath", function() { return /* reexport */ getRouteFullPath; });
|
|
78943
78943
|
__webpack_require__.d(__webpack_exports__, "getGridValidErrors", function() { return /* reexport */ getGridValidErrors; });
|
|
78944
|
+
__webpack_require__.d(__webpack_exports__, "successMsg", function() { return /* reexport */ successMsg; });
|
|
78945
|
+
__webpack_require__.d(__webpack_exports__, "warningMsg", function() { return /* reexport */ warningMsg; });
|
|
78946
|
+
__webpack_require__.d(__webpack_exports__, "errorMsg", function() { return /* reexport */ common_errorMsg; });
|
|
78947
|
+
__webpack_require__.d(__webpack_exports__, "infoMsg", function() { return /* reexport */ infoMsg; });
|
|
78948
|
+
__webpack_require__.d(__webpack_exports__, "closeMsg", function() { return /* reexport */ closeMsg; });
|
|
78944
78949
|
__webpack_require__.d(__webpack_exports__, "routeBeforeEach", function() { return /* reexport */ routeBeforeEach; });
|
|
78945
78950
|
__webpack_require__.d(__webpack_exports__, "timeAgo", function() { return /* reexport */ timeAgo; });
|
|
78946
78951
|
__webpack_require__.d(__webpack_exports__, "parseTime", function() { return /* reexport */ parseTime; });
|
|
@@ -107546,8 +107551,234 @@ var api = {
|
|
|
107546
107551
|
|
|
107547
107552
|
api.warn = api.warning;
|
|
107548
107553
|
/* harmony default export */ var notification = (api);
|
|
107554
|
+
// EXTERNAL MODULE: ./node_modules/_axios@0.18.0@axios/index.js
|
|
107555
|
+
var _axios_0_18_0_axios = __webpack_require__("7f43");
|
|
107556
|
+
var _axios_0_18_0_axios_default = /*#__PURE__*/__webpack_require__.n(_axios_0_18_0_axios);
|
|
107557
|
+
|
|
107558
|
+
// CONCATENATED MODULE: ./packages/utils/request.js
|
|
107559
|
+
|
|
107560
|
+
|
|
107561
|
+
|
|
107562
|
+
|
|
107563
|
+
|
|
107564
|
+
// create an axios instance
|
|
107565
|
+
const service = _axios_0_18_0_axios_default.a.create({
|
|
107566
|
+
// baseURL: process.env.BASE_API, // api的base_url
|
|
107567
|
+
timeout: 1000 * 60 * 5 // request timeout
|
|
107568
|
+
})
|
|
107569
|
+
// request interceptor
|
|
107570
|
+
service.interceptors.request.use(
|
|
107571
|
+
config => {
|
|
107572
|
+
// Do something before request is sent
|
|
107573
|
+
let tempToken = utils_store.state.token
|
|
107574
|
+
if (tempToken) {
|
|
107575
|
+
config.headers.Authorization = `Bearer ${tempToken}`
|
|
107576
|
+
}
|
|
107577
|
+
// config.headers.Accept = 'application/json,Date, text/plain, */*'
|
|
107578
|
+
return config
|
|
107579
|
+
},
|
|
107580
|
+
error => {
|
|
107581
|
+
// Do something with request error
|
|
107582
|
+
Promise.reject(error)
|
|
107583
|
+
}
|
|
107584
|
+
)
|
|
107585
|
+
|
|
107586
|
+
// respone interceptor
|
|
107587
|
+
service.interceptors.response.use(
|
|
107588
|
+
response => {
|
|
107589
|
+
// store.dispatch(
|
|
107590
|
+
// "setLastRequireTime",
|
|
107591
|
+
// moment().format("YYYY-MM-DD HH:mm:ss")
|
|
107592
|
+
// );
|
|
107593
|
+
|
|
107594
|
+
const res = response.data
|
|
107595
|
+
if (res.status === 200 || res.code === 200) {
|
|
107596
|
+
return response.data
|
|
107597
|
+
}
|
|
107598
|
+
if (res.status === undefined && res.code === undefined) {
|
|
107599
|
+
return response.data
|
|
107600
|
+
}
|
|
107601
|
+
if (res.code === 401) {
|
|
107602
|
+
utils_store.dispatch('logOut')
|
|
107603
|
+
return Promise.reject(res.msg)
|
|
107604
|
+
}
|
|
107605
|
+
notification.error({
|
|
107606
|
+
message: '错误信息',
|
|
107607
|
+
description: h => {
|
|
107608
|
+
return h('div', null, [
|
|
107609
|
+
h('p', { domProps: { innerHTML: res.msg } }, null)
|
|
107610
|
+
])
|
|
107611
|
+
}
|
|
107612
|
+
// description:parseContent.content
|
|
107613
|
+
})
|
|
107614
|
+
|
|
107615
|
+
// notification['error']({ message: '错误信息', description: res.msg })
|
|
107616
|
+
return Promise.reject(res.msg)
|
|
107617
|
+
},
|
|
107618
|
+
error => {
|
|
107619
|
+
if (error.response && error.response.status === 401) {
|
|
107620
|
+
utils_store.dispatch('logOut').then(() => {})
|
|
107621
|
+
return
|
|
107622
|
+
}
|
|
107623
|
+
let errorMsg = ''
|
|
107624
|
+
if (error.response && error.response.data && error.response.data.error) {
|
|
107625
|
+
if (error.response.data.error_description) {
|
|
107626
|
+
errorMsg = error.response.data.error_description
|
|
107627
|
+
} else {
|
|
107628
|
+
errorMsg = error.response.data.error
|
|
107629
|
+
}
|
|
107630
|
+
} else {
|
|
107631
|
+
errorMsg = error.msg
|
|
107632
|
+
}
|
|
107633
|
+
notification['error']({ message: '错误信息', description: errorMsg })
|
|
107634
|
+
return Promise.reject(error)
|
|
107635
|
+
}
|
|
107636
|
+
)
|
|
107637
|
+
|
|
107638
|
+
/* harmony default export */ var utils_request = (service);
|
|
107639
|
+
|
|
107640
|
+
// CONCATENATED MODULE: ./packages/utils/api.js
|
|
107641
|
+
|
|
107642
|
+
|
|
107643
|
+
function loadViewInfo(moduleCode) {
|
|
107644
|
+
return utils_request({
|
|
107645
|
+
url: utils_store.getters.umsUrl + '/v1/module/loadViewInfo',
|
|
107646
|
+
method: 'get',
|
|
107647
|
+
params: {
|
|
107648
|
+
moduleCode: moduleCode
|
|
107649
|
+
}
|
|
107650
|
+
})
|
|
107651
|
+
}
|
|
107652
|
+
function attachGetAttachUrlApi() {
|
|
107653
|
+
return utils_store.getters.msgUrl + '/v1/Attach'
|
|
107654
|
+
}
|
|
107655
|
+
|
|
107656
|
+
/**
|
|
107657
|
+
* 获取cust信息列表
|
|
107658
|
+
* @param postData 提交的数据,分页信息
|
|
107659
|
+
*/
|
|
107660
|
+
function attachSearchApi(postData) {
|
|
107661
|
+
return utils_request({
|
|
107662
|
+
url: utils_store.getters.msgUrl + '/v1/Attach/Search',
|
|
107663
|
+
method: 'post',
|
|
107664
|
+
data: postData
|
|
107665
|
+
})
|
|
107666
|
+
}
|
|
107667
|
+
|
|
107668
|
+
// EXTERNAL MODULE: ./node_modules/_vuex@3.6.2@vuex/dist/vuex.esm.js
|
|
107669
|
+
var vuex_esm = __webpack_require__("7736");
|
|
107670
|
+
|
|
107671
|
+
// CONCATENATED MODULE: ./packages/utils/store.js
|
|
107672
|
+
|
|
107673
|
+
|
|
107674
|
+
|
|
107675
|
+
|
|
107676
|
+
|
|
107677
|
+
external_commonjs_vue_commonjs2_vue_root_Vue_default.a.use(vuex_esm["a" /* default */])
|
|
107678
|
+
|
|
107679
|
+
/* harmony default export */ var utils_store = (new vuex_esm["a" /* default */].Store({
|
|
107680
|
+
state: {
|
|
107681
|
+
umsUrl:'',
|
|
107682
|
+
msgUrl:'',
|
|
107683
|
+
token: '',
|
|
107684
|
+
webAppCode: '',
|
|
107685
|
+
moduleViewInfo: {},
|
|
107686
|
+
controlSize: 'small',
|
|
107687
|
+
newId: 0,//明细新增id
|
|
107688
|
+
},
|
|
107689
|
+
mutations: {
|
|
107690
|
+
SET_TOKEN: (state, token) => {
|
|
107691
|
+
state.token = token
|
|
107692
|
+
},
|
|
107693
|
+
SET_WEB_APP_CODE: (state, webAppCode) => {
|
|
107694
|
+
state.webAppCode = webAppCode
|
|
107695
|
+
},
|
|
107696
|
+
SET_MODULE_VIEW_INFO: (state, data) => {
|
|
107697
|
+
state.moduleViewInfo[data.moduleCode] = data.info
|
|
107698
|
+
},
|
|
107699
|
+
SET_NEW_ID: (state, id) => {
|
|
107700
|
+
state.newId = id
|
|
107701
|
+
},
|
|
107702
|
+
SET_UMS_URL:(state,url) => {
|
|
107703
|
+
state.umsUrl = url
|
|
107704
|
+
},
|
|
107705
|
+
SET_MSG_URL:(state,url) => {
|
|
107706
|
+
state.umsUrl = url
|
|
107707
|
+
}
|
|
107708
|
+
},
|
|
107709
|
+
actions: {
|
|
107710
|
+
setTabTitle({ commit }, tabInfo) {
|
|
107711
|
+
if (tabInfo.replaceQuery) {
|
|
107712
|
+
let newRoutePath =
|
|
107713
|
+
tabInfo.path + '?' + stringUrlQuery(tabInfo.replaceQuery)
|
|
107714
|
+
history.replaceState(null,null,(window.$wujie.props.webAppActiveRule + newRoutePath))
|
|
107715
|
+
let keepAliveComp =
|
|
107716
|
+
tabInfo.rootComp.$children[0].$refs.routerView.$vnode.parent
|
|
107717
|
+
.componentInstance
|
|
107718
|
+
|
|
107719
|
+
for (let cacheKey in keepAliveComp.cache) {
|
|
107720
|
+
if (
|
|
107721
|
+
keepAliveComp.cache[cacheKey].componentInstance._uid ===
|
|
107722
|
+
tabInfo.compUid
|
|
107723
|
+
) {
|
|
107724
|
+
keepAliveComp.cache[newRoutePath] = keepAliveComp.cache[cacheKey]
|
|
107725
|
+
keepAliveComp.keyToCache = newRoutePath
|
|
107726
|
+
XEUtils.remove(keepAliveComp.keys, loopKey => loopKey === cacheKey)
|
|
107727
|
+
delete keepAliveComp.cache[cacheKey]
|
|
107728
|
+
keepAliveComp.keys.push(newRoutePath)
|
|
107729
|
+
break
|
|
107730
|
+
}
|
|
107731
|
+
}
|
|
107732
|
+
}
|
|
107733
|
+
//通知父应用修改Tab标签文字描述
|
|
107734
|
+
window.$wujie.bus.$emit('subAppSetTabTitle', {
|
|
107735
|
+
title: tabInfo.title,
|
|
107736
|
+
name: tabInfo.name,
|
|
107737
|
+
query: tabInfo.query,
|
|
107738
|
+
replaceQuery: tabInfo.replaceQuery,
|
|
107739
|
+
path: tabInfo.path
|
|
107740
|
+
})
|
|
107741
|
+
},
|
|
107742
|
+
closeTab({ commit }, fullPath) {
|
|
107743
|
+
window.$wujie.bus.$emit(
|
|
107744
|
+
'subAppCloseTab',
|
|
107745
|
+
window.$wujie.props.webAppActiveRule + fullPath
|
|
107746
|
+
)
|
|
107747
|
+
},
|
|
107748
|
+
moduleLoadViewInfo({ commit, state }, dataInfo) {
|
|
107749
|
+
let vm = this
|
|
107750
|
+
return new Promise((resolve, reject) => {
|
|
107751
|
+
loadViewInfo(dataInfo.moduleCode)
|
|
107752
|
+
.then(reponseData => {
|
|
107753
|
+
commit('SET_MODULE_VIEW_INFO', {
|
|
107754
|
+
moduleCode: dataInfo.moduleCode,
|
|
107755
|
+
info: reponseData.content
|
|
107756
|
+
})
|
|
107757
|
+
resolve()
|
|
107758
|
+
})
|
|
107759
|
+
.catch(error => {
|
|
107760
|
+
reject(error)
|
|
107761
|
+
})
|
|
107762
|
+
})
|
|
107763
|
+
}
|
|
107764
|
+
},
|
|
107765
|
+
modules:{},
|
|
107766
|
+
getters: {
|
|
107767
|
+
umsUrl:state=>state.umsUrl,
|
|
107768
|
+
msgUrl:state=>state.msgUrl,
|
|
107769
|
+
token: state => state.token,
|
|
107770
|
+
webAppCode: state => state.webAppCode,
|
|
107771
|
+
moduleViewInfo: state => state.moduleViewInfo,
|
|
107772
|
+
controlSize: state => state.controlSize,
|
|
107773
|
+
newId: state => () => {
|
|
107774
|
+
state.newId = state.newId + 1
|
|
107775
|
+
return state.newId
|
|
107776
|
+
}
|
|
107777
|
+
}
|
|
107778
|
+
}));
|
|
107549
107779
|
// CONCATENATED MODULE: ./packages/utils/common.js
|
|
107550
107780
|
|
|
107781
|
+
|
|
107551
107782
|
/**
|
|
107552
107783
|
* 替换掩码参数字符串
|
|
107553
107784
|
* @param {参数字符串} paramString
|
|
@@ -107784,6 +108015,21 @@ function replaceParamString(
|
|
|
107784
108015
|
const gridErrors = await gridView.fullValidate()
|
|
107785
108016
|
return gridErrors
|
|
107786
108017
|
}
|
|
108018
|
+
function successMsg(msg, desc){
|
|
108019
|
+
notification['success']({ message: msg, description: desc })
|
|
108020
|
+
}
|
|
108021
|
+
function warningMsg(msg, desc){
|
|
108022
|
+
notification['warning']({ message: msg, description: desc })
|
|
108023
|
+
}
|
|
108024
|
+
function common_errorMsg(msg, desc){
|
|
108025
|
+
notification['error']({ message: msg, description: desc })
|
|
108026
|
+
}
|
|
108027
|
+
function infoMsg(dataInfo){
|
|
108028
|
+
notification['info'](dataInfo)
|
|
108029
|
+
}
|
|
108030
|
+
function closeMsg(key){
|
|
108031
|
+
notification.close(key)
|
|
108032
|
+
}
|
|
107787
108033
|
function routeBeforeEach(to, from, next){
|
|
107788
108034
|
if(to.params.aliveCacheKey){
|
|
107789
108035
|
to.meta['aliveCacheKey'] = to.params.aliveCacheKey
|
|
@@ -107791,8 +108037,8 @@ function replaceParamString(
|
|
|
107791
108037
|
if(!to.meta.aliveCacheKey){
|
|
107792
108038
|
alert('防呆,子应用没有路由缓存键')
|
|
107793
108039
|
}
|
|
107794
|
-
if (to.meta.moduleCode && !
|
|
107795
|
-
|
|
108040
|
+
if (to.meta.moduleCode && !utils_store.getters.moduleViewInfo[to.meta.moduleCode]) {
|
|
108041
|
+
utils_store
|
|
107796
108042
|
.dispatch('moduleLoadViewInfo', { moduleCode: to.meta.moduleCode })
|
|
107797
108043
|
.then(() => {
|
|
107798
108044
|
next()
|
|
@@ -107804,231 +108050,6 @@ function replaceParamString(
|
|
|
107804
108050
|
next()
|
|
107805
108051
|
}
|
|
107806
108052
|
}
|
|
107807
|
-
// EXTERNAL MODULE: ./node_modules/_axios@0.18.0@axios/index.js
|
|
107808
|
-
var _axios_0_18_0_axios = __webpack_require__("7f43");
|
|
107809
|
-
var _axios_0_18_0_axios_default = /*#__PURE__*/__webpack_require__.n(_axios_0_18_0_axios);
|
|
107810
|
-
|
|
107811
|
-
// CONCATENATED MODULE: ./packages/utils/api.js
|
|
107812
|
-
|
|
107813
|
-
|
|
107814
|
-
function loadViewInfo(moduleCode) {
|
|
107815
|
-
return utils_request({
|
|
107816
|
-
url: utils_store.getters.umsUrl + '/v1/module/loadViewInfo',
|
|
107817
|
-
method: 'get',
|
|
107818
|
-
params: {
|
|
107819
|
-
moduleCode: moduleCode
|
|
107820
|
-
}
|
|
107821
|
-
})
|
|
107822
|
-
}
|
|
107823
|
-
function attachGetAttachUrlApi() {
|
|
107824
|
-
return utils_store.getters.msgUrl + '/v1/Attach'
|
|
107825
|
-
}
|
|
107826
|
-
|
|
107827
|
-
/**
|
|
107828
|
-
* 获取cust信息列表
|
|
107829
|
-
* @param postData 提交的数据,分页信息
|
|
107830
|
-
*/
|
|
107831
|
-
function attachSearchApi(postData) {
|
|
107832
|
-
return utils_request({
|
|
107833
|
-
url: utils_store.getters.msgUrl + '/v1/Attach/Search',
|
|
107834
|
-
method: 'post',
|
|
107835
|
-
data: postData
|
|
107836
|
-
})
|
|
107837
|
-
}
|
|
107838
|
-
|
|
107839
|
-
// EXTERNAL MODULE: ./node_modules/_vuex@3.6.2@vuex/dist/vuex.esm.js
|
|
107840
|
-
var vuex_esm = __webpack_require__("7736");
|
|
107841
|
-
|
|
107842
|
-
// CONCATENATED MODULE: ./packages/utils/store.js
|
|
107843
|
-
|
|
107844
|
-
|
|
107845
|
-
|
|
107846
|
-
|
|
107847
|
-
|
|
107848
|
-
external_commonjs_vue_commonjs2_vue_root_Vue_default.a.use(vuex_esm["a" /* default */])
|
|
107849
|
-
|
|
107850
|
-
/* harmony default export */ var utils_store = (new vuex_esm["a" /* default */].Store({
|
|
107851
|
-
state: {
|
|
107852
|
-
umsUrl:'',
|
|
107853
|
-
msgUrl:'',
|
|
107854
|
-
token: '',
|
|
107855
|
-
webAppCode: '',
|
|
107856
|
-
moduleViewInfo: {},
|
|
107857
|
-
controlSize: 'small',
|
|
107858
|
-
newId: 0,//明细新增id
|
|
107859
|
-
},
|
|
107860
|
-
mutations: {
|
|
107861
|
-
SET_TOKEN: (state, token) => {
|
|
107862
|
-
state.token = token
|
|
107863
|
-
},
|
|
107864
|
-
SET_WEB_APP_CODE: (state, webAppCode) => {
|
|
107865
|
-
state.webAppCode = webAppCode
|
|
107866
|
-
},
|
|
107867
|
-
SET_MODULE_VIEW_INFO: (state, data) => {
|
|
107868
|
-
state.moduleViewInfo[data.moduleCode] = data.info
|
|
107869
|
-
},
|
|
107870
|
-
SET_NEW_ID: (state, id) => {
|
|
107871
|
-
state.newId = id
|
|
107872
|
-
},
|
|
107873
|
-
SET_UMS_URL:(state,url) => {
|
|
107874
|
-
state.umsUrl = url
|
|
107875
|
-
},
|
|
107876
|
-
SET_MSG_URL:(state,url) => {
|
|
107877
|
-
state.umsUrl = url
|
|
107878
|
-
}
|
|
107879
|
-
},
|
|
107880
|
-
actions: {
|
|
107881
|
-
setTabTitle({ commit }, tabInfo) {
|
|
107882
|
-
if (tabInfo.replaceQuery) {
|
|
107883
|
-
let newRoutePath =
|
|
107884
|
-
tabInfo.path + '?' + stringUrlQuery(tabInfo.replaceQuery)
|
|
107885
|
-
history.replaceState(null,null,(window.$wujie.props.webAppActiveRule + newRoutePath))
|
|
107886
|
-
let keepAliveComp =
|
|
107887
|
-
tabInfo.rootComp.$children[0].$refs.routerView.$vnode.parent
|
|
107888
|
-
.componentInstance
|
|
107889
|
-
|
|
107890
|
-
for (let cacheKey in keepAliveComp.cache) {
|
|
107891
|
-
if (
|
|
107892
|
-
keepAliveComp.cache[cacheKey].componentInstance._uid ===
|
|
107893
|
-
tabInfo.compUid
|
|
107894
|
-
) {
|
|
107895
|
-
keepAliveComp.cache[newRoutePath] = keepAliveComp.cache[cacheKey]
|
|
107896
|
-
keepAliveComp.keyToCache = newRoutePath
|
|
107897
|
-
XEUtils.remove(keepAliveComp.keys, loopKey => loopKey === cacheKey)
|
|
107898
|
-
delete keepAliveComp.cache[cacheKey]
|
|
107899
|
-
keepAliveComp.keys.push(newRoutePath)
|
|
107900
|
-
break
|
|
107901
|
-
}
|
|
107902
|
-
}
|
|
107903
|
-
}
|
|
107904
|
-
//通知父应用修改Tab标签文字描述
|
|
107905
|
-
window.$wujie.bus.$emit('subAppSetTabTitle', {
|
|
107906
|
-
title: tabInfo.title,
|
|
107907
|
-
name: tabInfo.name,
|
|
107908
|
-
query: tabInfo.query,
|
|
107909
|
-
replaceQuery: tabInfo.replaceQuery,
|
|
107910
|
-
path: tabInfo.path
|
|
107911
|
-
})
|
|
107912
|
-
},
|
|
107913
|
-
closeTab({ commit }, fullPath) {
|
|
107914
|
-
window.$wujie.bus.$emit(
|
|
107915
|
-
'subAppCloseTab',
|
|
107916
|
-
window.$wujie.props.webAppActiveRule + fullPath
|
|
107917
|
-
)
|
|
107918
|
-
},
|
|
107919
|
-
moduleLoadViewInfo({ commit, state }, dataInfo) {
|
|
107920
|
-
let vm = this
|
|
107921
|
-
return new Promise((resolve, reject) => {
|
|
107922
|
-
loadViewInfo(dataInfo.moduleCode)
|
|
107923
|
-
.then(reponseData => {
|
|
107924
|
-
commit('SET_MODULE_VIEW_INFO', {
|
|
107925
|
-
moduleCode: dataInfo.moduleCode,
|
|
107926
|
-
info: reponseData.content
|
|
107927
|
-
})
|
|
107928
|
-
resolve()
|
|
107929
|
-
})
|
|
107930
|
-
.catch(error => {
|
|
107931
|
-
reject(error)
|
|
107932
|
-
})
|
|
107933
|
-
})
|
|
107934
|
-
}
|
|
107935
|
-
},
|
|
107936
|
-
modules:{},
|
|
107937
|
-
getters: {
|
|
107938
|
-
umsUrl:state=>state.umsUrl,
|
|
107939
|
-
msgUrl:state=>state.msgUrl,
|
|
107940
|
-
token: state => state.token,
|
|
107941
|
-
webAppCode: state => state.webAppCode,
|
|
107942
|
-
moduleViewInfo: state => state.moduleViewInfo,
|
|
107943
|
-
controlSize: state => state.controlSize,
|
|
107944
|
-
newId: state => () => {
|
|
107945
|
-
state.newId = state.newId + 1
|
|
107946
|
-
return state.newId
|
|
107947
|
-
}
|
|
107948
|
-
}
|
|
107949
|
-
}));
|
|
107950
|
-
// CONCATENATED MODULE: ./packages/utils/request.js
|
|
107951
|
-
|
|
107952
|
-
|
|
107953
|
-
|
|
107954
|
-
|
|
107955
|
-
|
|
107956
|
-
// create an axios instance
|
|
107957
|
-
const service = _axios_0_18_0_axios_default.a.create({
|
|
107958
|
-
// baseURL: process.env.BASE_API, // api的base_url
|
|
107959
|
-
timeout: 1000 * 60 * 5 // request timeout
|
|
107960
|
-
})
|
|
107961
|
-
// request interceptor
|
|
107962
|
-
service.interceptors.request.use(
|
|
107963
|
-
config => {
|
|
107964
|
-
// Do something before request is sent
|
|
107965
|
-
let tempToken = utils_store.state.token
|
|
107966
|
-
if (tempToken) {
|
|
107967
|
-
config.headers.Authorization = `Bearer ${tempToken}`
|
|
107968
|
-
}
|
|
107969
|
-
// config.headers.Accept = 'application/json,Date, text/plain, */*'
|
|
107970
|
-
return config
|
|
107971
|
-
},
|
|
107972
|
-
error => {
|
|
107973
|
-
// Do something with request error
|
|
107974
|
-
Promise.reject(error)
|
|
107975
|
-
}
|
|
107976
|
-
)
|
|
107977
|
-
|
|
107978
|
-
// respone interceptor
|
|
107979
|
-
service.interceptors.response.use(
|
|
107980
|
-
response => {
|
|
107981
|
-
// store.dispatch(
|
|
107982
|
-
// "setLastRequireTime",
|
|
107983
|
-
// moment().format("YYYY-MM-DD HH:mm:ss")
|
|
107984
|
-
// );
|
|
107985
|
-
|
|
107986
|
-
const res = response.data
|
|
107987
|
-
if (res.status === 200 || res.code === 200) {
|
|
107988
|
-
return response.data
|
|
107989
|
-
}
|
|
107990
|
-
if (res.status === undefined && res.code === undefined) {
|
|
107991
|
-
return response.data
|
|
107992
|
-
}
|
|
107993
|
-
if (res.code === 401) {
|
|
107994
|
-
utils_store.dispatch('logOut')
|
|
107995
|
-
return Promise.reject(res.msg)
|
|
107996
|
-
}
|
|
107997
|
-
notification.error({
|
|
107998
|
-
message: '错误信息',
|
|
107999
|
-
description: h => {
|
|
108000
|
-
return h('div', null, [
|
|
108001
|
-
h('p', { domProps: { innerHTML: res.msg } }, null)
|
|
108002
|
-
])
|
|
108003
|
-
}
|
|
108004
|
-
// description:parseContent.content
|
|
108005
|
-
})
|
|
108006
|
-
|
|
108007
|
-
// notification['error']({ message: '错误信息', description: res.msg })
|
|
108008
|
-
return Promise.reject(res.msg)
|
|
108009
|
-
},
|
|
108010
|
-
error => {
|
|
108011
|
-
if (error.response && error.response.status === 401) {
|
|
108012
|
-
utils_store.dispatch('logOut').then(() => {})
|
|
108013
|
-
return
|
|
108014
|
-
}
|
|
108015
|
-
let errorMsg = ''
|
|
108016
|
-
if (error.response && error.response.data && error.response.data.error) {
|
|
108017
|
-
if (error.response.data.error_description) {
|
|
108018
|
-
errorMsg = error.response.data.error_description
|
|
108019
|
-
} else {
|
|
108020
|
-
errorMsg = error.response.data.error
|
|
108021
|
-
}
|
|
108022
|
-
} else {
|
|
108023
|
-
errorMsg = error.msg
|
|
108024
|
-
}
|
|
108025
|
-
notification['error']({ message: '错误信息', description: errorMsg })
|
|
108026
|
-
return Promise.reject(error)
|
|
108027
|
-
}
|
|
108028
|
-
)
|
|
108029
|
-
|
|
108030
|
-
/* harmony default export */ var utils_request = (service);
|
|
108031
|
-
|
|
108032
108053
|
// CONCATENATED MODULE: ./node_modules/_ant-design-vue@1.7.8@ant-design-vue/es/_util/responsiveObserve.js
|
|
108033
108054
|
|
|
108034
108055
|
|