feat: add extension test environment configuration

This commit is contained in:
Caoweijie
2026-09-11 18:00:29 +08:00
parent f2817e7baf
commit 2c8e7a5435
4 changed files with 27 additions and 4 deletions
+9 -2
View File
@@ -1,6 +1,13 @@
// 切换环境后,在浏览器扩展管理页重新加载扩展并重新登录。
const SANSHENG_ENV='dev'; // dev | test | prod
const SANSHENG_ENVIRONMENTS={
dev:{apiBase:'http://localhost:19174',pcBase:'http://localhost:5173'},
test:{apiBase:'https://qa-api.sanshengai.net',pcBase:'https://qa.sanshengai.net'},
prod:{apiBase:'https://api.sanshengai.net',pcBase:'https://www.sanshengai.net'}
};
if(!Object.prototype.hasOwnProperty.call(SANSHENG_ENVIRONMENTS,SANSHENG_ENV))throw new Error(`未知扩展环境:${SANSHENG_ENV}`);
const SANSHENG_AUTH_CONFIG={
apiBase:'http://localhost:19174',
pcBase:'http://localhost:5173',
...SANSHENG_ENVIRONMENTS[SANSHENG_ENV],
clientId:'sansheng-product-analysis-extension',
scope:'product.analysis',
callbackPath:'/extension/authorize'