登录名%1无法加载资源:服务器在提交表单时以404(未找到)axios firebase react js状态响应。而且这个错误在firebase函数日志上也好心有人帮我...登录%1加载资源失败:服务器响应的状态为404(找不到)POST http://localhost:3000/login 404 Not Found
请检查在提交
import React, { Component } from 'react'
import withStyles from '@material-ui/core/styles/withStyles'
import PropTypes from 'prop-types'
import AppIcon from '../images/logo.png'
//axios
import axios from 'axios'
//MUi stuff
import Button from '@material-ui/core/Button'
import TextField from '@material-ui/core/TextField'
import Grid from '@material-ui/core/Grid'
import Typography from '@material-ui/core/Typography'
const styles = {
form: {
textAlign: 'center'
},
imgLogo: {
margin: '20px auto 20px auto'
},
button: {
margin: '10px auto 10px auto'
},
textField: {
margin: '10px auto 10px auto'
}
}
class login extends Component {
constructor() {
super();
this.state = {
email: '',
password: '',
loading: false,
errors: {}
}
}
handleSubmit = (event) => {
event.preventDefault();
this.setState({
loading: true
});
axios.post('/login' , {
email: this.state.email,
password: this.state.password
})
.then(res =>{
console.log(res.data);
this.setState({
loading: false
});
this.props.history.push('/');
})
.catch(err => {
this.setState({
errors: err.response.data,
loading: false
})
})
};
handleChange = (event) => {
this.setState({
[event.target.name]: event.target.value
});
}
render() {
const {classes} = this.props;
const {errors , loading} = this.state;
return (
<Grid container className={classes.form}>
<Grid item sm></Grid>
<Grid item sm>
<img src={AppIcon} width="80" height="80" alt="logo" className=
{classes.imgLogo}/>
<Typography variant="h3" className={classes.pageTitle}>
Login
</Typography>
<form noValidate onSubmit={this.handleSubmit}>
<TextField id="email"
name="email"
type="email"
label="Email"
className={classes.textField}
value={this.state.email}
onChange={this.handleChange}
helperText={errors.email}
error={errors.email ? true : false}
fullWidth
/>
<TextField id="password"
name="password"
type="password"
label="Password"
className={classes.textField}
value={this.state.password}
onChange={this.handleChange}
helperText={errors.password}
error={errors.password ? true : false}
fullWidth
/>
<Button className={classes.button} variant="contained"
color="secondary"
type="submit">
Login
</Button>
</form>
</Grid>
<Grid item sm></Grid>
</Grid>
)
}
}
login.propTypes = {
classes: PropTypes.object.isRequired
}
export default withStyles(styles)(login);
检查哪个端口承载您的网站。如果是3000,检查登录文件应该存在的文件目录。
我正在学习Lynda关于Javascript和Ajax以及hungup的教程,主题是“使用同步XHR请求”。 html文件基本上是: javascript文件为: data.txt文件上有“Hello World”。 项目文件的路径为 当我打开wampserver上的localhost并执行inspect元素时,我得到了上面的错误:“未能加载资源:服务器响应状态为404(not found)” 不
我有angular 6应用程序在我的本地机器上,一切都按照我想要的完美工作,完成项目后我将其部署到heroku,当我运行我的应用程序时,这里是指向heroku中应用程序的链接:测试应用程序 正如您所看到的,我在控制台浏览器中遇到以下错误 加载资源失败:服务器响应状态为404(未找到) 这是我在github中的应用程序结构 github中的应用程序回购 为了快速参考,这里是服务器。js 这是hero
我完全新的ReactJS。 我在YouTube遵循这个教程,遵循每个步骤。 直到我发现我的代码出现了这样的错误 因为我刚开始编程ReactJS,我仍然不明白该做什么,以及如何修复这个问题 本教程展示了如何构建一个简单的CRUD应用程序,内置于ReactJS和PostgreSQL 这里我提供我的应用程序。js代码 这是我的server.js代码: 我该怎么办?任何建议都能帮我解决这个问题 非常感谢。
我还在javascript的pageload方法中调用了LoadLanguageSelect、LoadVideoLogLay和LoadImage javascript方法。当页面以这种方式加载时,那些方法中的操作将在页面加载期间起作用。但是当我将javascript方法发布到ASP.NET cs端时会出现这个错误。 我的JavaScript的pageload方法 null null 和我的Java
我收到错误:“加载资源失败:服务器响应状态为404(未找到)”,javascript文件中有图标文件。 试图得到一个标记显示在谷歌地图。 我正在使用Visual Studio 2015和Apache Cordova。 文件位于www/scripts/googlemap。js和www/scripts/green。巴布亚新几内亚。 编辑:主要问题是来源。Url应为/scripts/green。png或
HTML 服务器(serv.js) 我几乎尝试了前面堆栈溢出文章中的所有内容:加载资源失败:服务器以404(未找到)状态响应加载资源失败:服务器以404(未找到)状态响应css 还有其他建议吗?