我在登錄頁面的反應節點項目中面臨以下問題。到目前為止,我在每次執行后一次又一次地檢查我的代碼,但仍然顯示錯誤。我想從登錄頁面將數據傳遞到我的 mysql 數據庫中。這是我申請的第一階段。createError.js:16 Uncaught (in promise) Error: Request failed with status code 404Login.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);? ? ? ? ? ? ? ? }}
當我將數據提交到數據庫表時,我在瀏覽器控制臺中遇到此錯誤:未捕獲(承諾)錯誤:
MM們
2023-07-20 14:59:35