|
@@ -1,54 +1,55 @@
|
|
|
function loginMsg(res) {
|
|
|
wx.setStorageSync('account_list', res.account_list);
|
|
|
if (res.account_list.length == 1) {
|
|
|
- wx.setStorageSync('userMsg', res.account_list[0])
|
|
|
- init();
|
|
|
+ wx.setStorageSync('userrole', res.account_list[0].usertype == 1 ? '业务员' : '经销商');
|
|
|
+ wx.setStorageSync('userMsg', res.account_list[0])
|
|
|
+ init();
|
|
|
} else {
|
|
|
- wx.redirectTo({
|
|
|
- url: './selectSite',
|
|
|
- })
|
|
|
+ wx.redirectTo({
|
|
|
+ url: './selectSite',
|
|
|
+ })
|
|
|
}
|
|
|
}
|
|
|
|
|
|
function init() {
|
|
|
const _Http = getApp().globalData.http;
|
|
|
Promise.all([{
|
|
|
- "classname": "sysmanage.develop.userauth.userauth",
|
|
|
- "method": "query_userauth", //获取用户权限
|
|
|
- content: {
|
|
|
- nocache: true
|
|
|
- }
|
|
|
+ "classname": "sysmanage.develop.userauth.userauth",
|
|
|
+ "method": "query_userauth", //获取用户权限
|
|
|
+ content: {
|
|
|
+ nocache: true
|
|
|
+ }
|
|
|
}, {
|
|
|
- "classname": "webmanage.site.site",
|
|
|
- "method": "querySite_Parameter", //查询站点数据
|
|
|
- content: {
|
|
|
- nocache: true
|
|
|
- }
|
|
|
+ "classname": "webmanage.site.site",
|
|
|
+ "method": "querySite_Parameter", //查询站点数据
|
|
|
+ content: {
|
|
|
+ nocache: true
|
|
|
+ }
|
|
|
}, {
|
|
|
- "classname": "common.adspace.adspace",
|
|
|
- "method": "query_adspacelist", //查询轮播图
|
|
|
- content: {
|
|
|
- nocache: true
|
|
|
- }
|
|
|
+ "classname": "common.adspace.adspace",
|
|
|
+ "method": "query_adspacelist", //查询轮播图
|
|
|
+ content: {
|
|
|
+ nocache: true
|
|
|
+ }
|
|
|
}].map(v => _Http.basic(v))).then(list => {
|
|
|
- console.log("登录初始化", list)
|
|
|
- if (list.some(res => res.msg != '成功')) return list.filter(res => {
|
|
|
- if (res.msg != '成功') wx.showToast({
|
|
|
- title: res.msg,
|
|
|
- icon: "none",
|
|
|
- mask: true
|
|
|
- })
|
|
|
- })
|
|
|
- wx.setStorageSync('userauth', list[0].data);
|
|
|
- wx.setStorageSync('siteP', list[1].data);
|
|
|
- wx.setStorageSync('banner_list', list[2].data)
|
|
|
- if (!getApp().globalData.socketEstablish) getApp().initSocket();
|
|
|
- let pages = getCurrentPages();
|
|
|
- let prevPage = pages[pages.length - 2];
|
|
|
- if (prevPage && prevPage.__route__ == 'pages/tabbar/home/index') prevPage.refreshData();
|
|
|
- wx.switchTab({
|
|
|
- url: '/pages/tabbar/home/index'
|
|
|
+ console.log("登录初始化", list)
|
|
|
+ if (list.some(res => res.msg != '成功')) return list.filter(res => {
|
|
|
+ if (res.msg != '成功') wx.showToast({
|
|
|
+ title: res.msg,
|
|
|
+ icon: "none",
|
|
|
+ mask: true
|
|
|
})
|
|
|
+ })
|
|
|
+ wx.setStorageSync('userauth', list[0].data);
|
|
|
+ wx.setStorageSync('siteP', list[1].data);
|
|
|
+ wx.setStorageSync('banner_list', list[2].data)
|
|
|
+ if (!getApp().globalData.socketEstablish) getApp().initSocket();
|
|
|
+ let pages = getCurrentPages();
|
|
|
+ let prevPage = pages[pages.length - 2];
|
|
|
+ if (prevPage && prevPage.__route__ == 'pages/tabbar/home/index') prevPage.refreshData();
|
|
|
+ wx.switchTab({
|
|
|
+ url: '/pages/tabbar/home/index'
|
|
|
+ })
|
|
|
})
|
|
|
}
|
|
|
|