|
|
@@ -1,5 +1,6 @@
|
|
|
// pages/mine/mine.js
|
|
|
const defaultAvatarUrl = "../../static/images/no-login.png"
|
|
|
+const homeApi_empower = "https://aipush.aidsleep.cn";
|
|
|
Page({
|
|
|
|
|
|
/**
|
|
|
@@ -254,6 +255,33 @@ Page({
|
|
|
avatarUrl: userInfo.avatarUrl || defaultAvatarUrl,
|
|
|
phoneNumber: userInfo.phoneNumber || ""
|
|
|
})
|
|
|
+ // 判断扫码控制权限
|
|
|
+ wx.request({
|
|
|
+ url: `${homeApi_empower}/wxstatus`,
|
|
|
+ data: {
|
|
|
+ unionid: wx.getStorageSync('unionid'),
|
|
|
+ openid: wx.getStorageSync('openid'),
|
|
|
+ token: wx.getStorageSync('token'),
|
|
|
+ },
|
|
|
+ method: 'POST',
|
|
|
+ success: function (intervalRes) {
|
|
|
+ console.log('intervalRes=' + JSON.stringify(intervalRes));
|
|
|
+ console.log('intervalRes.data=' + JSON.stringify(intervalRes.data));
|
|
|
+ //empower.js? [sm]:152 intervalRes.data={"st":"success","status":"0"}
|
|
|
+ if (intervalRes.data && intervalRes.data.st && intervalRes.data.status && intervalRes.data.st == 'success' && intervalRes.data.status == '1') {
|
|
|
+ wx.setStorageSync('hasHotelAuth', true);
|
|
|
+ wx.setStorageSync('hotelEmpower', intervalRes.data.hotel);
|
|
|
+ wx.setStorageSync('roomEmpower', intervalRes.data.room);
|
|
|
+ } else {
|
|
|
+ wx.setStorageSync('hasHotelAuth', false);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ fail: function (error) {
|
|
|
+
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
return hasAuth;
|
|
|
},
|