SOURCE

let deviceInfo={ "type":"MSG5200-2GEC-4E-X4"}
let CPE_DEVICE_TYPE = {
    MINITYPE_CPE: "MSG5200-GEC-8E-G4",
    SMALL_CPE: "MSG5200-XGE-8E-G5",
    MIDDLE_CPE: "MSG5200-2GEC-4E-X4"
}
let num ="2";
console.log(deviceInfo.type);
switch (deviceInfo.type) {
        case CPE_DEVICE_TYPE.MINITYPE_CPE:
        case CPE_DEVICE_TYPE.SMALL_CPE:
            main_if = "ge1";
            backup_if = "ge1";
            break;
        case CPE_DEVICE_TYPE.MIDDLE_CPE:
             if (num==1){
              main_if = "ge1";
              backup_if = "ge1";
            }else if( num== 2){
                main_if = "ge1";
             backup_if = "ge2";
            }
           
    }

console.log(main_if);
console.log(backup_if);
console 命令行工具 X clear

                    
>
console