xiaohaizhao 2 年之前
父節點
當前提交
9d3c203ae1
共有 3 個文件被更改,包括 56 次插入54 次删除
  1. 54 51
      app.js
  2. 0 1
      packageA/select/product/select.js
  3. 2 2
      project.private.config.json

+ 54 - 51
app.js

@@ -1,58 +1,61 @@
 import {
-  ApiModel
+    ApiModel
 } from './utils/api';
 
 App({
-  onLaunch(options) {
-    //小程序跳转进入
-    if (options.query.userMsg) {
-      wx.setStorageSync('userMsg', JSON.parse(options.query.userMsg));
-      wx.setStorageSync('auth', JSON.parse(options.query.auth));
-      wx.setStorageSync('siteP', JSON.parse(options.query.site));
-      //获取用户权限 
-      this.globalData.http.basic({
-        "classname": "sysmanage.develop.userauth.userauth",
-        "method": "query_userauth",
-        content: {
-          nocache: true
+    onLaunch(options) {
+        //小程序跳转进入
+        if (options.query.userMsg) {
+            wx.removeStorageSync('userMsg')
+            wx.removeStorageSync('auth')
+            wx.removeStorageSync('userauth');
+            wx.setStorageSync('userMsg', JSON.parse(options.query.userMsg));
+            wx.setStorageSync('auth', JSON.parse(options.query.auth));
+            wx.setStorageSync('siteP', JSON.parse(options.query.site));
+            //获取用户权限 
+            this.globalData.http.basic({
+                "classname": "sysmanage.develop.userauth.userauth",
+                "method": "query_userauth",
+                content: {
+                    nocache: true
+                }
+            }).then(res => {
+                console.log("跳转进入查询权限", res)
+                if (res.msg != '成功') return wx.showToast({
+                    title: '权限查询失败,请稍后再试',
+                    icon: "none"
+                })
+                wx.setStorageSync('userauth', res.data);
+            });
         }
-      }).then(res => {
-        console.log("跳转进入查询权限", res)
-        if (res.msg != '成功') return wx.showToast({
-          title: '权限查询失败,请稍后再试',
-          icon: "none"
+    },
+    initSocket() {
+        let that = this;
+        this.globalData.SocketTask = wx.connectSocket({
+            url: 'wss://oms.idcgroup.com.cn:8079/yos/webSocket/' + wx.getStorageSync('userMsg').token,
+            complete: (res) => {
+                console.log(res)
+            }
         })
-        wx.setStorageSync('userauth', res.data);
-      });
-    }
-  },
-  initSocket() {
-    let that = this;
-    this.globalData.SocketTask = wx.connectSocket({
-      url: 'wss://oms.idcgroup.com.cn:8079/yos/webSocket/' + wx.getStorageSync('userMsg').token,
-      complete: (res) => {
-        console.log(res)
-      }
-    })
-    this.globalData.SocketTask.onOpen(function (res) {
-      that.globalData.socketEstablish = true;
-    })
-    this.globalData.SocketTask.onMessage(function (res) {
-      that.globalData.socketCallback(res)
-    })
-    this.globalData.SocketTask.onError(function (res) {
-      that.globalData.socketEstablish = false;
-    })
-    this.globalData.SocketTask.onClose(function (res) {
-      that.globalData.socketEstablish = false;
-    })
-  },
-  globalData: {
-    http: new ApiModel(), //接口文件
-    queryPer: require("./utils/queryPermissions"), //权限查询
-    socketEstablish: false, //是否已经建立socket
-    SocketTask: '', // Socket方法
-    socketCallback: null, // Socket回调
-    handleSelect: null, //处理选择结果  函数
-  },
+        this.globalData.SocketTask.onOpen(function (res) {
+            that.globalData.socketEstablish = true;
+        })
+        this.globalData.SocketTask.onMessage(function (res) {
+            that.globalData.socketCallback(res)
+        })
+        this.globalData.SocketTask.onError(function (res) {
+            that.globalData.socketEstablish = false;
+        })
+        this.globalData.SocketTask.onClose(function (res) {
+            that.globalData.socketEstablish = false;
+        })
+    },
+    globalData: {
+        http: new ApiModel(), //接口文件
+        queryPer: require("./utils/queryPermissions"), //权限查询
+        socketEstablish: false, //是否已经建立socket
+        SocketTask: '', // Socket方法
+        socketCallback: null, // Socket回调
+        handleSelect: null, //处理选择结果  函数
+    },
 })

+ 0 - 1
packageA/select/product/select.js

@@ -14,7 +14,6 @@ Page({
         idname: "itemid", //idkey
         showName: "itemname", //表单用 显示名称
         filtrate: false,
-
         filtratelist: [{
             label: "领域",
             index: null,

+ 2 - 2
project.private.config.json

@@ -2,7 +2,7 @@
     "projectname": "YOS_wechat",
     "setting": {
         "compileHotReLoad": true,
-        "urlCheck": false
+        "urlCheck": true
     },
     "description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html",
     "condition": {
@@ -39,5 +39,5 @@
             ]
         }
     },
-    "libVersion": "2.30.2"
+    "libVersion": "2.24.4"
 }