修改测试打包环境和websocket日志

This commit is contained in:
walkersxq 2019-11-22 02:11:24 +08:00
parent 998fcf7146
commit 1165524548
2 changed files with 3 additions and 2 deletions

View File

@ -1,5 +1,5 @@
# just a flag # just a flag
NODE_ENV = 'production' NODE_ENV = 'test'
# base api # base api
VUE_APP_BASE_API = 'https://test.joylink.club/jlcloud' VUE_APP_BASE_API = 'https://test.joylink.club/jlcloud'

View File

@ -10,6 +10,7 @@ import Stomp from 'stompjs';
// var Stomp = require('stompjs'); // var Stomp = require('stompjs');
const isDev = process.env.NODE_ENV === 'development'; const isDev = process.env.NODE_ENV === 'development';
const isTest = process.env.NODE_ENV === 'test';
const websocketUrl = `${getBaseUrl()}/joylink-websocket?token=`; const websocketUrl = `${getBaseUrl()}/joylink-websocket?token=`;
// const websocketUrl = `http://192.168.3.6:9000/joylink-websocket?token=`; // const websocketUrl = `http://192.168.3.6:9000/joylink-websocket?token=`;
@ -164,7 +165,7 @@ StompClient.prototype = {
closeStompDebug() { closeStompDebug() {
if (this.clientIns) { if (this.clientIns) {
this.clientIns.debug = undefined; this.clientIns.debug = undefined;
if (isDev) { if (isDev || isTest) {
this.clientIns.debug = function (message) { this.clientIns.debug = function (message) {
console.debug(message); console.debug(message);
}; };