From defdcb409f771ca02ee5c92cd6f3d6a9d4cde500 Mon Sep 17 00:00:00 2001 From: jacy <18049821889@163.com> Date: Sun, 2 Aug 2026 12:55:40 +0800 Subject: [PATCH 1/2] fix(deploy): force staging=dev and production=main regardless of deploy.env --- deploy/deploy.sh | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/deploy/deploy.sh b/deploy/deploy.sh index 490a4db..0fd1ecd 100644 --- a/deploy/deploy.sh +++ b/deploy/deploy.sh @@ -48,14 +48,19 @@ load_env() { fi } +load_env + +# CLI 覆盖 deploy.env(须在 load_env 之后解析) +CLI_ENV="" +CLI_BRANCH="" while [[ $# -gt 0 ]]; do case "$1" in - --env) DUKANG_DEPLOY_ENV="$2"; shift 2 ;; + --env) CLI_ENV="$2"; shift 2 ;; --host) DEPLOY_HOST="$2"; shift 2 ;; --user) DEPLOY_USER="$2"; shift 2 ;; --port) DEPLOY_PORT="$2"; shift 2 ;; --key) DEPLOY_SSH_KEY="$2"; shift 2 ;; - --branch) GIT_BRANCH="$2"; shift 2 ;; + --branch) CLI_BRANCH="$2"; shift 2 ;; --check) CHECK_ONLY=true; shift ;; -h|--help) usage; exit 0 ;; --) @@ -67,11 +72,13 @@ while [[ $# -gt 0 ]]; do esac done -load_env +if [[ -n "$CLI_ENV" ]]; then + DUKANG_DEPLOY_ENV="$CLI_ENV" +fi # 兼容旧调用:未传 --env 时,若 GIT_BRANCH=main 视为生产,否则 staging if [[ -z "$DUKANG_DEPLOY_ENV" ]]; then - if [[ "${GIT_BRANCH:-}" == "main" || "${GIT_BRANCH:-}" == "master" ]]; then + if [[ "${CLI_BRANCH:-${GIT_BRANCH:-}}" == "main" || "${CLI_BRANCH:-${GIT_BRANCH:-}}" == "master" ]]; then DUKANG_DEPLOY_ENV=production else DUKANG_DEPLOY_ENV=staging @@ -96,7 +103,8 @@ if [[ "$DUKANG_DEPLOY_ENV" == "staging" ]]; then elif [[ "$APP_ROOT" == "/opt/dukang" ]]; then APP_ROOT="/opt/dukang-staging" fi - GIT_BRANCH="${GIT_BRANCH:-dev}" + # 测试固定默认 dev;CLI --branch 优先,忽略 deploy.env 里误配的 main + GIT_BRANCH="${CLI_BRANCH:-dev}" PORT_GREP='819[0-4]' else APP_ROOT="${PROD_APP_ROOT:-${APP_ROOT:-/opt/dukang}}" @@ -105,7 +113,8 @@ else elif [[ "$APP_ROOT" == "/opt/dukang-staging" ]]; then APP_ROOT="/opt/dukang" fi - GIT_BRANCH="${GIT_BRANCH:-main}" + # 生产固定默认 main;CLI --branch 优先,忽略 deploy.env 里误配的 dev + GIT_BRANCH="${CLI_BRANCH:-main}" PORT_GREP='809[0-4]' fi From 45d3d8164d977401fde3d44ad7694f83a2faae6a Mon Sep 17 00:00:00 2001 From: jacy <18049821889@163.com> Date: Sun, 2 Aug 2026 13:07:09 +0800 Subject: [PATCH 2/2] fix(admin-web): show company-name in store create partner dropdown --- apps/admin-web/src/pages/StoresPage.tsx | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/apps/admin-web/src/pages/StoresPage.tsx b/apps/admin-web/src/pages/StoresPage.tsx index 128d7f1..e1782e9 100644 --- a/apps/admin-web/src/pages/StoresPage.tsx +++ b/apps/admin-web/src/pages/StoresPage.tsx @@ -306,7 +306,14 @@ type StoreRow = { category?: { id: string; name: string; parentId?: string | null } | null; }; -type PartnerOption = { id: string; companyName: string }; +type PartnerOption = { id: string; companyName: string; name?: string }; + +function partnerOptionLabel(p: PartnerOption): string { + const company = (p.companyName || '').trim(); + const person = (p.name || '').trim(); + if (company && person) return `${company}-${person}`; + return company || person || p.id; +} type CityOption = { id: string; name: string; @@ -799,7 +806,7 @@ export default function StoresPage() { optionFilterProp="label" style={{ width: 180 }} placeholder="全部" - options={filterPartners.map((p) => ({ value: p.id, label: p.companyName || p.id }))} + options={filterPartners.map((p) => ({ value: p.id, label: partnerOptionLabel(p) }))} />