You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
zx/denglu/denglu.js

68 lines
1.6 KiB

Page({
formSubmit: function (e) {
wx.request({
url: 'http://localhost:9528/zxlogin/login',
data: {
'userid': e.detail.value.userid,
'userpassword': e.detail.value.userpassword,
},
header: {
"Content-Type": "application/x-www-form-urlencoded"
},
methods: {
method: "POST",
},
success: function (res) {
var book = res.data
let bookstr = JSON.stringify(book);
console.log(book);
if (res.data == "100") {
wx.showModal({
title: '登录消息',
content: '密码错误',
confirmColor: "rgba(253, 153, 65, 1)"
})
}
else if (res.data == "001") {
wx.showModal({
title: '登录消息',
content: '用户名不存在',
confirmColor: "rgba(253, 153, 65, 1)"
})
}
else {
wx.showModal({
title: '登录消息',
content: '登录成功',
confirmColor: "rgba(253, 153, 65, 1)",
success: function (res) {
if (res.confirm) {
wx.switchTab({
url: '../shouye/shouye',
})
}
}
})
}
},
fail: function (res) {
console.log("失败");
}
})
},
wx.request({
url: 'http://localhost:9528/zxbook/find2',
data: {
'search': e.target.id,
},
header: {
"Content-Type": "application/json"
},
methods: {
method: "POST",
},
6 years ago
})