Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/asp.net-core/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Asp.net core @nuxtjs/auth login方法在完成时调用用户方法_Asp.net Core_Nuxt.js - Fatal编程技术网

Asp.net core @nuxtjs/auth login方法在完成时调用用户方法

Asp.net core @nuxtjs/auth login方法在完成时调用用户方法,asp.net-core,nuxt.js,Asp.net Core,Nuxt.js,我使用nuxtjs/auth模块对用户进行身份验证,后端写在.NETCore中 在配置nuxtjs/auth包时,我将以下内容添加到nuxt.config.js //nuxt.config.js . . auth: { strategies: { local: { endpoints: { login: { url: 'users/authenticate', method: 'post', propertyName: 'da

我使用nuxtjs/auth模块对用户进行身份验证,后端写在.NETCore中

在配置nuxtjs/auth包时,我将以下内容添加到
nuxt.config.js

//nuxt.config.js
  .
  .

  auth: {
    strategies: {
      local: {
        endpoints: {
          login: { url: 'users/authenticate', method: 'post', propertyName: 'data.token' },
        }
      }
    }
  },

  .
  .
单击“登录”时调用的登录函数如下所示

  async login () {
    try {
      await this.$auth.loginWith('local', {
        data: {
          Username: this.username,
          Password: this.password
        }
      })

      this.$router.push('/')
    } catch (e) {
      console.log(e) <-------------------
      this.error = e.response.data.message
    }
  }
在控制台中,我还可以看到

GET https://example.com/api/api/auth/user 404 (Not Found)
因此,在完成初始身份验证请求后,nuxtjs/auth模块似乎会在API中调用“user”。 我的后端是用netcore编写的

所以我的问题是,我是否应该在netcore后端编写,因为nuxtjs/api包的文档似乎没有解释模块的基本用法是如何工作的

GET https://example.com/api/api/auth/user 404 (Not Found)