Token fails in umijs, how to redirect to the home page

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

?
Mar.30,2021

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.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b2bd18-2bad7.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b2bd18-2bad7.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?