更新 login.js
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
import { requestUrl } from '../../utils/config.js';
|
import { requestUrl } from '../../utils/config.js';
|
||||||
function showTost(title){
|
function showToast(title){
|
||||||
wx.showToast({
|
wx.showToast({
|
||||||
title: title,
|
title: title,
|
||||||
icon: "none",
|
icon: "none",
|
||||||
@@ -36,15 +36,15 @@ Page({
|
|||||||
success(res) {
|
success(res) {
|
||||||
if (res.data.code == 0 && res.data.msg == "ok"){
|
if (res.data.code == 0 && res.data.msg == "ok"){
|
||||||
console.log("登录成功",res.data.code)
|
console.log("登录成功",res.data.code)
|
||||||
showTost("登录成功")
|
showToast("登录成功")
|
||||||
// wx.redirectTo({
|
// wx.redirectTo({
|
||||||
// url: 'pages/home/home',
|
// url: 'pages/home/home',
|
||||||
// })
|
// })
|
||||||
wx.switchTab({
|
wx.redirectTo({
|
||||||
url: 'pages/home/home'
|
url: '/pages/home/home'
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
showTost(res.data.msg)
|
showToasst(res.data.msg)
|
||||||
console.log("登录失败",res.data)
|
console.log("登录失败",res.data)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user