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