You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
iot/projects/Platform/wwwroot/js/config.js

15 lines
587 B

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

/*
* 1.前端目录通过document.location.origin和document.currentScript属性取得
* 2.网关地址跨域时需要填写具体地址并设置crossDomain为true
*/
const config = {
crossDomain: false,
path: document.currentScript.src.substring(document.location.origin.length, document.currentScript.src.length - 'js/config.js'.length),
file: function (file) {
return this.path + file;
},
gateway: 'http://example_gateway_host/',
service: function (service) {
return (this.crossDomain ? this.gateway : '/') + service + '/';
}
};