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.
24 lines
486 B
24 lines
486 B
const app = getApp();
|
|
Page({
|
|
data: {
|
|
info:'获取中...'
|
|
},
|
|
|
|
onLoad: function (options) {
|
|
this.setData({info:"获取中"})
|
|
wx.cloud.callFunction({name:"login"})
|
|
.then(res=>{
|
|
console.log(res);
|
|
this.setData(res.result);
|
|
}).catch(e=>{
|
|
console.error(e);
|
|
this.setData({info:"获取失败"});
|
|
})
|
|
},
|
|
copy(){
|
|
if(this.data.openid)
|
|
wx.setClipboardData({data: "openid: " + this.data.openid});
|
|
else
|
|
this.onLoad();
|
|
}
|
|
}) |