feat : 403 权限校验

This commit is contained in:
clay
2024-03-29 15:20:52 +08:00
parent c88be616fc
commit 2ad0dbf8ab

View File

@@ -48,9 +48,8 @@ serveice.interceptors.response.use(response=>{
case 402: case 402:
break; break;
case 403: case 403:
ElMessage.warning('禁止访问') console.log(response)
removeToken() ElMessage.warning(response.data.msg)
window.location = '/forbidden'
break; break;
case 404: case 404:
ElMessage.warning('不存在的地址') ElMessage.warning('不存在的地址')
@@ -58,6 +57,11 @@ serveice.interceptors.response.use(response=>{
case 405: case 405:
ElMessage.warning('传输格式错误,请检查') ElMessage.warning('传输格式错误,请检查')
break; break;
case 511:
ElMessage.warning('禁止访问')
removeToken()
window.location = '/forbidden'
break;
case 500: case 500:
if (response.data){ if (response.data){
return response.data return response.data