let count = 0; //接口完成数量 import { parsingAuth } from "../../../utils/auth"; let that = null; function loginMsg(account_list, _this, storage = true) { that = _this; if (storage) uni.setStorageSync("account_list", account_list); uni.setStorageSync("isAgreement", true); if (account_list.length == 1) { uni.setStorageSync('userMsg', account_list[0]) query_userauth(); // query_adspacelist(); querySite_Parameter(); } else { uni.navigateTo({ url: '/pages/login/selectSite' }) } } /* 获取用户权限 */ function query_userauth() { that.$Http.basic({ "classname": "sysmanage.develop.userauth.userauth", "method": "query_userauth", content: { nocache: true } }).then(res => { console.log("查询用户权限", res) if (res.msg != '成功') return uni.showToast({ title: res.msg, icon: "none" }); parsingAuth(res.data) count += 1; toHome(); }); } /* 查询站点数据 */ function querySite_Parameter() { that.$Http.basic({ "classname": "webmanage.site.site", "method": "querySite_Parameter", //查询站点数据 "content": {} }).then(res => { console.log("查询站点数据", res) if (res.msg != '成功') return uni.showToast({ title: res.msg, icon: "none" }); uni.setStorageSync('siteP', res.data); count += 1; toHome(); }) } /* 查询轮播图 */ function query_adspacelist() { that.$Http.basic({ id: 20230608100802, "content": {} }).then(res => { console.log("查询轮播图", res) if (res.msg != '成功') return uni.showToast({ title: res.msg, icon: "none" }); uni.setStorageSync('banner_list', res.data) count += 1; toHome(); }) } function toHome() { if (count < 2) return; uni.reLaunch({ url: '/pages/index/index', }); count = 0; /* that.$Socket.initSocket() console.log("Socket", that.$Socket) */ } /* 站点数据查询 */ module.exports = { loginMsg, query_userauth }