区分环境登陆(避免代码冗长)
1 export const Env = { 2 }; 3 export function getEnv(hostName) { 4 if (xxx.test(hostName)) { 5 return '环境' 6 } 7 } 8 9 class Config { 10 constructor(env){}//它的工作是保证每个对象的数据成员具有合适的初始值 11 getmethods(){}//自定义方法 12 } 13 14 export default new Config(getEnv(document.domain));

浙公网安备 33010602011771号