2 Star 2 Fork 2

夏晴天 / hui-yi-miniprogram

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
app.js 1.67 KB
一键复制 编辑 原始数据 按行查看 历史
夏晴天 提交于 2018-11-23 20:59 . 会易签到小程序 v1.0.0
//app.js
var util = require("/utils/util.js");
App({
onLaunch: function () {
const updateManager = wx.getUpdateManager()
updateManager.onCheckForUpdate(function (res) {
// 请求完新版本信息的回调
console.log(res.hasUpdate)
})
updateManager.onUpdateReady(function () {
wx.showModal({
title: '更新提示',
content: '新版本已经准备好,是否重启应用?',
success: function (res) {
if (res.confirm) {
// 新的版本已经下载好,调用 applyUpdate 应用新版本并重启
updateManager.applyUpdate()
}
}
})
})
updateManager.onUpdateFailed(function () {
// 新的版本下载失败
})
var userData = wx.getStorageSync("userAccount");
if (!userData.uid && !userData.pwd) {
// wx.clearStorageSync();
util.checkIsSupportSoter();
} else {
var uid = userData.uid;
var pwd = userData.pwd;
wx.request({
url: 'https://huiyix.applinzi.com/public/api/User/login?uid=' + uid + "&pwd=" + pwd,
method: "POST",
header: {
"content-type": "json"
},
success: function (res) {
if (res.data.code == "20004") {
wx.switchTab({
url: '/pages/meetList/meetList',
success: function () {
},
fail: function () {
console.log("switchTab fail")
}
})
} else if (res.data.code == "10009") {
wx.showToast({
title: '密码有误',
duration: 1000,
image: "/image/error.png",
mask: true
})
} else if (res.data.code == "10011") {
wx.showToast({
title: "输入错误信息",
duration: 1000,
image: "/image/x.png",
mask: true
});
}
}
});
}
}
})
微信
1
https://gitee.com/li-fengjie/wx-huiyi.git
git@gitee.com:li-fengjie/wx-huiyi.git
li-fengjie
wx-huiyi
hui-yi-miniprogram
master

搜索帮助