diff --git a/src/fvcomponents/fvTableColumn/index.vue b/src/fvcomponents/fvTableColumn/index.vue index 243a370..c57c4cf 100644 --- a/src/fvcomponents/fvTableColumn/index.vue +++ b/src/fvcomponents/fvTableColumn/index.vue @@ -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() : '--' } diff --git a/src/utils/request.js b/src/utils/request.js index 842e7e2..a1d99e7 100644 --- a/src/utils/request.js +++ b/src/utils/request.js @@ -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; } }