nuxt.config.js
module.exports = {
auth: {
plugins: [ '~/plugins/auth.js' ],
strategies: {
local: {
endpoints: {
login: {
url: '/xapi/auth/login',
method: 'post',
propertyName: 'token.accessToken'
},
logout: {
url: '/xapi/auth/logout',
method: 'post'
},
user: {
url: '/xapi/auth/user',
method: 'get',
propertyName: 'user'
}
}
}
},
},
i18n: {
baseUrl: '',
defaultLocale: 'en',
detectBrowserLanguage: {
useCookie: true,
cookieKey: 'i18n_redirected',
onlyOnRoot: true
},
langDir: 'locales/',
lazy: true,
locales: [
{
code: 'en',
file: 'en.js',
iso: 'en-US',
name: 'English'
},
如果我在策略>本地>终结点中使用一些不带“ api”的网址,例如“ xapi / auth / login”,则该网址将以当前语言前缀“ / en / xapi / auth / login”完成,但是如果url是'api',那么在浏览器控制台中,我会看到类似'/ api / auth / login'的url,没有语言前缀。
如何使其正常工作,而不要使用“ xapi”或选择其他路径