2 Star 0 Fork 0

FHZD/voting

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
app.js 1.22 KB
一键复制 编辑 原始数据 按行查看 历史
Acmanl 提交于 2019-02-15 10:30 +08:00 . 1
App({
onLaunch: function() {
//登录
wx.login({
success: res => {
let code = res.code;
wx.request({
url: 'https://whxes.sinopact.com/wechat/user/login',
method: 'GET',
header: {
'content-type': 'text/plain',
'Accept': 'application/json'
},
data: {
code: code
},
success: function(res) {
if (res.statusCode === 200) {
wx.setStorageSync('openid',res.data.openid);
}
}
})
}
})
},
loginToken:function () {
wx.request({
url: 'https://whxes.sinopact.com/wechat/user/getToken',
method: 'GET',
header: {
'content-type': 'text/plain'
},
success: function(res) {
console.log(res)
// that.globalData.message = res.data.message;
// wx.setStorageSync('id_token', "Bearer " + res.data.data.id_token);
// if (that.messageCallback) {
// that.messageCallback(res.data.message);
// }
// that.getPhoneNumber()
}
})
},
globalData: {
url: 'https://whxes.sinopact.com',
picArr:[]
}
})
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/FHZD/voting.git
git@gitee.com:FHZD/voting.git
FHZD
voting
voting
master

搜索帮助