Browse Source

Merge branch 'master' of http://git.cc-lotus.info/service-platform/web-test

wuhongyu 5 years ago
parent
commit
3eb826d264

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

@@ -52,19 +52,20 @@ export default {
       if (this.$checkRes(res)) this.$set(this, `list`, _.reverse(res.data));
     },
     async send() {
-      if (!this.user.uid) {
-        this.$message.error('游客不能发言,请先注册');
-        return;
-      }
+      // if (!this.user.uid) {
+      //   this.$message.error('游客不能发言,请先注册');
+      //   return;
+      // }
       if (this.text != '') {
         let object = { sender_name: this.user.name, content: this.text };
-        if (this.user.id) object.sender_id = this.user.id;
+        if (this.user.uid) object.sender_id = this.user.uid;
         //TODO接口
         let res = await this.create(object);
         this.$checkRes(res, null, res.errmsg || '发言失败');
       } else this.$message.error('请输入信息后发送');
     },
     channel() {
+      console.log('in function:');
       this.$stomp({
         [`/exchange/public_chat`]: this.onMessage,
       });

+ 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,

+ 4 - 4
src/views/hall/hallDetail.vue

@@ -142,10 +142,10 @@ export default {
     },
     async sendMessage() {
       this.$set(this, `sending`, false);
-      if (!this.user.uid) {
-        this.$message.error('游客不能发言,请先注册');
-        return;
-      }
+      // if (!this.user.uid) {
+      //   this.$message.error('游客不能发言,请先注册');
+      //   return;
+      // }
       if (this.content != '') {
         let object = { number: this.id, sender_name: this.user.name, content: this.content };
         if (this.user.uid) object.sender_id = this.user.uid;

+ 6 - 5
src/views/hall/parts/chat.vue

@@ -52,13 +52,14 @@ export default {
       if (this.$checkRes(res)) this.$set(this, `list`, _.reverse(res.data));
     },
     async send() {
-      if (!this.user.uid) {
-        this.$message.error('游客不能发言,请先注册');
-        return;
-      }
+      console.log('in function:');
+      // if (!this.user.uid) {
+      //   this.$message.error('游客不能发言,请先注册');
+      //   return;
+      // }
       if (this.text != '') {
         let object = { sender_name: this.user.name, content: this.text };
-        if (this.user.id) object.sender_id = this.user.id;
+        if (this.user.uid) object.sender_id = this.user.uid;
         //TODO接口
         let res = await this.create(object);
         this.$checkRes(res, null, res.errmsg || '发言失败');

+ 2 - 2
src/views/technical/index.vue

@@ -92,13 +92,13 @@ export default {
   methods: {
     ...news(['query']),
     async searchInfo() {
-      let res = await this.query({ skip: 0, limit: 5, column_name: '专题研讨' });
+      let res = await this.query({ skip: 0, limit: 6, column_name: '专题研讨' });
       if (this.$checkRes(res)) this.$set(this, `zhuantiList`, res.data);
       res = await this.query({ skip: 0, limit: 10, column_name: '技术问答' });
       if (this.$checkRes(res)) this.$set(this, `jishuList`, res.data);
       res = await this.query({ skip: 0, limit: 10, column_name: '行业研究' });
       if (this.$checkRes(res)) this.$set(this, `hangyeList`, res.data);
-      res = await this.query({ skip: 0, limit: 5, column_name: '教育培训' });
+      res = await this.query({ skip: 0, limit: 6, column_name: '教育培训' });
       if (this.$checkRes(res)) this.$set(this, `jiaoyuList`, res.data);
     },
     turnToList(column_name) {