1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- const _Http = getApp().globalData.http;
- function loginMsg(res) {
- wx.setStorageSync('account_list', res.account_list)
- if (res.account_list.length == 1) {
- wx.setStorageSync('userMsg', res.account_list[0])
- wx.switchTab({
- url: '/pages/tabbar/home/index'
- })
- query_userauth();
- } else {
- wx.redirectTo({
- url: './selectSite',
- })
- }
- }
- /* 获取用户权限 */
- function query_userauth(i = 0) {
- if (i == 5) return wx.showToast({
- title: '权限查询失败,请稍后再试',
- icon: "none"
- })
- if (i == 0) querySite_Parameter();
- _Http.basic({
- "classname": "sysmanage.develop.userauth.userauth",
- "method": "query_userauth",
- content: {}
- }).then(res => {
- if (res.msg != '成功') return query_userauth(i + 1);
- wx.setStorageSync('userauth', res.data);
- })
- }
- function querySite_Parameter(i = 0) {
- if (i == 5) return;
- _Http.basic({
- "classname": "webmanage.site.site",
- "method": "querySite_Parameter",
- "content": {}
- }).then(res => {
- if (res.msg != '成功') return query_userauth(i + 1);
- wx.setStorageSync('siteP', res.data);
- })
- }
- /* 站点数据查询 */
- module.exports = {
- loginMsg,
- query_userauth
- }
|