diff --git a/cli/src/action/auth/index.ts b/cli/src/action/auth/index.ts index 338071cb7f..1a8ed04f1a 100644 --- a/cli/src/action/auth/index.ts +++ b/cli/src/action/auth/index.ts @@ -6,9 +6,10 @@ import { getEmoji } from "../../util/print" export async function login(pat, options) { + let remoteServer = options.remote || DEFAULT_REMOTE_SERVER let systemConfig: SystemConfig = { - remoteServer: DEFAULT_REMOTE_SERVER, + remoteServer: remoteServer, } writeSystemConfig(systemConfig) @@ -21,10 +22,7 @@ export async function login(pat, options) { token: token, tokenExpire: timestamp + TOKEN_EXPIRE, pat: pat, - remoteServer: DEFAULT_REMOTE_SERVER, - } - if (options.remote) { - systemConfig.remoteServer = options.remote + remoteServer: remoteServer, } writeSystemConfig(systemConfig) console.log(`${getEmoji('🎉')} login success`) diff --git a/cli/src/common/constant.ts b/cli/src/common/constant.ts index c87af47e08..3ebb37a8c2 100644 --- a/cli/src/common/constant.ts +++ b/cli/src/common/constant.ts @@ -18,7 +18,7 @@ export const DEBUG_TOKEN_EXPIRE = 3600 * 24 * 7 export const STORAGE_TOKEN_EXPIRE = 3600 * 24 * 7 // remote server config -export const DEFAULT_REMOTE_SERVER = 'http://api.dev.laf.run' +export const DEFAULT_REMOTE_SERVER = 'http://api.preview.laf.run' // template file export const TEMPLATE_DIR = 'template'