- 在小程序做登录注册功能,但注册这块,小程序一直返回undefined,后台数据也没有显示成功!
2.myeclisep和数据库sql 都没有问题。怀疑是小程序这边的问题,为什么上传不了数据
- 这是JS文件
var app = getApp();
Page({
data: {
username: null,
password: null,
jieguo: null
},
dian: function (e) {
var that = this;
that.username = e.detail.value.name;
that.password = e.detail.value.password;
console.log(that.username);
wx.request({
url: 'http://localhost:8080/mini',
data: {
name: that.username,
password: that.password
},
header: {
'content-type': 'application/json' // 默认值
},
success: function (res) {
console.log(res.data[0]);
console.log(res.data[0].jieguo);
that.jieguo = res.data[0].jieguo;
if (that.jieguo == 1) { wx.redirectTo({ url: "../login/login" }) }
},
fail: function (res) {
console.log(".....fail.....");
}
})
},
usernameInput: function (event) {
console.log(event.detail.value);
this.setData({ username: event.detail.value })
},
passwordInput: function (event) {
this.setData({ password: event.detail.value })
}
})
5.