Merge pull request 'master' (#57) from master into prod

Reviewed-on: http://git.feashow.cn/clay/mosr-web/pulls/57
This commit is contained in:
wenhua
2024-03-29 07:47:14 +00:00
2 changed files with 32 additions and 8 deletions

View File

@@ -49,7 +49,7 @@ import { isVNode } from 'vue'
if(column && column?.formatter) {
return column.formatter(row, column, value, $index) || '--'
}
return value ? value.toString() : '--'
return value !== null && value !== undefined ? value.toString() : '--'
}
</script>

View File

@@ -1,6 +1,6 @@
import axios from "axios";
import { AxiosCanceler } from "./axiosCanceler";
import { ElMessage, ElMessageBox } from "element-plus";
import { ElMessageBox, ElNotification } from "element-plus";
import { getToken, removeToken } from "./auth";
axios.defaults.headers['Content-Type']='application/json'
@@ -48,21 +48,45 @@ serveice.interceptors.response.use(response=>{
case 402:
break;
case 403:
ElMessage.warning('禁止访问')
removeToken()
window.location = '/forbidden'
console.log(response)
ElNotification({
title: '系统提示',
message: response.data.msg,
type: 'warning'
})
break;
case 404:
ElMessage.warning('不存在的地址')
ElNotification({
title: '系统提示',
message: '不存在的地址',
type: 'error'
})
break;
case 405:
ElMessage.warning('传输格式错误,请检查')
ElNotification({
title: '系统提示',
message: '传输格式错误,请检查',
type: 'error'
})
break;
case 511:
ElNotification({
title: '系统提示',
message: '禁止访问',
type: 'error'
})
removeToken()
window.location = '/forbidden'
break;
case 500:
if (response.data){
return response.data
}else {
ElMessage.error('系统未知错误')
ElNotification({
title: '系统提示',
message: '系统未知错误',
type: 'error'
})
break;
}
}