import CookieUtils from "../utils/CookieUtils"

/**
 * 微服务客户端配置
 * @author WuFengLin
 */
export class GatewayConfig {

    /**
     * 开发环境服务地址
     */
    private hostAddressDev: string = 'https://bms-service-dev.keytop.cn/';


    /**
     * 测试网关服务地址
     */
    private hostAddressTest: string = 'https://bms-service-test.keytop.cn/';


    /**
     * 生产网关服务地址
     */
    private hostAddressPord: string = 'https://bms-service.keytop.cn/';

    /**
     * 获取网关环境地址
     * 从Cookie中环境类型动态获取网关域名
     */
    getHostAddress() {
        const envType = CookieUtils.get('KT_ME_ENV_TYPE') || CookieUtils.get('kt_me_env_type') || 'PROD'
        if (envType == 'DEV') {
            return this.hostAddressDev;
        } else if (envType == 'TEST') {
            return this.hostAddressTest;
        } else {
            return this.hostAddressPord;
        }
    }

    
}