0

在此处输入图像描述

我正在尝试使用发送标头获取配置文件,但loggedIn 未设置标头。

nuxt.config.js

auth: {
    strategies: {
      local: {
        endpoints: {
          login: {
            url: 'auth/login',
            method: 'post',
            propertyName: 'result.access_token',
          },
          user: { url: 'auth/profile', method: 'get', propertyName: false },
          logout: false,
        },
      },
      tokenRequired: true,
      tokenType: 'Bearer',
    },

    redirect: {
      login: '/login',
    },
  },

从后端返回令牌

{"code":200,"status":"success","result":[{"access_token":"<JWT_TOKEN>","statusCode":201}]}
4

0 回答 0