Vue微信ライセンスcode情報取得


シーン:Vue微信商城ページ機能需要:フロントエンド要求code
微信のバックグラウンドの関連する設定はすべてバックグラウンドの同僚がappidとipの白いリストを設置したのです
Vue main.jsはルーティングブロック判定を設定し、authorにログインしなかった.vueページの承認
router.beforeEach((to, from, next) => {
    let code = () => {
        //      code  
        return window.sessionStorage.getItem("weCode")
    }
    
    if(!code){
        if (to.path !== '/author') {
            //       ,    code   
            window.localStorage.setItem('authUrl', to.fullPath)
            next("/author")
            return false
        }
    }
    
    next()
})


author.vue