Skip to content

Commit 2c950a7

Browse files
committed
feat: 支持多endpoint
1 parent 9702e4b commit 2c950a7

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "esa-cli",
3-
"version": "1.0.6",
3+
"version": "1.0.8-beta.2",
44
"description": "A CLI for operating Alibaba Cloud ESA Functions and Pages.",
55
"main": "bin/enter.cjs",
66
"type": "module",

src/commands/utils.ts

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,11 @@ import {
1717
} from '../libs/interface.js';
1818
import logger from '../libs/logger.js';
1919
import { getRoot } from '../utils/fileUtils/base.js';
20-
import { getCliConfig, projectConfigPath } from '../utils/fileUtils/index.js';
20+
import {
21+
getApiConfig,
22+
getCliConfig,
23+
projectConfigPath
24+
} from '../utils/fileUtils/index.js';
2125
import { validateCredentials } from '../utils/validateCredentials.js';
2226

2327
import { getRoutineDetails } from './common/utils.js';
@@ -120,13 +124,16 @@ export async function checkIsLoginSuccess(): Promise<boolean> {
120124
accessKeySecret
121125
};
122126
if (securityToken) auth.securityToken = securityToken;
127+
// 使用配置文件/项目里的 endpoint,避免 validateCredentials 探测到的公网域名
128+
//(如 esa.cn-hangzhou)覆盖用户显式配置的预发等地址
129+
const fileConfig = getApiConfig();
123130
server.updateConfig({
124-
auth,
125-
endpoint: result.endpoint
131+
...fileConfig,
132+
auth
126133
});
127134
api.updateConfig({
128-
auth,
129-
endpoint: result.endpoint
135+
...fileConfig,
136+
auth
130137
});
131138
return true;
132139
}

0 commit comments

Comments
 (0)