<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ??碼云GVP開源項目 12k star Uniapp+ElementUI 功能強大 支持多語言、二開方便! 廣告
                ## 設置路由攔截 ### 集成`nprogress` ```shell $ yarn add nprogress ``` ### 新建文件`/src/permission.js` ```javascript import router from './router' import store from './store' import storage from 'store' import Nprogress from 'nprogress' import 'nprogress/nprogress.css' import {ACCESS_TOKEN} from './store/mutation-types' Nprogress.configure({showSpinner: false}) // 登錄頁面路由路徑 const loginRouterPath = '/login' // 白名單 const whiteList = [loginRouterPath] // 默認路由路徑 const defaultRouterPath = '/' router.beforeEach((to, from, next) => { Nprogress.start() // 如有token if (storage.get(ACCESS_TOKEN)) { // 已經登錄,重復訪問登錄頁面,跳轉到默認頁面 if (to.path === loginRouterPath) { next({path: defaultRouterPath}) }else{ next() } }else{ if(whiteList.includes(to.path)){ // 在免登錄白名單中,可以直接進入 next() }else{ next({path:loginRouterPath, query:{redirect:to.fullPath}}) } } }) router.afterEach(()=>{ Nprogress.done() }) ``` ### 在`/src/main.js`中引入`permission` ```javascript ... import './permission' ... ```
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看