1 Star 0 Fork 0

zhuwei1999/myqq

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
app.js 2.75 KB
一键复制 编辑 原始数据 按行查看 历史
zhuwei1999 提交于 2023-07-18 10:48 . bjx
App({
hostAddress: "https://surname.yuanshudata.cn",
userAnswerId: null,
surenCheckpoint: 0,
loginUserWXOpenId: null,
loginUserSessionKey: null,
defaultShareTitle: "",
loginUserData: {
loginName: null,
token: null,
userId: null,
userName: null,
userType: null
},
needRefreshList: !1,
needLogin: !0,
loginModelFlag: !1,
operationBar: !1,
onLaunch: function() {},
checkForLogin: function(e) {
getApp().loginUserWXOpenId || getApp().loginUserBlock ? e && e() : (getApp().loginUserBlock = !0,
wx.login({
success: function(n) {
n.code ? wx.request({
url: getApp().hostAddress + "/weChat/v1/user/session/" + n.code,
data: {},
method: "GET",
header: {},
success: function(n) {
console.log("wechat login"), console.log(n), n.data.session_key && n.data.openid ? (getApp().loginUserSessionKey = n.data.session_key,
getApp().loginUserWXOpenId = n.data.openid, e && e()) : wx.showModal({
title: "提示",
content: "获取登录信息出错,请稍后重试",
showCancel: !1
});
},
fail: function() {
wx.showModal({
title: "提示",
content: "连接服务器失败,请稍后重试",
showCancel: !1
});
},
complete: function() {
getApp().loginUserBlock = !1;
}
}) : console.log("登录失败!" + n.errMsg);
},
fail: function() {
wx.showModal({
title: "提示",
content: "登录失败,请检查您的网络",
showCancel: !1
});
},
complete: function() {
getApp().loginUserBlock = !1;
}
}));
},
downloadImage: function(e, n) {
wx.downloadFile({
url: n.replace("http", "https"),
success: function(n) {
200 === n.statusCode && wx.getFileSystemManager().saveFile({
tempFilePath: n.tempFilePath,
success: function(n) {
wx.setStorageSync(e, n.savedFilePath), console.log(e + ": 缓存成功");
}
});
},
fail: function(e) {
console.log("缓存失败");
}
});
}
});
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
HTML/CSS
1
https://gitee.com/zhuwei1999/myqq.git
git@gitee.com:zhuwei1999/myqq.git
zhuwei1999
myqq
myqq
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385