fix(web): 下载模块上移; 修复按钮遮挡版本文字与 APK 为空
- Landing: 下载模块移到 hero 之后 (特色/统计之前) - 按钮 display:inline-block + width:auto + margin-bottom, 不再全宽压住版本文字 - android-build.yml: 配置中心 key 改用后缀匹配 (r2/CF_API_TOKEN), 此前按精确名 CF_API_TOKEN 匹配导致 fetch 步骤报缺密钥 → android 构建从未跑, 桶里没有任何 widget/ 对象, APK 下载 404/为空
This commit is contained in:
@@ -145,6 +145,10 @@ jobs:
|
|||||||
"CFG_PROJECT_R2": ("CF_API_TOKEN", "CF_R2_PUBLIC_URL"),
|
"CFG_PROJECT_R2": ("CF_API_TOKEN", "CF_R2_PUBLIC_URL"),
|
||||||
}
|
}
|
||||||
wanted = {}
|
wanted = {}
|
||||||
|
# 兼容 key 带分组前缀 (如 CommonExternalService 下是 r2/CF_API_TOKEN)
|
||||||
|
def match(cfg_key, token):
|
||||||
|
return cfg_key == token or cfg_key.rsplit("/", 1)[-1] == token
|
||||||
|
|
||||||
for pid_env, keys in wanted_keys.items():
|
for pid_env, keys in wanted_keys.items():
|
||||||
pid = os.environ[pid_env]
|
pid = os.environ[pid_env]
|
||||||
req = urllib.request.Request(f"{url}/api/projects/{pid}/configs")
|
req = urllib.request.Request(f"{url}/api/projects/{pid}/configs")
|
||||||
@@ -153,8 +157,10 @@ jobs:
|
|||||||
with urllib.request.urlopen(req, timeout=20) as r:
|
with urllib.request.urlopen(req, timeout=20) as r:
|
||||||
data = json.load(r).get("data", [])
|
data = json.load(r).get("data", [])
|
||||||
for cfg in data:
|
for cfg in data:
|
||||||
if cfg.get("key") in keys:
|
cfg_key = cfg.get("key", "")
|
||||||
wanted[cfg["key"]] = cfg.get("value", "")
|
for wanted_key in keys:
|
||||||
|
if match(cfg_key, wanted_key):
|
||||||
|
wanted[wanted_key] = cfg.get("value", "")
|
||||||
with open(os.environ["GITHUB_ENV"], "a", encoding="utf-8") as f:
|
with open(os.environ["GITHUB_ENV"], "a", encoding="utf-8") as f:
|
||||||
for k, v in wanted.items():
|
for k, v in wanted.items():
|
||||||
f.write(f"{k}={v}\n")
|
f.write(f"{k}={v}\n")
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ function DownloadSection() {
|
|||||||
<a className="btn btn-primary" href={APK_URL} download="wardrobe.apk" style={styles.downloadBtn}>
|
<a className="btn btn-primary" href={APK_URL} download="wardrobe.apk" style={styles.downloadBtn}>
|
||||||
⬇️ 下载 APK
|
⬇️ 下载 APK
|
||||||
</a>
|
</a>
|
||||||
<p style={{ fontSize: 12, color: "var(--text-tertiary)", marginTop: 10 }}>
|
<p style={{ fontSize: 12, color: "var(--text-tertiary)", marginTop: 0, lineHeight: 1.6 }}>
|
||||||
版本 {APP_VERSION} · Android 8.0+ · 约 30 MB
|
版本 {APP_VERSION} · Android 8.0+ · 约 30 MB
|
||||||
</p>
|
</p>
|
||||||
<div style={{ marginTop: 20 }}>
|
<div style={{ marginTop: 20 }}>
|
||||||
@@ -105,6 +105,8 @@ export default function Landing() {
|
|||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
|
<DownloadSection />
|
||||||
|
|
||||||
<section style={styles.section}>
|
<section style={styles.section}>
|
||||||
<div style={{ display: "grid", gridTemplateColumns: "repeat(auto-fit, minmax(240px, 1fr))", gap: 16 }}>
|
<div style={{ display: "grid", gridTemplateColumns: "repeat(auto-fit, minmax(240px, 1fr))", gap: 16 }}>
|
||||||
{FEATURES.map((f) => (
|
{FEATURES.map((f) => (
|
||||||
@@ -128,8 +130,6 @@ export default function Landing() {
|
|||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<DownloadSection />
|
|
||||||
|
|
||||||
<section style={styles.section}>
|
<section style={styles.section}>
|
||||||
<h2 style={styles.sectionTitle}>技术栈</h2>
|
<h2 style={styles.sectionTitle}>技术栈</h2>
|
||||||
<p style={styles.sectionSub}>跨平台桌面 + 移动端, AI 就绪。</p>
|
<p style={styles.sectionSub}>跨平台桌面 + 移动端, AI 就绪。</p>
|
||||||
@@ -166,7 +166,7 @@ const styles: Record<string, React.CSSProperties> = {
|
|||||||
hero: { textAlign: "center", padding: "64px 0 48px" },
|
hero: { textAlign: "center", padding: "64px 0 48px" },
|
||||||
heroTitle: { fontSize: 40, fontWeight: 800, lineHeight: 1.3, letterSpacing: -0.5 },
|
heroTitle: { fontSize: 40, fontWeight: 800, lineHeight: 1.3, letterSpacing: -0.5 },
|
||||||
heroSub: { fontSize: 16, color: "var(--text-secondary)", lineHeight: 1.8, maxWidth: 560, margin: "18px auto 0" },
|
heroSub: { fontSize: 16, color: "var(--text-secondary)", lineHeight: 1.8, maxWidth: 560, margin: "18px auto 0" },
|
||||||
heroBtn: { padding: "12px 24px", fontSize: 15 },
|
heroBtn: { display: "inline-block", width: "auto", padding: "12px 24px", fontSize: 15 },
|
||||||
section: { padding: "40px 0 12px" },
|
section: { padding: "40px 0 12px" },
|
||||||
sectionTitle: { fontSize: 24, fontWeight: 700, textAlign: "center" },
|
sectionTitle: { fontSize: 24, fontWeight: 700, textAlign: "center" },
|
||||||
sectionSub: { fontSize: 14, color: "var(--text-secondary)", textAlign: "center", margin: "8px 0 22px" },
|
sectionSub: { fontSize: 14, color: "var(--text-secondary)", textAlign: "center", margin: "8px 0 22px" },
|
||||||
@@ -181,7 +181,7 @@ const styles: Record<string, React.CSSProperties> = {
|
|||||||
maxWidth: 480,
|
maxWidth: 480,
|
||||||
margin: "0 auto",
|
margin: "0 auto",
|
||||||
},
|
},
|
||||||
downloadBtn: { padding: "14px 32px", fontSize: 16 },
|
downloadBtn: { display: "inline-block", width: "auto", marginBottom: 12, padding: "14px 32px", fontSize: 16 },
|
||||||
qrWrap: {
|
qrWrap: {
|
||||||
display: "inline-flex",
|
display: "inline-flex",
|
||||||
padding: 10,
|
padding: 10,
|
||||||
|
|||||||
Reference in New Issue
Block a user