app.js 内小程序端的登录,以及获取店铺整体参数的数据。
var util = require('sx_haodian/resource/js/util.js');
App({
onLaunch: function (res) {
this.onLogin();
},
onShow: function (res) {
},
onHide: function () {
},
onError: function (msg) {
console.log(msg)
},
onLogin: function () {
let that = this;
wx.checkSession({
success: function (res) {
that.globalData.is_login = false;
},
fail: function (res) {
that.globalData.is_login = true
}
})
},
check: function (cb) {
var that = this;
if (this.globalData.userInfo) {
typeof cb == "function" && cb(this.globalData.userInfo);
} else {
wx.get