diff --git a/src/userComponents/others/GoodsChosen.js b/src/userComponents/others/GoodsChosen.js
index 2aad5e5a2f7e9804fca3e60c1aa02f9ebbb47f00..9eaab3b92f005510ec28b70f43867e4f2507f329 100644
--- a/src/userComponents/others/GoodsChosen.js
+++ b/src/userComponents/others/GoodsChosen.js
@@ -23,7 +23,7 @@ class GoodsChosen extends React.Component {
return true
}
}}
- onSelect={(value,key)=>{const { onChange } = this.props;onChange(value,key);console.log(value,key.props.key);}}
+ onSelect={(value)=>{const { onChange } = this.props;onChange(value);console.log(value);}}
defaultActiveFirstOption={false}
placeholder="货物名称-货物编号"
size="small"
diff --git a/src/userComponents/userLogin/UserLogin.jsx b/src/userComponents/userLogin/UserLogin.jsx
index 236a4c2e33baa9c2ffcd26b44fe44db72f8bcd4c..98a06308e1864376ea3a32eb7285e9390ee1acfd 100644
--- a/src/userComponents/userLogin/UserLogin.jsx
+++ b/src/userComponents/userLogin/UserLogin.jsx
@@ -21,18 +21,18 @@ class UserInput extends React.Component{
constructor(props){
super(props);
this.state={
- userUserName:'',
+ username:'',
password:'',
inVCode:'',
rightVCode:'',
imgCode:"",
result:'',
- code:'',
isInfoRight:false,
}
this.infoChange=this.infoChange.bind(this);
this.psChange=this.psChange.bind(this);
+ this.codeChange=this.codeChange.bind(this);
//this.vcChange=this.vcChange.bind(this);
this.infoRight=this.infoRight.bind(this);
this.infoFalse=this.infoFalse.bind(this);
@@ -47,7 +47,7 @@ class UserInput extends React.Component{
axios({
method: 'get',
- url: 'http://10.128.137.205:8088/passport/generate-code',
+ url: 'http://10.255.14.225:8088/passport/generate-code',
})
.then(response=> {
@@ -73,7 +73,7 @@ class UserInput extends React.Component{
//修改用户信息和密码
infoChange(event){
this.setState({
- userUserName:event.target.value,
+ username:event.target.value,
});
}
psChange(event){
@@ -81,9 +81,14 @@ class UserInput extends React.Component{
password:event.target.value,
});
}
+ codeChange(event){
+ this.setState({
+ inVCode:event.target.value,
+ });
+ }
getCode(event){
- axios.get("http://10.128.137.205:8088/passport/generate-code",{withCredentials:true}).then(res=>{
+ axios.get("http://10.255.14.225:8088/passport/generate-code",{withCredentials:true}).then(res=>{
this.setState({
imgCode : res.data
})
@@ -136,10 +141,25 @@ class UserInput extends React.Component{
//登录按钮功能
loginBtn(event){
- const userUserName=this.state.userUserName;
- const password=this.state.password;
- const inVCode=this.state.inVCode;
+ console.log(this.state.inVCode);
+ axios({
+ method: 'post',
+ url: 'http://10.255.14.225:8088/passport/userlogin',
+ params:{
+ code:this.state.inVCode,
+ password:this.state.password,
+ userName:this.state.username,
+ }
+ })
+ .then(response=> {
+ console.log(response);
+ alert(response.data.message);
+ })
+ .catch(function (error) {
+ console.log(error.config);
+ });
+ /*
if(userUserName==123&&password==123){
this.setState({
isInfoRight:true,
@@ -158,6 +178,7 @@ class UserInput extends React.Component{
})
})
+ */
event.preventDefault();
}
@@ -180,7 +201,7 @@ class UserInput extends React.Component{
- } className='relative inset-x-0 h-9 w-96 rounded-md' />
+ } className='relative inset-x-0 h-9 w-96 rounded-md' />
{/** 输入验证码: */}
diff --git a/src/userComponents/userLogin/UserRegister.js b/src/userComponents/userLogin/UserRegister.js
index 2b656a3546a17f3b9fea8b54bb7334749f05a448..7d7b580e391bc651926cf3fc43799b83e85e3bb0 100644
--- a/src/userComponents/userLogin/UserRegister.js
+++ b/src/userComponents/userLogin/UserRegister.js
@@ -99,7 +99,7 @@ class UserRegister extends React.Component{
if(this.state.password==this.state.passagain&&this.state.userName!=null&&this.state.userUsername!=null&&this.state.password!=null&&this.state.userPhonenum!=null){
axios({
method: 'post',
- url: 'http://10.128.137.205:8088/passport/registry',
+ url: 'http://10.255.14.225:8088/passport/registry',
data:{
userName:this.state.userName,
userUsername:this.state.userUsername,
@@ -110,7 +110,7 @@ class UserRegister extends React.Component{
})
.then(response=> {
console.log(response);
- alert('注册成功!');
+ alert(response.data.message);
})
.catch(function (error) {
console.log(error.config);
@@ -139,9 +139,9 @@ class UserRegister extends React.Component{
} className='relative inset-x-0 h-9 w-96 rounded-md' value={this.state.userPhonenum} onChange={this.phonenumChange} />
-