查看“︁Node.js/nuxt/路由”︁的源代码
来自康健生活
←
Node.js/nuxt/路由
因为以下原因,您没有权限编辑该页面:
您请求的操作仅限属于该用户组的用户执行:
用户
您可以查看和复制此页面的源代码。
== router.beforeEach == 刷新白屏 == 组件独享守卫 == 刷新白屏 == middleware == 在需要鉴权的页面添加配置项: <code>middleware: 'auth'</code>, <syntaxhighlight lang="javascript"> export default function ({ store, redirect }) { // If the user is not authenticated if (!store.state.authenticated) { return redirect('/login') } }</syntaxhighlight> <syntaxhighlight lang="javascript"> export default function ({ $axios, redirect }) { $axios.onRequest(config => { console.log('Making request to ' + config.url) }) $axios.onError(error => { const code = parseInt(error.response && error.response.status) if (code === 400) { redirect('/400') } }) }</syntaxhighlight>
返回
Node.js/nuxt/路由
。
导航菜单
康健生活
搜索
user-page
通知
user-interface-preferences
个人工具
登录
五一
多读书,多运动,多到远处走走,再看看不一样的世界。