修复协议协议判断错误导致https站点不能连接的问题

This commit is contained in:
dushixiang
2021-01-09 16:32:07 +08:00
parent df65341193
commit 77095e74e2
2 changed files with 2 additions and 3 deletions

View File

@ -1,6 +1,6 @@
// prod // prod
let wsPrefix; let wsPrefix;
if (window.location.protocol === 'https') { if (window.location.protocol === 'https:') {
wsPrefix = 'wss:' wsPrefix = 'wss:'
} else { } else {
wsPrefix = 'ws:' wsPrefix = 'ws:'
@ -8,7 +8,7 @@ if (window.location.protocol === 'https') {
export const server = ''; export const server = '';
export const wsServer = wsPrefix + window.location.host; export const wsServer = wsPrefix + window.location.host;
export const prefix = window.location.protocol + ':' + window.location.host; export const prefix = window.location.protocol + '//' + window.location.host;
// dev // dev
// export const server = '//127.0.0.1:8088'; // export const server = '//127.0.0.1:8088';

View File

@ -52,7 +52,6 @@ class Dashboard extends Component {
this.setState({ this.setState({
session: result['data'] session: result['data']
}) })
console.log('set session', this.state.session)
} }
} }