Browse Source

增加大屏免登录

dongjh 1 year ago
parent
commit
df0c10b42f

+ 2 - 0
.env.production

@@ -1,5 +1,7 @@
 NODE_ENV=production
+# 打包时修改该配置 因为固安有别的电脑会使用,这里要设置成真实IP
 VUE_APP_API_BASE_URL=http://200.200.200.80:8866/jeecg-boot
 # VUE_APP_API_BASE_URL=http://localhost:8080/jeecg-boot
+# 打包时修改该配置 因为固安有别的电脑会使用,这里要设置成真实IP
 VUE_APP_CAS_BASE_URL=http://200.200.200.80:8888/cas
 VUE_APP_ONLINE_BASE_URL=http://fileview.jeecg.com/onlinePreview

+ 7 - 2
src/views/modules_guAn/visualization/index.vue

@@ -219,13 +219,18 @@ export default {
       // const wsuri = `ws://192.168.2.216:8866/websocket/${userId}`
       // const wsuri = `ws://192.168.2.247:8866/websocket/${userId}`
       // WebSocket与普通的请求所用协议有所不同,ws等同于http,wss等同于https
-      var userId = store.getters.userInfo.id;
+      var userId = 'e9ca23d68d884d4ebb19d07889727dae';
+      if (store && store.getters && store.getters.userInfo && store.getters.userInfo.id) {
+        userId=store.getters.userInfo.id;
+      }
       var wsuri = window._CONFIG['domianURL'].replace("https://","wss://").replace("http://","ws://")+"/websocket/"+userId;
+      console.log("地址", wsuri)
       // var wsuri = 'ws://192.168.2.247:8866/websocket';
       // console.log(wsuri);
       //update-begin-author:taoyan date:2022-4-22 for:  v2.4.6 的 websocket 服务端,存在性能和安全问题。 #3278
       let token = Vue.ls.get(ACCESS_TOKEN)
-      this.websock = new WebSocket(wsuri, [token]);
+      // 大屏免登录,去掉token
+      this.websock = new WebSocket(wsuri);
       // this.websock = new WebSocket(wsuri, [token]);
       // 新建一个webstock对象
       // this.websock = new WebSocket(wsuri)

+ 4 - 10
src/views/modules_guAn/webaccess/index.vue

@@ -3,20 +3,14 @@
   <a-form-model ref="form" :model="model" :rules="validatorRules">
     <a-form-model-item label="设备参数名" :labelCol="labelCol" :wrapperCol="wrapperCol">
       <a-input v-model="tagname" style="width: 20%" />
-      <template>
-        <el-button @click="get" icon="reload" type="primary">获取参数值</el-button>
-      </template>
+        <a-button @click="get" icon="reload" type="primary" style="margin-left:10px">获取参数值</a-button>
     </a-form-model-item>
     <a-form-model-item label="设备参数值" :labelCol="labelCol" :wrapperCol="wrapperCol">
-      <a-input v-model="tagvalue" style="width: 20%" /> &nbsp;
-      <template>
-        <el-button type="info" icon="reload" @click="set">设置参数值</el-button>
-      </template>
+      <a-input v-model="tagvalue" style="width: 20%" />
+        <a-button type="info" icon="reload" @click="set" style="margin-left:10px">设置参数值</a-button>
     </a-form-model-item>
     <a-form-model-item label="获取历史数据" :labelCol="labelCol" :wrapperCol="wrapperCol">
-      <template>
-        <el-button type="info" icon="reload" @click="getlog">获取历史数据</el-button>
-      </template>
+        <a-button type="info" icon="reload" @click="getlog">获取历史数据</a-button>
     </a-form-model-item>
     <a-form-model-item label="返回内容" :labelCol="labelCol" :wrapperCol="wrapperCol">
       <a-textarea v-model="message" rows="9" />