28 lines
980 B
JavaScript
28 lines
980 B
JavaScript
/**
|
|
* =============== Configuration File Description ===============
|
|
*
|
|
* - Nginx Deployment
|
|
* Delete the file with the same name under the same level of loading.js, Nginx proxy address: /omc-api
|
|
*
|
|
* - Non-Nginx Deployment
|
|
* Please make the current file the same level as the loading.js, change the host variable value to the data service access address
|
|
* !!! Note: After modifying the current file, it is recommended to revisit it after closing the browser.
|
|
*
|
|
*/
|
|
(function () {
|
|
// baseUrl = protocol://ip:port
|
|
// baseUrl = 'http://192.168.8.100:33030';
|
|
const protocol = window.location.protocol
|
|
let wsprotocol = "ws:"
|
|
const hostname = window.location.hostname
|
|
let host = `${hostname}:33030`;
|
|
if (protocol === 'https:') {
|
|
host = `${hostname}:33443`;
|
|
wsprotocol = "wss:"
|
|
}
|
|
|
|
// Service Address
|
|
sessionStorage.setItem('baseUrl', `${protocol}//${host}`);
|
|
// websocket Address
|
|
sessionStorage.setItem('wsUrl', `${wsprotocol}//${host}`);
|
|
})(); |