|
@@ -1,7 +1,13 @@
|
|
|
function loginMsg(res) {
|
|
|
+ wx.removeStorageSync('auth')
|
|
|
+ wx.removeStorageSync('userauth');
|
|
|
+ wx.removeStorageSync('siteP');
|
|
|
+ wx.removeStorageSync('banner_list');
|
|
|
+ wx.removeStorageSync('templetList');
|
|
|
wx.setStorageSync('account_list', res.account_list);
|
|
|
if (res.account_list.length == 1) {
|
|
|
wx.setStorageSync('userrole', res.account_list[0].usertype == 1 ? '业务员' : '经销商');
|
|
|
+ wx.removeStorageSync('userMsg')
|
|
|
wx.setStorageSync('userMsg', res.account_list[0])
|
|
|
init();
|
|
|
} else {
|
|
@@ -31,6 +37,10 @@ function init() {
|
|
|
content: {
|
|
|
nocache: true
|
|
|
}
|
|
|
+ }, {
|
|
|
+ "classname": "sysmanage.develop.querytemplet.querytemplet",
|
|
|
+ "method": "query",
|
|
|
+ "content": {}
|
|
|
}].map(v => _Http.basic(v))).then(list => {
|
|
|
console.log("登录初始化", list)
|
|
|
if (list.some(res => res.msg != '成功')) return list.filter(res => {
|
|
@@ -47,24 +57,16 @@ function init() {
|
|
|
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'
|
|
|
- })
|
|
|
- })
|
|
|
|
|
|
- _Http.basic({
|
|
|
- "classname": "sysmanage.develop.querytemplet.querytemplet",
|
|
|
- "method": "query",
|
|
|
- "content": {}
|
|
|
- }).then(res => {
|
|
|
- console.log("获取列表查询条件", res)
|
|
|
- if (res.msg != '成功') return;
|
|
|
- let data = res.data.find(v => v.templetname == '站点全部');
|
|
|
+ let data = list[3].data.find(v => v.templetname == '站点全部');
|
|
|
if (data) {
|
|
|
- res.data = res.data.filter(v => v.templetname != '站点全部')
|
|
|
- res.data.unshift(data)
|
|
|
+ list[3].data = list[3].data.filter(v => v.templetname != '站点全部')
|
|
|
+ list[3].data.unshift(data)
|
|
|
}
|
|
|
- wx.setStorageSync('templetList', res.data)
|
|
|
+ wx.setStorageSync('templetList', list[3].data)
|
|
|
+ wx.switchTab({
|
|
|
+ url: '/pages/tabbar/home/index'
|
|
|
+ })
|
|
|
})
|
|
|
}
|
|
|
|