guhongwei 4 år sedan
förälder
incheckning
b79d2ce562
3 ändrade filer med 15 tillägg och 11 borttagningar
  1. 7 6
      src/components/parts/chat.vue
  2. 3 0
      src/main.js
  3. 5 5
      src/plugins/setting.js

+ 7 - 6
src/components/parts/chat.vue

@@ -10,11 +10,11 @@
             </p>
           </li>
         </ul>
-        <el-row type="flex" :gutter="10" style="padding-top:20px;height:40px;line-height:40px">
-          <el-col :span="20">
+        <el-row type="flex" :gutter="10" style="padding-top:10px;">
+          <el-col :span="19">
             <el-input v-model="text" size="mini"></el-input>
           </el-col>
-          <el-col :span="4">
+          <el-col :span="5">
             <el-button @click="send" size="mini" round style="background: #ff8500;color: #fff;">发送</el-button>
           </el-col>
         </el-row>
@@ -72,6 +72,7 @@ export default {
       });
     },
     onMessage(message) {
+      console.log('lasjdas');
       // console.log('receive a message: ', message.body);
       let body = _.get(message, 'body');
       if (body) {
@@ -120,7 +121,7 @@ export default {
 .chat {
   float: left;
   width: 100%;
-  height: 515px;
+  height: 340px;
   border-radius: 5px;
   box-shadow: 0 0 5px #c20808;
   padding: 0 10px 0px 10px;
@@ -159,14 +160,14 @@ export default {
   background: #fff;
   float: left;
   width: 100%;
-  height: 480px;
+  height: 340px;
   overflow: hidden;
 }
 
 .chat .chatList ul {
   float: left;
   width: 100%;
-  height: 405px;
+  height: 275px;
   padding: 5px 0 0 0;
   overflow: auto;
   margin: 10px 0 0 0;

+ 3 - 0
src/main.js

@@ -12,12 +12,15 @@ import '@/plugins/loading';
 import '@/plugins/var';
 import '@/plugins/methods';
 import '@/plugins/setting';
+import InitStomp from '@/plugins/stomp';
+Vue.config.productionTip = false;
 
 new Vue({
   router,
   store,
   render: h => h(App),
 }).$mount('#app');
+InitStomp();
 window.vm = new Vue({
   router,
 });

+ 5 - 5
src/plugins/setting.js

@@ -2,16 +2,16 @@ import Vue from 'vue';
 
 Vue.config.weixin = {
   // baseUrl: process.env.BASE_URL + 'weixin',
-  baseUrl: `http://${location.host}/weixin`,
+  baseUrl: 'http://10.16.8.209:9005',
 };
 
 Vue.config.stomp = {
-  // brokerURL: 'ws://192.168.1.190:15674/ws',
+  // brokerURL: 'ws://http://free.liaoningdoupo.com/ws',
   brokerURL: '/ws', // ws://${location.host}/ws
   connectHeaders: {
-    host: 'smart',
-    login: 'web',
-    passcode: 'web123',
+    host: 'visit',
+    login: 'visit', //visit
+    passcode: 'visit', //visit123
   },
   // debug: true,
   reconnectDelay: 5000,