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

52 lines
1.3 KiB

6 years ago
Page({
formSubmit: function (e) {
wx.request({
url: 'http://localhost:9527/zxlogin/login',
data: {
'userid': e.detail.value.userid,
'userpassword': e.detail.value.userpassword,
},
header: {
6 years ago
"Content-Type": "application/x-www-form-urlencoded"
},
6 years ago
methods: {
method: "POST",
},
success: function (res) {
console.log(res.data);
if (res.data == "111") {
wx.showModal({
title: '登录消息',
content: '密码正确',
confirmColor: "rgba(253, 153, 65, 1)",
success: function (res) {
if (res.confirm) {
wx.switchTab({
url: '../shouye/shouye',
})
}
}
})
}
else 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)"
})
}
},
fail: function (res) {
console.log("失败");
}
})
6 years ago
}
})