修改角色管理

This commit is contained in:
龙运模
2024-07-16 18:34:49 +08:00
parent 6dd9d35ce3
commit 196d8cbb91
14 changed files with 495 additions and 151 deletions
+6 -1
View File
@@ -33,6 +33,8 @@ let MessageBox_401_show = false
// HTTP response 拦截器
axios.interceptors.response.use(
(response) => {
// const contentDisposition = response.headers['Content-Disposition'];
// console.log(response,677)
const token = response.headers.authorization;
if (token) {
let reToken = token.replace(/Bearer /g, "");
@@ -69,7 +71,10 @@ axios.interceptors.response.use(
message: response.data.msg || "Status:500,服务器发生错误!",
});
} else if (api_code === 0 || api_code !== 200) {
ElMessage.warning(response.data.message);
const contentType = response.headers.get('Content-Type');
if(contentType.includes('application/json')){
ElMessage.warning(response.data.message);
}
}
return response;
+15
View File
@@ -306,4 +306,19 @@ tool.getParameterByName = function(name, url) {
return decodedValue;
}
tool.isBinaryString = function (str){
return /[^\t\n\r\x20-\x7E]/.test(str);
}
tool.isBinaryFile = function (file) {
const reader = new FileReader();
return new Promise((resolve) => {
reader.onloadend = () => {
const binaryString = reader.result;
resolve(tool.isBinaryString(binaryString));
};
reader.readAsBinaryString(file.slice(0, 1024));
});
}
export default tool