bug调整

This commit is contained in:
Double-_-Z 2024-12-26 21:46:34 +08:00
parent 6f45facc1b
commit e6cbf356e6
2 changed files with 5 additions and 7 deletions

View File

@ -40,14 +40,15 @@ service.interceptors.response.use(
// `token` 过期或者账号已在别处登录
if (res.code === 401 || res.code === 4001 || (res.code === 502 && res.errorMsg==='只有登录成功后才可访问')) {
// ElMessage.error('该账户已在其它地方登录,请重新登录');
ElMessageBox.alert('你已被登出,请重新登录', '提示', {})
.then(() => {
Session.clear(); // 清除浏览器全部临时缓存
window.location.href = '/'; // 去登录页
window.location.href = import.meta.env.MODE === "development" ? '/' : '/pixelAdmin/'; // 去登录页
})
.catch(() => {
Session.clear(); // 清除浏览器全部临时缓存
window.location.href = '/'; // 去登录页
window.location.href = import.meta.env.MODE === "development" ? '/' : '/pixelAdmin/'; // 去登录页
});
}
// else if(res.code === 502 && res.errorMsg){

View File

@ -328,8 +328,7 @@ const jpgFormatter = (row: any) => {
// } else {
// newPath = row.path.replaceAll('\\\\', '/')
// }
newPath = newPath.includes(viteUrl)||newPath.includes('http://8.138.171.103/')||newPath.includes('http://guojunjie.oss-cn-hangzhou.aliyuncs.com/') ?
newPath : encodeURI(newPath)
newPath = newPath.includes('://')?newPath : encodeURI(newPath);
return `${newPath}`;
}
@ -470,7 +469,6 @@ const handleRemove = (file: UploadFile, uploadFiles) => {
uploadDisabled.value = false;
};
//
const download = async(row:any) =>{
state.formData.loading = true;
@ -482,8 +480,7 @@ const download = async(row:any) =>{
// }
// newPath = newPath.includes('http://localhost:8888/') ? newPath : viteUrl + newPath
let newPath = row?.data ? row.data.path : row.path;
newPath = newPath.includes(viteUrl)||newPath.includes('http://8.138.171.103/')||newPath.includes('http://guojunjie.oss-cn-hangzhou.aliyuncs.com/') ?
newPath : encodeURI(newPath);
newPath = newPath.includes('://')?newPath : encodeURI(newPath);
try{
await downloadPhoto(newPath);
}catch(error){