| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677 | 
							
- import {
 
-     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))
 
-             //获取用户权限 
 
-             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);
 
-             });
 
-             // 查询站点数据
 
-             this.globalData.http.basic({
 
-                 "classname": "webmanage.site.site",
 
-                 "method": "querySite_Parameter",
 
-                 "content": {}
 
-             }).then(res => {
 
-                 console.log("跳转进入查询站点数据", res)
 
-                 if (res.msg != '成功') return wx.showToast({
 
-                     title: res.msg,
 
-                     icon: "none"
 
-                 });
 
-                 wx.setStorageSync('siteP', res.data);
 
-             });
 
-             console.log('跳转进入', wx.getStorageSync('userMsg'))
 
-             console.log('跳转进入', wx.getStorageSync('auth'))
 
-         }
 
-     },
 
-     initSocket() {
 
-         let that = this;
 
-         this.globalData.SocketTask = wx.connectSocket({
 
-             url: 'wss://meida.cnyunl.com/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.socket.callback(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"), //权限查询
 
-         handleSelect: null, //处理选择结果  函数
 
-         socketEstablish: false, //是否已经建立socket
 
-         SocketTask: '', // Socket方法
 
-         socket: { // Socket回调
 
-             that: null, //保存this
 
-             callback: function () {}
 
-         },
 
-     }
 
- })
 
 
  |