esa-cli 1.0.8-beta.1 → 1.0.8-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -16,7 +16,7 @@ import { ApiService } from '../libs/apiService.js';
16
16
  import { isInstalledGit } from '../libs/git/index.js';
17
17
  import logger from '../libs/logger.js';
18
18
  import { getRoot } from '../utils/fileUtils/base.js';
19
- import { getCliConfig, projectConfigPath } from '../utils/fileUtils/index.js';
19
+ import { getApiConfig, getCliConfig, projectConfigPath } from '../utils/fileUtils/index.js';
20
20
  import { validateCredentials } from '../utils/validateCredentials.js';
21
21
  import { getRoutineDetails } from './common/utils.js';
22
22
  export const checkDirectory = (isCheckGit = false) => {
@@ -93,14 +93,11 @@ export function checkIsLoginSuccess() {
93
93
  };
94
94
  if (securityToken)
95
95
  auth.securityToken = securityToken;
96
- server.updateConfig({
97
- auth,
98
- endpoint: result.endpoint
99
- });
100
- api.updateConfig({
101
- auth,
102
- endpoint: result.endpoint
103
- });
96
+ // 使用配置文件/项目里的 endpoint,避免 validateCredentials 探测到的公网域名
97
+ //(如 esa.cn-hangzhou)覆盖用户显式配置的预发等地址
98
+ const fileConfig = getApiConfig();
99
+ server.updateConfig(Object.assign(Object.assign({}, fileConfig), { auth }));
100
+ api.updateConfig(Object.assign(Object.assign({}, fileConfig), { auth }));
104
101
  return true;
105
102
  }
106
103
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "esa-cli",
3
- "version": "1.0.8-beta.1",
3
+ "version": "1.0.8-beta.2",
4
4
  "description": "A CLI for operating Alibaba Cloud ESA Functions and Pages.",
5
5
  "main": "bin/enter.cjs",
6
6
  "type": "module",