client: add 429 handler

pull/60/head
fantasticit 2022-05-26 13:35:21 +08:00
parent add3f93ebe
commit fbfc00ddd1
1 changed files with 3 additions and 1 deletions

View File

@ -61,7 +61,9 @@ HttpClient.interceptors.response.use(
Router.replace(`/login?redirect=${window.location.pathname}`); Router.replace(`/login?redirect=${window.location.pathname}`);
} }
break; break;
case 429:
Toast.error('请求过于频繁,请稍候再试!');
break;
default: default:
isBrowser && Toast.error((err.response && err.response.data && err.response.data.message) || '未知错误!'); isBrowser && Toast.error((err.response && err.response.data && err.response.data.message) || '未知错误!');
} }