修改角色管理
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user