我在登录页面的反应节点项目中面临以下问题。到目前为止,我在每次执行后一次又一次地检查我的代码,但仍然显示错误。我想从登录页面将数据传递到我的 mysql 数据库中。这是我申请的第一阶段。
createError.js:16 Uncaught (in promise) Error: Request failed with status code 404
Login.js 文件..
import React from "react";
import "./Login.css";
import jQuery from "jquery";
import { useState } from "react";
import Axios from "axios";
const Login = () => {
const [userNameReg, setUserNameReg] = useState("");
const [emailReg, setEmailReg] = useState("");
const [passReg, setPassReg] = useState("");
const signup = () => {
Axios.post("http://localhost:3000/login", {
username: userNameReg,
email: emailReg,
password: passReg,
}).then((res) => {
console.log(res);
});
};
return (
<div>
<section className="account">
<div class="container" id="container">
<div class="form-container sign-up-container">
<form action="#">
<h1>Create Account</h1>
<div class="social-container">
<a href="#" class="social">
<i class="fab fa-facebook-f"></i>
</a>
<a href="#" class="social">
<i class="fab fa-google-plus-g"></i>
</a>
<a href="#" class="social">
<i class="fab fa-linkedin-in"></i>
</a>
</div>
<span>or use your email for registration</span>
<input
type="text"
placeholder="Name"
onChange={(e) => {
setUserNameReg(e.target.value);
}}
/>
<input
type="email"
placeholder="Email"
onChange={(e) => {
setEmailReg(e.target.value);
}}
长风秋雁
相关分类