You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

52 lines
1.3 KiB

const cloudDir = "cloud://educoder.6564-educoder-1300855313/";
let _version = "0.16.6";
/**
*/
let { miniProgram:{ envVersion="release", version=_version}={}} = wx.getAccountInfoSync();
version = version||_version;
const developUrl = "https://test-newweb.educoder.net";
const trialUrl = "https://pre-newweb.educoder.net";
const releaseUrl = "https://www.educoder.net";
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;
}
}
const config = global.config = {
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;