|
@@ -77,10 +77,7 @@ service.postRequest = function postRequest(basePath, srvName, funcName, data) {
|
|
|
var base_Path = ''
|
|
var base_Path = ''
|
|
|
if (basePath == process.env.VUE_APP_FOSHAN_PATH) {
|
|
if (basePath == process.env.VUE_APP_FOSHAN_PATH) {
|
|
|
base_Path = process.env.VUE_APP_MicroSrvProxy_foshan_API + basePath
|
|
base_Path = process.env.VUE_APP_MicroSrvProxy_foshan_API + basePath
|
|
|
- } else if (
|
|
|
|
|
- basePath == process.env.VUE_APP_AdminPath ||
|
|
|
|
|
- process.env.VUE_APP_ParentPath
|
|
|
|
|
- ) {
|
|
|
|
|
|
|
+ } else if (basePath == process.env.VUE_APP_AdminPath || process.env.VUE_APP_ParentPath) {
|
|
|
base_Path = process.env.VUE_APP_MicroSrvProxy_API + basePath
|
|
base_Path = process.env.VUE_APP_MicroSrvProxy_API + basePath
|
|
|
} else {
|
|
} else {
|
|
|
base_Path = process.env.VUE_APP_MicroSrvProxy_API + basePath
|
|
base_Path = process.env.VUE_APP_MicroSrvProxy_API + basePath
|
|
@@ -99,12 +96,7 @@ service.postRequest = function postRequest(basePath, srvName, funcName, data) {
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
|
// 发出请求并要求把客户端信息传输给后端(IP和User-Agent)
|
|
// 发出请求并要求把客户端信息传输给后端(IP和User-Agent)
|
|
|
-service.postRequestWithClientInfo = function postRequest(
|
|
|
|
|
- basePath,
|
|
|
|
|
- srvName,
|
|
|
|
|
- funcName,
|
|
|
|
|
- data
|
|
|
|
|
-) {
|
|
|
|
|
|
|
+service.postRequestWithClientInfo = function postRequest(basePath, srvName, funcName, data) {
|
|
|
if (data == undefined) {
|
|
if (data == undefined) {
|
|
|
let nullParam = { nullparam: 0 }
|
|
let nullParam = { nullparam: 0 }
|
|
|
data = nullParam
|
|
data = nullParam
|
|
@@ -124,12 +116,7 @@ service.postRequestWithClientInfo = function postRequest(
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// Excel文件下载(服务端生成文件流)
|
|
// Excel文件下载(服务端生成文件流)
|
|
|
-service.downloadExcel = function downloadExcel(
|
|
|
|
|
- basePath,
|
|
|
|
|
- srvName,
|
|
|
|
|
- funcName,
|
|
|
|
|
- data
|
|
|
|
|
-) {
|
|
|
|
|
|
|
+service.downloadExcel = function downloadExcel(basePath, srvName, funcName, data) {
|
|
|
if (data == undefined) {
|
|
if (data == undefined) {
|
|
|
let nullParam = {
|
|
let nullParam = {
|
|
|
nullparam: 0,
|
|
nullparam: 0,
|
|
@@ -137,9 +124,9 @@ service.downloadExcel = function downloadExcel(
|
|
|
data = nullParam
|
|
data = nullParam
|
|
|
}
|
|
}
|
|
|
var base_Path = ''
|
|
var base_Path = ''
|
|
|
- if (basePath == process.env.VUE_APP_FOSHAN_PATH) {
|
|
|
|
|
- base_Path = process.env.VUE_APP_MicroSrvProxy_foshan_API + basePath
|
|
|
|
|
- } else if (basePath == process.env.VUE_APP_AdminPath) {
|
|
|
|
|
|
|
+ if (basePath == process.env.VUE_APP_AdminPath) {
|
|
|
|
|
+ base_Path = process.env.VUE_APP_MicroSrvProxy_API + basePath
|
|
|
|
|
+ } else if (basePath == process.env.VUE_APP_ParentPath) {
|
|
|
base_Path = process.env.VUE_APP_MicroSrvProxy_API + basePath
|
|
base_Path = process.env.VUE_APP_MicroSrvProxy_API + basePath
|
|
|
}
|
|
}
|
|
|
service.request({
|
|
service.request({
|
|
@@ -162,15 +149,11 @@ function processResponse(res) {
|
|
|
// 获取错误信息
|
|
// 获取错误信息
|
|
|
const message = errorCode[code] || res.data.msg || errorCode['default']
|
|
const message = errorCode[code] || res.data.msg || errorCode['default']
|
|
|
if (code === 401) {
|
|
if (code === 401) {
|
|
|
- MessageBox.confirm(
|
|
|
|
|
- '登录状态已过期,您可以继续留在该页面,或者重新登录',
|
|
|
|
|
- '系统提示',
|
|
|
|
|
- {
|
|
|
|
|
- confirmButtonText: '重新登录',
|
|
|
|
|
- cancelButtonText: '取消',
|
|
|
|
|
- type: 'warning',
|
|
|
|
|
- }
|
|
|
|
|
- ).then(() => {
|
|
|
|
|
|
|
+ MessageBox.confirm('登录状态已过期,您可以继续留在该页面,或者重新登录', '系统提示', {
|
|
|
|
|
+ confirmButtonText: '重新登录',
|
|
|
|
|
+ cancelButtonText: '取消',
|
|
|
|
|
+ type: 'warning',
|
|
|
|
|
+ }).then(() => {
|
|
|
store.dispatch('user/logout').then(() => {
|
|
store.dispatch('user/logout').then(() => {
|
|
|
if (process.env.SSO_LOGIN) {
|
|
if (process.env.SSO_LOGIN) {
|
|
|
sessionStorage.removeItem('SSO_Token')
|
|
sessionStorage.removeItem('SSO_Token')
|
|
@@ -212,9 +195,7 @@ function downLoadBlobFile(res, mimeType) {
|
|
|
})
|
|
})
|
|
|
// //从response的headers中获取filename, 后端response.setHeader('Content-disposition', 'attachment filename=xxxx.docx') 设置的文件名
|
|
// //从response的headers中获取filename, 后端response.setHeader('Content-disposition', 'attachment filename=xxxx.docx') 设置的文件名
|
|
|
var patt = new RegExp('filename=([^]+\\.[^\\.]+)*')
|
|
var patt = new RegExp('filename=([^]+\\.[^\\.]+)*')
|
|
|
- var contentDisposition = decodeURI(
|
|
|
|
|
- res.headers['content-disposition'] || res.headers['Content-Disposition']
|
|
|
|
|
- )
|
|
|
|
|
|
|
+ var contentDisposition = decodeURI(res.headers['content-disposition'] || res.headers['Content-Disposition'])
|
|
|
var result = patt.exec(contentDisposition)
|
|
var result = patt.exec(contentDisposition)
|
|
|
var fileName = 'data.xlsx'
|
|
var fileName = 'data.xlsx'
|
|
|
if (result != undefined) {
|
|
if (result != undefined) {
|