修改提示语

This commit is contained in:
qq787203167
2022-06-08 16:15:43 +08:00
parent fab8e90537
commit c7b162c90d
5 changed files with 10 additions and 8 deletions
+1
View File
@@ -153,6 +153,7 @@ export function downloadFile(url, fileName, parameter, callback) {
isTrue: isTrue isTrue: isTrue
}) })
return downFile(url, parameter).then((data) => { return downFile(url, parameter).then((data) => {
console.log(data)
if (!data || data.size === 0) { if (!data || data.size === 0) {
Vue.prototype['$message'].warning('文件下载失败') Vue.prototype['$message'].warning('文件下载失败')
return return
+4 -3
View File
@@ -40,7 +40,7 @@ const err = (error) => {
} }
// update-end- --- author:liusq ------ date:20200910 ---- for:处理Blob情况---- // update-end- --- author:liusq ------ date:20200910 ---- for:处理Blob情况----
//notification.error({ message: '系统提示', description:'Token失效,请重新登录!',duration: 4}) //notification.error({ message: '系统提示', description:'Token失效,请重新登录!',duration: 4})
if (token && data.message.includes('Token失效')) { if ((token && data.message.includes('Token失效')) || (token && data.message.includes('token非法无效'))) {
// update-begin- --- author:scott ------ date:20190225 ---- for:Token失效采用弹框模式,不直接跳转---- // update-begin- --- author:scott ------ date:20190225 ---- for:Token失效采用弹框模式,不直接跳转----
Modal.error({ Modal.error({
title: '登录已过期', title: '登录已过期',
@@ -72,7 +72,7 @@ const err = (error) => {
notification.error({ message: '系统提示', description: '网络超时' }) notification.error({ message: '系统提示', description: '网络超时' })
break break
case 401: case 401:
if (token && data.message.includes('Token失效')) { if ((token && data.message.includes('Token失效')) || (token && data.message.includes('token非法无效'))) {
Modal.error({ Modal.error({
title: '登录已过期', title: '登录已过期',
content: '很抱歉,登录已过期,请重新登录', content: '很抱歉,登录已过期,请重新登录',
@@ -156,6 +156,7 @@ service.interceptors.request.use(config => {
// response interceptor // response interceptor
service.interceptors.response.use((response) => { service.interceptors.response.use((response) => {
console.log(response)
if ((response.data.code == 401 && response.data.message.includes('token')) || (response.data.code == 401 && response.data.message.includes('Token'))) { if ((response.data.code == 401 && response.data.message.includes('token')) || (response.data.code == 401 && response.data.message.includes('Token'))) {
Modal.error({ Modal.error({
title: '登录已过期', title: '登录已过期',
@@ -199,7 +200,7 @@ function blobToJson(data) {
try { try {
let jsonData = JSON.parse(this.result) // 说明是普通对象数据,后台转换失败 let jsonData = JSON.parse(this.result) // 说明是普通对象数据,后台转换失败
if (jsonData.status === 500) { if (jsonData.status === 500) {
if (token && jsonData.message.includes('Token失效')) { if ((token && jsonData.message.includes('Token失效')) || (token && jsonData.message.includes('token非法无效'))) {
Modal.error({ Modal.error({
title: '登录已过期', title: '登录已过期',
content: '很抱歉,登录已过期,请重新登录', content: '很抱歉,登录已过期,请重新登录',
@@ -223,7 +223,7 @@
this.confirmLoading = false this.confirmLoading = false
this.$emit('batSettingList') this.$emit('batSettingList')
} else { } else {
this.$message.warning(this.$t('operationFailed')) this.$message.warning(res.message)
this.confirmLoading = false this.confirmLoading = false
} }
}) })
@@ -718,7 +718,7 @@
this.confirmLoading = false this.confirmLoading = false
this.$emit('editModelList') this.$emit('editModelList')
} else { } else {
this.$message.warning(this.$t('operationFailed')) this.$message.warning(res.message)
this.confirmLoading = false this.confirmLoading = false
} }
}) })
@@ -646,7 +646,7 @@
_this.selectedRowKeys = [] _this.selectedRowKeys = []
_this.getList() _this.getList()
} else { } else {
_this.$message.warning(_this.$t('operationFailed')) _this.$message.warning(res.message)
} }
}) })
} }
@@ -706,7 +706,7 @@
_this.selectedRowKeys = [] _this.selectedRowKeys = []
_this.getList() _this.getList()
} else { } else {
_this.$message.warning(_this.$t('operationFailed')) _this.$message.warning(res.message)
} }
}) })
} }
@@ -731,7 +731,7 @@
_this.$message.success(_this.$t('OperationSuccessful')) _this.$message.success(_this.$t('OperationSuccessful'))
_this.getList() _this.getList()
} else { } else {
_this.$message.warning(_this.$t('operationFailed')) _this.$message.warning(res.message)
} }
}) })
} }