umijs generates routes by file, which is really convenient. Now, after logging in, if token fails, how do you monitor the failure of token? the main reason is that you can"t find an opportunity to do this. Are there any bosses using umijs
?umijs generates routes by file, which is really convenient. Now, after logging in, if token fails, how do you monitor the failure of token? the main reason is that you can"t find an opportunity to do this. Are there any bosses using umijs
? token
is invalid and can be judged by the server.
then return a status
with invalid status, and you can handle it uniformly in fetch
for example: the server returns 455
fetch(url).then(respones => {
if(respones.status === 455) {
throw new Error('455');
}
}).then(/**/)
then use the onError
hook in index.js
to get the exception and go directly to dispatch
to your unauthorized page.
Previous: About echarts displaying maps of some provinces in China
Next: To do a logistics platform website involving regional switching there is no design idea to solve?
for projects done with the ant design pro framework, there is a requirement that when a month is selected, all Sundays of the month are automatically generated and displayed. ...
you can see from the picture that the request header and response header are normal! doesn t see anything wrong, but there is no value in the browser s cookie ! is there something wrong with it? Note: ordinary html+js can be set, but applicatio...
use frames umi+dva+antd question after sending a action using server sorting. The order order of the first sort is descend , and then it has been descend no matter how much you click to switch . troubleshooting process looked at the sour...