123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109 |
- 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();
- querySite(that)
- } 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 querySite(that) {
- that.$Http.basic({
- "classname": "webmanage.site.site",
- "method": "querySite",
- "content": {},
- }).then(res => {
- console.log("查询站点数据", res)
- if (res.msg != '成功') return uni.showToast({
- title: res.msg,
- icon: "none"
- });
- res.data.logo = res.data.attinfos.length ? that.getSpecifiedImage(res.data.attinfos.find(s => s.usetype == "actionlogo") || res.data.attinfos[0]) : ''
- uni.setStorageSync('site', 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 < 3) return;
- uni.reLaunch({
- url: '/pages/index/index',
- });
- count = 0;
- /* that.$Socket.initSocket()
- console.log("Socket", that.$Socket) */
- }
- /* 站点数据查询 */
- module.exports = {
- loginMsg,
- query_userauth
- }
|