app.tsx 367 B

123456789101112131415
  1. // export function onRouteChange({ matchedRoutes }) {
  2. // console.log('222')
  3. // }
  4. import { apiGetRoles } from './services/user'
  5. import { setAuthority } from './utils/authority'
  6. export function render(oldRender) {
  7. if (window.location.pathname !== '/user/login') {
  8. apiGetRoles().then(value => {
  9. setAuthority(value?.data || [])
  10. })
  11. }
  12. oldRender()
  13. }