mirror of
https://gitee.com/nocobase/nocobase.git
synced 2024-12-03 20:58:01 +08:00
fix: env variables have been modified
This commit is contained in:
parent
df153527a7
commit
729a8dce81
@ -348,15 +348,17 @@ exports.initEnv = function initEnv() {
|
||||
}
|
||||
}
|
||||
|
||||
if (process.env.APP_PUBLIC_PATH) {
|
||||
if (!process.env.__env_modified__ && process.env.APP_PUBLIC_PATH) {
|
||||
const publicPath = process.env.APP_PUBLIC_PATH.replace(/\/$/g, '');
|
||||
const keys = ['API_BASE_PATH', 'WS_PATH', 'PLUGIN_STATICS_PATH'];
|
||||
for (const key of keys) {
|
||||
process.env[key] = publicPath + process.env[key];
|
||||
}
|
||||
process.env.__env_modified__ = true;
|
||||
}
|
||||
|
||||
if (process.env.APP_SERVER_BASE_URL && !process.env.API_BASE_URL) {
|
||||
if (!process.env.__env_modified__ && process.env.APP_SERVER_BASE_URL && !process.env.API_BASE_URL) {
|
||||
process.env.API_BASE_URL = process.env.APP_SERVER_BASE_URL + process.env.API_BASE_PATH;
|
||||
process.env.__env_modified__ = true;
|
||||
}
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user