首页 > 解决方案 > 尝试在strapi中忘记密码时出现400错误

问题描述

我正在尝试使用strapi forgot password,并且我在 vue js 中有 frondend。当我尝试发送忘记密码的请求时,它会抛出 400 错误。

<template>
<form @submit.prevent="onForgetPassword">
   <label for="name">your email</label>
    <input type="email" class="from-input" placeholder="Enter Your Email..." v-model="email"/>
    <button type="submit" class="form-btn">reset password</button>
 </form>
</template>



data() {
    return {
      email: ""
    };
  },
  methods: {
    onForgetPassword() {
      axios
        .post("http://localhost:1337/auth/forgot-password", {
          email: this.email
        })
        .then(response => {
          // Handle success.
          console.log("Your user received an email");
        })
        .catch(error => {
          // Handle error.
          console.log("An error occurred:", error);
        });
    }
  }

标签: vue.jsstrapi

解决方案


推荐阅读