| 123456789101112131415 |
- export function getApiBaseUrl (){
- const { protocol, hostname, port } = window.location;
- // 开发环境特殊处理
- if (hostname === 'localhost' || hostname === '127.0.0.1') {
- return 'http://localhost:8084/pdu'; // 开发服务器地址
- }
- // 生产环境使用当前域名
- return port
- ? `${protocol}//${hostname}:${port}/pdu`
- : `${protocol}//${hostname}/pdu`;
- }
|