asyncasyncData({isDev,route,store,env,params,query,req,res,redirect,error,$api},callback){callback({statusCode:404,//页面错误状态,比如502、404等,在error页面进行配置message:"This page could not be found",//错误提示path:"/path"//具体的页面信息},{具体的data中的字段,关系到渲染前的服务端渲染...
error_404:'This page could not be found', server_error:'Server error', nuxtjs:'Nuxt', back_to_home:'Back to the home page', server_error_details:'An error occurred in the application and your page could not be served. If you are the application owner, check your logs for details.'...
error_404: 'This page could not be found', server_error: 'Server error', nuxtjs: 'Nuxt', back_to_home: 'Back to the home page', server_error_details: 'An error occurred in the application and your page could not be served. If you are the application owner, check your logs for d...
中间件可以在page层面配置,也可以全局配置,参考官方的例子: pages/secret.vue <template>Secret page</template>exportdefault{middleware:'authenticated'} AI代码助手复制代码 middleware/authenticated.js exportdefaultfunction({ store, redirect }) {// If the user is not authenticatedif(!store.state.authenticated...
defaultLocale=app.i18n.fallbackLocale//If middleware is called from hot module replacement, ignore itif(isHMR)return//Get locale from paramsconst locale = params.lang ||defaultLocaleif(store.state.locales.indexOf(locale) === -1) {returnerror({ message: 'This page could not be found.', ...
return error({ message: 'This page could not be found.', statusCode: 404 }) } // Set locale store.commit('SET_LANG', locale) app.i18n.locale = store.state.locale // If route is /<defaultLocale>/... -> redirect to /... if (locale === defaultLocale && route.fullPath.indexOf...
store.state.locales.includes(locale)){returnerror({message:'This page could not be found.',statusCode:404})}// Set localestore.commit('SET_LANG',locale)app.i18n.locale=store.state.locale// If route is /<defaultLocale>/... -> redirect to /...if(locale===defaultLocale&&route.fullPath...
ERROR Error generating route "/licences/GPL/3.0/LICENSE": This page could not be found 17:16:41 ERROR Error generating route "/licences/GPL/2.0/LICENSE": This page could not be found 如上所示,在static目录下放了/licences/GPL/2.0/LICENSE文件,使用的href来打开,但是打包时会报错,要怎么解决?
Versions nuxt: v2.14.6 node: v12.14.0 terminal Generated route "/" 15:06:51 ✔ Generated route "/news" 15:06:51 ERROR Error generating route "/about": This page could not be found 15:06:51 ✔ Client-side fallback created: 200.html 15:06:51...
context.nuxt.error = context.error({ statusCode: 404, message: 'This page could not be found' }) }if (asyncDatas.length) debug('Data fetching ' + context.url + ': ' + (Date.now() - s) + 'ms')// datas are the first row of eachcontext.nuxt.data = asyncDatas.map(r => r...