guhongwei 4 years ago
parent
commit
163ec6ffe4
3 changed files with 11 additions and 11 deletions
  1. 3 3
      src/plugins/methods.js
  2. 1 1
      src/plugins/setting.js
  3. 7 7
      src/plugins/stomp.js

+ 3 - 3
src/plugins/methods.js

@@ -11,14 +11,14 @@ const Plugin = {
       },
     });
     // 4. 添加实例方法
-    Vue.prototype.$toUndefined = object => {
+    Vue.prototype.$toUndefined = (object) => {
       let keys = Object.keys(object);
-      keys.map(item => {
+      keys.map((item) => {
         object[item] = object[item] === '' ? (object[item] = undefined) : object[item];
       });
       return object;
     };
-    Vue.prototype.$turnTo = item => {
+    Vue.prototype.$turnTo = (item) => {
       if (item.info_type == 1) {
         window.open(item.url);
       } else {

+ 1 - 1
src/plugins/setting.js

@@ -2,7 +2,7 @@ import Vue from 'vue';
 
 Vue.config.weixin = {
   // baseUrl: process.env.BASE_URL + 'weixin',
-  baseUrl: 'http://10.16.8.209:9005',
+  // baseUrl: 'http://10.16.8.209:9005',
 };
 
 Vue.config.stomp = {

+ 7 - 7
src/plugins/stomp.js

@@ -11,7 +11,7 @@ const Plugin = {
   install(Vue, options) {
     assert(_.isObject(options));
     if (options.debug && !_.isFunction(options.debug)) {
-      options.debug = str => {
+      options.debug = (str) => {
         console.log(str);
       };
     }
@@ -22,7 +22,7 @@ const Plugin = {
 
     // 3. 注入组件
     Vue.mixin({
-      beforeDestroy: function() {
+      beforeDestroy: function () {
         if (this.$stompClient) {
           this.$stompClient.deactivate();
           delete this.$stompClient;
@@ -31,21 +31,21 @@ const Plugin = {
     });
 
     // 4. 添加实例方法
-    Vue.prototype.$stomp = function(subscribes = {}) {
+    Vue.prototype.$stomp = function (subscribes = {}) {
       // connect to mq
       const client = new Client(options);
-      client.onConnect = frame => {
+      client.onConnect = (frame) => {
         // Do something, all subscribes must be done is this callback
         // This is needed because this will be executed after a (re)connect
         console.log('[stomp] connected');
         Object.keys(subscribes)
-          .filter(p => _.isFunction(subscribes[p]))
-          .forEach(key => {
+          .filter((p) => _.isFunction(subscribes[p]))
+          .forEach((key) => {
             client.subscribe(key, subscribes[key]);
           });
       };
 
-      client.onStompError = frame => {
+      client.onStompError = (frame) => {
         // Will be invoked in case of error encountered at Broker
         // Bad login/passcode typically will cause an error
         // Complaint brokers will set `message` header with a brief message. Body may contain details.