const cloudDir = "cloud://educoder.6564-educoder-1300855313/"; let { miniProgram:{ envVersion, version}} = wx.getAccountInfoSync(); const developUrl = "https://test-newweb.educoder.net"; const trialUrl = "https://pre-newweb.educoder.net"; const releaseUrl = "https://www.educoder.net"; let _version = "0.16.0"; var eduUrl = releaseUrl; /** */ export function switchEnv(env) { config.env = env; if (env == "develop") { eduUrl = developUrl; config.version = "开发环境 " + _version +"(点击切换)"; } else if (env == "trial") { eduUrl = trialUrl; config.version = "体验版 " + _version; } else { eduUrl = releaseUrl; config.version = version||_version; } } const config = global.config = { version:version||_version, envVersion, env:envVersion, get apiRoot(){return eduUrl + "/api/"}, get attachDir(){return eduUrl + "/api/attachments/"}, cloudDir, get eduUrl(){return eduUrl}, imgDir: cloudDir + "images/", get eduImgDir(){return eduUrl + "/images/"}, switchEnv, pages:[ "exercise/pages/exercise_setting/exercise_setting", "common-homework/pages/common-homework/common-homework" ] }; switchEnv("release"); //switchEnv(envVersion=="develop"?"trial":"release"); module.exports = config;