16

我正在使用nuxt-i18n@nuxtjs/auth,我想像这样配置auth.redirect支持 i18n 的选项:

// nuxt.config.js

export default {
  modules: [
    '@nuxtjs/auth',
    'nuxt-i18n',
    // ...
  ],
  auth: {
    redirect: {
      home: localePath('/dashboard'),
      // ...
    },
  },
  // ...
};

通常,就像this.$store,我可以localePath通过应用程序实例context类似this.$localePathapp.localePath. 但是如何在nuxt.config.js文件里面使用它呢?

4

1 回答 1

1

如果 @nuxt/auth 模块存在 i18n 重定向支持问题,我找到了一种解决方法:https ://github.com/nuxt-community/auth-module/issues/1116#issuecomment-824814739 。

信用@azrikahar

于 2021-05-19T04:05:05.157 回答