- 修复无法查看原生会话录屏的bug
- 优化列表显示的时间 - 优化获取开发环境的方式
This commit is contained in:
@ -1,22 +1,5 @@
|
||||
// prod
|
||||
let wsPrefix;
|
||||
if (window.location.protocol === 'https:') {
|
||||
wsPrefix = 'wss:'
|
||||
} else {
|
||||
wsPrefix = 'ws:'
|
||||
}
|
||||
|
||||
export const server = '';
|
||||
export const wsServer = wsPrefix + window.location.host;
|
||||
export const prefix = window.location.protocol + '//' + window.location.host;
|
||||
|
||||
// dev
|
||||
// export const server = '//127.0.0.1:8088';
|
||||
// export const wsServer = 'ws://127.0.0.1:8088';
|
||||
// export const prefix = '';
|
||||
|
||||
export const PROTOCOL_COLORS = {
|
||||
'rdp': 'red',
|
||||
'rdp': 'cyan',
|
||||
'ssh': 'blue',
|
||||
'telnet': 'geekblue',
|
||||
'vnc': 'purple'
|
||||
|
28
web/src/common/env.js
Normal file
28
web/src/common/env.js
Normal file
@ -0,0 +1,28 @@
|
||||
function env() {
|
||||
if (process.env.REACT_APP_ENV === 'development') {
|
||||
// 本地开发环境
|
||||
return {
|
||||
server: '//127.0.0.1:8088',
|
||||
wsServer: 'ws://127.0.0.1:8088',
|
||||
prefix: '',
|
||||
}
|
||||
} else {
|
||||
// 生产环境
|
||||
let wsPrefix;
|
||||
if (window.location.protocol === 'https:') {
|
||||
wsPrefix = 'wss:'
|
||||
} else {
|
||||
wsPrefix = 'ws:'
|
||||
}
|
||||
return {
|
||||
server: '',
|
||||
wsServer: wsPrefix + window.location.host,
|
||||
prefix: window.location.protocol + '//' + window.location.host,
|
||||
}
|
||||
}
|
||||
}
|
||||
export default env();
|
||||
|
||||
export const server = env().server;
|
||||
export const wsServer = env().wsServer;
|
||||
export const prefix = env().prefix;
|
@ -1,5 +1,5 @@
|
||||
import axios from 'axios'
|
||||
import {server} from "./constants";
|
||||
import {server} from "./env";
|
||||
import {message} from 'antd';
|
||||
import {getHeaders} from "../utils/utils";
|
||||
|
||||
|
Reference in New Issue
Block a user