v1.3.1 #9

Merged
timi merged 14 commits from dev into master 2026-11-13 17:12:54 +00:00
11 changed files with 418 additions and 83 deletions
Showing only changes of commit 7cb4836b40 - Show all commits
+95 -1
View File
@@ -51,6 +51,89 @@ jobs:
echo "publish=false" >> $GITHUB_OUTPUT
fi
# 从 CHANGELOG.md 提取当前版本的说明,落到 release-note.txt
# 用文件而不是 step output 传递:note 是多行文本,多行 output 在各版本 runner 上行为不一致
- name: Resolve release note
env:
VERSION: ${{ steps.version.outputs.version }}
run: |
if [ ! -f CHANGELOG.md ]; then
echo "WARN: 缺少 CHANGELOG.md,本次发布不带变更说明"
: > release-note.txt
exit 0
fi
node --input-type=module <<'NODE'
import fs from "node:fs";
const version = process.env.VERSION;
const heading = "## v" + version;
const lines = fs.readFileSync("CHANGELOG.md", "utf8").split(/\r?\n/);
const start = lines.findIndex(line => line.trim() === heading);
if (start < 0) {
console.error("WARN: CHANGELOG.md 中没有 " + heading + ",本次发布不带变更说明");
fs.writeFileSync("release-note.txt", "");
process.exit(0);
}
const LIMIT = 480;
const picked = [];
let inComment = false;
for (let i = start + 1; i < lines.length; i += 1) {
const raw = lines[i];
if (/^##\s/.test(raw)) {
break;
}
// 跳过 HTML 注释,避免注释内容占掉长度
if (inComment) {
if (raw.includes("-->")) {
inComment = false;
}
continue;
}
if (raw.includes("<!--")) {
if (!raw.includes("-->")) {
inComment = true;
}
continue;
}
if (raw.trim() === "") {
// 连续空行压成一个,只用于分隔段落
if (picked.length > 0 && picked[picked.length - 1] !== "") {
picked.push("");
}
continue;
}
// 去掉行尾空白,保留行首缩进(嵌套列表)
picked.push(raw.replace(/\s+$/, ""));
}
while (picked.length > 0 && picked[picked.length - 1] === "") {
picked.pop();
}
if (picked.length === 0) {
console.error("WARN: " + heading + " 下没有内容,本次发布不带变更说明");
}
// 按行累积到上限,不切半行,避免出现断句
const kept = [];
let total = 0;
for (const line of picked) {
const length = Array.from(line).length + (kept.length > 0 ? 1 : 0);
if (LIMIT < total + length) {
console.error("WARN: 内容超过 " + LIMIT + " 字,截断到第 " + kept.length + " 行");
break;
}
kept.push(line);
total += length;
}
// 尖括号转义:note 最终走 v-html 渲染,不能让 CHANGELOG 里的 HTML 被执行
const note = kept.join("\n").replace(/</g, "&lt;");
fs.writeFileSync("release-note.txt", note);
console.log("变更说明(" + Array.from(note).length + " 字):\n" + (note === "" ? "(空)" : note));
NODE
- name: Configure nexus auth
env:
NEXUS_USERNAME: ${{ secrets.NEXUS_USERNAME }}
@@ -149,13 +232,17 @@ jobs:
ARTIFACT_SIZE: ${{ steps.bundle.outputs.size }}
SHA256: ${{ steps.bundle.outputs.sha256 }}
ATTACHMENT_ID: ${{ steps.upload.outputs.attachment_id }}
NOTE_FILE: release-note.txt
run: |
if [ -z "$PRODUCT_ID" ]; then
echo "FAIL: 缺少 vars.APP_PRODUCT_ID"
exit 1
fi
payload=$(node -e "
const fs = require('fs');
const minCode = Number(process.env.MIN_VERSION_CODE || '1');
const noteFile = process.env.NOTE_FILE || 'release-note.txt';
const note = fs.existsSync(noteFile) ? fs.readFileSync(noteFile, 'utf8') : '';
process.stdout.write(JSON.stringify({
productId: process.env.PRODUCT_ID,
kind: 'BUNDLE',
@@ -164,7 +251,7 @@ jobs:
attachmentId: process.env.ATTACHMENT_ID,
artifactSize: Number(process.env.ARTIFACT_SIZE),
sha256: process.env.SHA256,
note: 'CI 构建 ${{ github.sha }}'.slice(0, 500)
note
}));
")
response=$(curl -sS -X POST "$API_BASE_URL/app/release/create" \
@@ -207,6 +294,13 @@ jobs:
echo "需要上线时调用 /app/release/publish?releaseId=${{ steps.create.outputs.release_id }}"
fi
echo "-----"
echo "变更说明(写入 App 更新日志):"
if [ -s release-note.txt ]; then
cat release-note.txt
else
echo "(空)CHANGELOG.md 中没有 v${{ steps.version.outputs.version }} 一节,本次发布不带更新说明"
fi
echo "-----"
echo "热更兼容最低原生版本:${{ vars.APP_MIN_VERSION_CODE }}"
echo "只有原生壳升级(增删原生插件)时才需要提高这个值,纯 JS 改动不用管"
echo "本次产物大小:${{ steps.bundle.outputs.size }} 字节"
+2
View File
@@ -131,6 +131,8 @@ dist
dist-ssr
coverage
*.local
# CI 从 CHANGELOG.md 提取的中间产物,发版 job 内生成
release-note.txt
# ---> WorkBuddy 本地工作目录
# 内含 AI 工作记忆与每日日志:写明本机绝对路径与调试上下文,且每次会话都在追加,
-1
View File
@@ -45,7 +45,6 @@ declare module 'vue' {
SegmentedSlider: typeof import('./src/components/SegmentedSlider.vue')['default']
StoreRemoveDialog: typeof import('./src/components/StoreRemoveDialog.vue')['default']
TagSelector: typeof import('./src/components/TagSelector.vue')['default']
TAvatar: typeof import('tdesign-mobile-vue')['Avatar']
TBadge: typeof import('tdesign-mobile-vue')['Badge']
TButton: typeof import('tdesign-mobile-vue')['Button']
TCalendar: typeof import('tdesign-mobile-vue')['Calendar']
+1 -1
View File
@@ -30,7 +30,7 @@
"less": "^4.3.0",
"pinia": "^3.0.2",
"tdesign-mobile-vue": "^1.17.1",
"timi-tdesign-mobile": "^1.1.1",
"timi-tdesign-mobile": "^1.2.0",
"timi-ts": "^1.0.0",
"timi-web": "^1.0.2",
"timi-web-api": "^1.0.2",
+5 -5
View File
@@ -47,8 +47,8 @@ importers:
specifier: ^1.17.1
version: 1.17.1(patch_hash=c98db305008fbfd00046666ca890e1c6cb88257c0619418694689cddf8cd78c3)(vue@3.5.40(typescript@5.8.3))
timi-tdesign-mobile:
specifier: ^1.1.1
version: 1.1.1(@floating-ui/dom@1.8.0)(@tiptap/core@3.33.0(@tiptap/pm@3.33.0))(@tiptap/extensions@3.33.0(@tiptap/core@3.33.0(@tiptap/pm@3.33.0))(@tiptap/pm@3.33.0))(typescript@5.8.3)(vue-router@4.5.1(vue@3.5.40(typescript@5.8.3)))(vue@3.5.40(typescript@5.8.3))
specifier: ^1.2.0
version: 1.2.0(@floating-ui/dom@1.8.0)(@tiptap/core@3.33.0(@tiptap/pm@3.33.0))(@tiptap/extensions@3.33.0(@tiptap/core@3.33.0(@tiptap/pm@3.33.0))(@tiptap/pm@3.33.0))(typescript@5.8.3)(vue-router@4.5.1(vue@3.5.40(typescript@5.8.3)))(vue@3.5.40(typescript@5.8.3))
timi-ts:
specifier: ^1.0.0
version: 1.0.0
@@ -2748,8 +2748,8 @@ packages:
through2@4.0.2:
resolution: {integrity: sha512-iOqSav00cVxEEICeD7TjLB1sueEL+81Wpzp2bY17uZjZN0pWZPuo4suZ/61VujxmqSGFfgOcNuTZ85QJwNZQpw==}
timi-tdesign-mobile@1.1.1:
resolution: {integrity: sha512-aR6SKu8zVbaqHRJHRtria3amvp9UKS6jTT99FNei38ZrP1sJDBsvCoQmWi0xzUD3F/wkGnSECWWrJQToqso6PQ==}
timi-tdesign-mobile@1.2.0:
resolution: {integrity: sha512-FW9LyZlh+aSjaG3tEXBf3+YYmm+OruYVH+atQMFmlCT33q3e6Gt0rr6n6d4vLH5n0tzyidlAJ0hmrvKspKKDdw==}
engines: {node: '>=20.0.0'}
peerDependencies:
vue: ^3.5.0
@@ -5849,7 +5849,7 @@ snapshots:
dependencies:
readable-stream: 3.6.2
timi-tdesign-mobile@1.1.1(@floating-ui/dom@1.8.0)(@tiptap/core@3.33.0(@tiptap/pm@3.33.0))(@tiptap/extensions@3.33.0(@tiptap/core@3.33.0(@tiptap/pm@3.33.0))(@tiptap/pm@3.33.0))(typescript@5.8.3)(vue-router@4.5.1(vue@3.5.40(typescript@5.8.3)))(vue@3.5.40(typescript@5.8.3)):
timi-tdesign-mobile@1.2.0(@floating-ui/dom@1.8.0)(@tiptap/core@3.33.0(@tiptap/pm@3.33.0))(@tiptap/extensions@3.33.0(@tiptap/core@3.33.0(@tiptap/pm@3.33.0))(@tiptap/pm@3.33.0))(typescript@5.8.3)(vue-router@4.5.1(vue@3.5.40(typescript@5.8.3)))(vue@3.5.40(typescript@5.8.3)):
dependencies:
tdesign-mobile-vue: 1.17.1(patch_hash=c98db305008fbfd00046666ca890e1c6cb88257c0619418694689cddf8cd78c3)(vue@3.5.40(typescript@5.8.3))
timi-web: 1.0.2(@floating-ui/dom@1.8.0)(@tiptap/core@3.33.0(@tiptap/pm@3.33.0))(@tiptap/extensions@3.33.0(@tiptap/core@3.33.0(@tiptap/pm@3.33.0))(@tiptap/pm@3.33.0))(typescript@5.8.3)(vue@3.5.40(typescript@5.8.3))
+31
View File
@@ -0,0 +1,31 @@
import { axios } from "timi-web-api";
import type { AppUpdateNotesQuery, AppUpdateNotesResult } from "@/types/AppUpdate";
const URI = "/app/update";
/**
* 查询更新日志
*
* 区间为「当前版本 → 通道当前版本」,与灰度无关,免登录态
*
* @param query 查询参数,versionName 传当前运行的 Web 包版本
* @returns 变更说明列表,按版本号从新到旧
*/
async function notes(query: AppUpdateNotesQuery): Promise<AppUpdateNotesResult> {
const { appId, versionName, versionCode, platform, channel } = query;
// 后端按 Capgo 插件的上报协议接收下划线字段,只在这一层转换
/* eslint-disable camelcase */
const payload = {
app_id: appId,
version_name: versionName,
version_code: versionCode,
platform,
channel
};
/* eslint-enable camelcase */
return await axios.post(`${URI}/notes`, payload);
}
export default {
notes
};
+14 -2
View File
@@ -6,11 +6,23 @@ import { ref } from "vue";
/** 自动更新的存储键 */
export const AUTO_UPDATE_KEY = "app.autoUpdate";
/** Capacitor appId,与 capacitor.config.ts 保持一致 */
export const APP_ID = "com.imyeyu.gao.customer";
/**
* 服务端下发的更新信息
*
* 在插件协议基础上多一个 note:更新说明由后端附加,插件不识别但会原样透传
*/
export type UpdateInfo = LatestVersion & {
note?: string;
};
// 模块级状态,页面与启动逻辑共享同一份
const supported = Capacitor.isNativePlatform();
const currentVersion = ref("");
const nativeVersion = ref("");
const latest = ref<LatestVersion | null>(null);
const latest = ref<UpdateInfo | null>(null);
const checking = ref(false);
const downloading = ref(false);
const percent = ref(0);
@@ -34,7 +46,7 @@ async function loadCurrent(): Promise<void> {
}
/** 查询服务端最新版本 */
async function check(): Promise<LatestVersion | null> {
async function check(): Promise<UpdateInfo | null> {
if (!supported) {
error.value = "仅在 App 内可用";
return null;
+78 -57
View File
@@ -1,5 +1,5 @@
<template>
<div class="tui-page-layout tui-navbar">
<div class="tui-page-layout tui-navbar about">
<t-navbar
fixed
:z-index="20"
@@ -7,47 +7,65 @@
left-arrow
@left-click="$router.back()"
/>
<main class="tui-page-content scroll column">
<div class="about-page">
<section class="brand" v-entrance-transition>
<logo @click="handleLogoClick" />
<h1 v-text="appName" />
<p v-text="`版本 ${displayVersion}`" />
<p v-text="appDescription" />
</section>
<t-cell-group v-if="agreementItemList.length" theme="card" v-entrance-transition>
<t-cell
v-for="item in agreementItemList"
:key="item.id"
:title="item.title"
arrow
hover
@click="openAgreement(item)"
<master-detail-page
class="list"
:split="isWide"
:selected="!!selectedId"
:direction="paneDirection"
>
<template #master>
<div class="about-page tui-page-content column">
<section class="brand" v-entrance-transition>
<logo @click="handleLogoClick" />
<h1 v-text="appName" />
<p class="version" v-text="`版本 ${displayVersion}`" />
<p class="description" v-text="appDescription" />
</section>
<t-cell-group
v-if="agreementItemList.length"
theme="card"
v-entrance-transition
>
<template #leftIcon>
<t-icon :name="item.icon" size="1.75rem" />
</template>
</t-cell>
</t-cell-group>
<t-empty
v-else
:description="isLoading ? '正在加载协议配置' : '暂无可用协议'"
<t-cell
v-for="item in agreementItemList"
:key="item.id"
:title="item.title"
arrow
hover
@click="openAgreement(item)"
>
<template #leftIcon>
<t-icon :name="item.icon" size="1.75rem" />
</template>
</t-cell>
</t-cell-group>
<t-empty
v-else
:description="isLoading ? '正在加载协议配置' : '暂无可用协议'"
/>
<t-cell-group theme="card" v-entrance-transition>
<t-cell title="版本更新" arrow hover @click="openDetail('update')">
<template #leftIcon>
<t-icon name="download" size="1.75rem" />
</template>
</t-cell>
</t-cell-group>
<footer class="footer" v-entrance-transition>
<p>技术支持:夜雨</p>
<p>联系技术:imyeyu@qq.com</p>
<p>短信服务支持:广州易保网络科技有限公司</p>
<p>Copyright © 2026 imyeyu.com</p>
</footer>
</div>
</template>
<template #detail>
<app-update v-if="selectedId === 'update'" />
<agreement
v-else-if="selectedId?.startsWith('agreement:')"
:article-id="selectedId.slice(10)"
/>
<t-cell-group v-if="updateSupported" theme="card" v-entrance-transition>
<t-cell title="版本更新" arrow hover @click="router.push({ name: 'AppUpdate' })">
<template #leftIcon>
<t-icon name="download" size="1.75rem" />
</template>
</t-cell>
</t-cell-group>
<footer class="footer" v-entrance-transition>
<p>技术支持:夜雨</p>
<p>联系技术:imyeyu@qq.com</p>
<p>短信服务支持:广州易保网络科技有限公司</p>
<p>Copyright © 2026 imyeyu.com</p>
</footer>
</div>
</main>
</template>
</master-detail-page>
</div>
</template>
@@ -55,6 +73,9 @@
import { version } from "../../../package.json";
import { useAppUpdate } from "@/composables/useAppUpdate";
import { SettingAPI } from "timi-web-api";
import { MasterDetailPage, useMasterDetailPane } from "timi-tdesign-mobile";
import Agreement from "@/pages/setting/Agreement.vue";
import AppUpdate from "@/pages/setting/AppUpdate.vue";
import Logo from "@/pages/user/component/Logo.vue";
import { getErrorMessage } from "@/utils/error";
import { Message } from "@/utils/message";
@@ -71,9 +92,12 @@ defineOptions({
});
const appName = "糕店客户管理";
const appDescription = "面向门店的客户、登记、积分与经营管理工具";
const router = useRouter();
const { supported: updateSupported, currentVersion, loadCurrent } = useAppUpdate();
const appDescription = "融合客户服务、门店经营与 AI 智能助手的一体化管理平台";
const { selectedId, paneDirection, isWide, openDetail } = useMasterDetailPane({
path: "/management/about",
detail: id => id === "update" ? "/management/about/update" : `/management/about/agreement/${encodeURIComponent(id.slice(10))}`
});
const { currentVersion, loadCurrent } = useAppUpdate();
const displayVersion = computed(() => currentVersion.value && currentVersion.value !== "builtin" ? currentVersion.value : version);
const agreementItemList = ref<AgreementItem[]>([]);
@@ -81,13 +105,8 @@ const isLoading = ref(false);
const handleLogoClick = createVConsoleClickHandler(toggleVConsole);
async function openAgreement(item: AgreementItem): Promise<void> {
await router.push({
name: "Agreement",
params: {
id: item.id
}
});
function openAgreement(item: AgreementItem): void {
openDetail(`agreement:${item.id}`);
}
function normalizeAgreementItem(value: unknown): AgreementItem | undefined {
@@ -145,10 +164,6 @@ onMounted(async () => {
<style scoped lang="less">
.about-page {
gap: 1rem;
display: flex;
padding: 0 0 5rem;
flex-direction: column;
.brand {
padding: 1rem;
@@ -159,17 +174,23 @@ onMounted(async () => {
}
h1 {
margin: .875rem 0 .5rem;
color: #0f172a;
margin: .875rem 0 .5rem;
font-size: 1.5rem;
font-weight: 700;
}
p {
margin: 0;
color: #52607a;
margin: 0;
}
.version {
font-size: .875rem;
line-height: 1.7;
}
.description {
font-size: .75rem;
}
}
+16 -5
View File
@@ -5,7 +5,7 @@
:z-index="20"
:title="routeNavBarTitle"
left-arrow
@left-click="$router.back()"
@left-click="goBack"
/>
<main class="tui-page-content scroll column">
<div class="agreement-page">
@@ -35,7 +35,7 @@
<script setup lang="ts">
import { type Article, ArticleAPI, AttachmentAPI } from "timi-web-api";
import { ArticleView } from "timi-tdesign-mobile";
import { ArticleView, usePane } from "timi-tdesign-mobile";
import { MarkdownView } from "timi-web";
import { getErrorMessage } from "@/utils/error";
import { Message } from "@/utils/message";
@@ -45,6 +45,17 @@ defineOptions({
});
const route = useRoute();
const router = useRouter();
const pane = usePane();
const props = defineProps<{ articleId?: string }>();
function goBack(): void {
if (pane) {
pane.close();
return;
}
router.back();
}
const routeNavBarTitle = computed(() => {
switch (route.name) {
@@ -57,7 +68,7 @@ const routeNavBarTitle = computed(() => {
case "OpenSourceAgreement":
return "开源软件协议";
default:
return "";
return "协议";
}
});
const article = ref<Article>();
@@ -72,7 +83,7 @@ async function loadArticle(): Promise<void> {
const requestToken = loadToken + 1;
loadToken = requestToken;
article.value = undefined;
const articleId = String(route.params.id || "").trim();
const articleId = String(props.articleId || route.params.id || "").trim();
if (!articleId) {
return;
}
@@ -93,7 +104,7 @@ async function loadArticle(): Promise<void> {
}
}
watch(() => route.params.id, async () => {
watch(() => props.articleId || route.params.id, async () => {
await loadArticle();
}, { immediate: true });
</script>
+141 -11
View File
@@ -1,11 +1,16 @@
<template>
<div class="tui-page-layout tui-navbar">
<t-navbar fixed :z-index="20" title="版本更新" left-arrow @left-click="$router.back()" />
<div class="tui-page-layout tui-navbar app-update">
<t-navbar
fixed
:z-index="20"
title="版本更新"
left-arrow
@left-click="goBack"
/>
<main class="tui-page-content scroll column">
<center-tips v-if="!updateSupported" content="仅在 App 内可用" />
<t-cell-group v-if="updateSupported" title="版本更新" theme="card" v-entrance-transition>
<t-cell-group v-if="updateSupported" theme="card" v-entrance-transition>
<t-cell title="外壳版本" :note="nativeVersion || '—'" />
<t-cell title="系统版本" :note="currentVersion || '—'" />
<t-cell title="系统版本" :note="displayVersion" />
<t-cell v-if="latestVersionText" title="最新版本" :note="latestVersionText" />
<t-cell title="自动更新">
<template #right-icon>
@@ -13,6 +18,9 @@
</template>
</t-cell>
</t-cell-group>
<t-cell-group v-else theme="card" v-entrance-transition>
<t-cell title="系统版本" :note="displayVersion" />
</t-cell-group>
<div v-if="updateSupported" class="update-panel" v-entrance-transition>
<center-tips v-if="updateHint"><span v-text="updateHint" /></center-tips>
<t-button
@@ -50,18 +58,71 @@
现在更新
</t-button>
</div>
<section v-if="noteList.length" class="versions">
<h2 class="title" v-text="noteTitle" />
<timeline>
<timeline-item
class="version"
v-for="item in noteList"
:key="item.version"
v-entrance-transition
>
<template #label>
<div class="label">
<t-tag
size="small"
theme="primary"
variant="light-outline"
:content="item.version"
/>
<time-label class="time" :timestamp="item.publishedAt" />
</div>
</template>
<markdown-view class="content bg-white" :content="item.note" />
</timeline-item>
<timeline-item v-entrance-transition>
<template #label>
<div class="label">
<t-tag
size="small"
theme="primary"
variant="light-outline"
content="..."
/>
</div>
</template>
</timeline-item>
</timeline>
</section>
</main>
</div>
</template>
<script setup lang="ts">
import { setAutoUpdate, useAppUpdate } from "@/composables/useAppUpdate";
import { version } from "../../../package.json";
import { Capacitor } from "@capacitor/core";
import { Timeline, TimelineItem, usePane } from "timi-tdesign-mobile";
import { MarkdownView, TimeLabel } from "timi-web";
import AppUpdateAPI from "@/api/AppUpdateAPI";
import { APP_ID, setAutoUpdate, useAppUpdate } from "@/composables/useAppUpdate";
import type { AppUpdateNote } from "@/types/AppUpdate";
import { Message } from "@/utils/message";
defineOptions({
name: "AppUpdate"
});
const router = useRouter();
const pane = usePane();
function goBack(): void {
if (pane) {
pane.close();
return;
}
router.back();
}
// ---------- 版本更新 ----------
const {
@@ -83,6 +144,11 @@ const {
restorePending
} = useAppUpdate();
/** 系统版本:原生端优先取热更包版本,未热更过或 web 端回落到构建版本 */
const displayVersion = computed<string>(
() => (currentVersion.value && currentVersion.value !== "builtin" ? currentVersion.value : version)
);
/** 有更新时展示目标版本号 */
const latestVersionText = computed<string>(() => (hasUpdate() ? `v${latest.value?.version ?? ""}` : ""));
@@ -117,11 +183,43 @@ const updateHint = computed<string>(() => {
return "";
});
// ---------- 更新日志 ----------
/** web 端只展示最近几个版本 */
const WEB_NOTE_LIMIT = 3;
const noteList = ref<AppUpdateNote[]>([]);
const noteTitle = computed<string>(() => (updateSupported ? "更新内容" : "最近更新"));
/** 查询当前版本到通道最新版本之间的变更说明 */
async function loadNotes(): Promise<void> {
try {
const result = await AppUpdateAPI.notes({
appId: APP_ID,
// web 端没有热更包版本,从内置包开始算,后端会返回通道的完整历史
versionName: updateSupported ? currentVersion.value || "builtin" : "builtin",
platform: Capacitor.getPlatform(),
channel: "stable"
});
const list = result?.notes ?? [];
noteList.value = updateSupported ? list : list.slice(0, WEB_NOTE_LIMIT);
} catch {
// 日志不是关键路径,失败时安静降级,不弹错误
noteList.value = [];
}
}
// ---------- 生命周期 ----------
onMounted(async () => {
await loadCurrent();
await restorePending();
await loadNotes();
});
// ---------- 交互 ----------
function handleAutoUpdateChange(value: boolean | string | number): void {
setAutoUpdate(value === true);
}
@@ -135,6 +233,8 @@ async function handleCheck(): Promise<void> {
if (!hasUpdate()) {
Message.info("已是最新版本");
}
// 检查后目标版本可能变化,重查一次日志
await loadNotes();
}
async function handleDownload(): Promise<void> {
@@ -156,14 +256,44 @@ async function handleApply(): Promise<void> {
</script>
<style scoped lang="less">
.update-panel {
gap: .75rem;
display: flex;
flex-direction: column;
.app-update {
.progress {
margin: 0 1rem;
}
.versions {
gap: .5rem;
display: flex;
padding: .25rem 1rem 1rem;
flex-direction: column;
.title {
color: var(--td-text-color-secondary);
margin: .5rem .25rem 0;
font-size: .8125rem;
font-weight: 500;
}
.version {
.label {
gap: .5rem;
display: flex;
align-items: center;
.time {
font-size: .875rem;
}
}
.content {
padding: .5rem;
font-size: .875rem;
margin-top: .5rem;
border-radius: 1rem;
}
}
}
}
</style>
+35
View File
@@ -0,0 +1,35 @@
/**
* 更新日志查询参数
*
* 内部用驼峰,下划线协议字段在 API 层转换,避免业务代码出现 snake_case
*/
export type AppUpdateNotesQuery = {
/** 产品标识,与 capacitor.config.ts 的 appId 一致 */
appId: string;
/** 当前运行的 Web 包版本,内置包为 builtin */
versionName?: string;
/** 当前原生 versionCode */
versionCode?: string;
/** 平台 */
platform?: string;
/** 通道代码 */
channel?: string;
};
/** 单条版本变更说明 */
export type AppUpdateNote = {
/** 版本号 */
version: string;
/** 变更说明,markdown 原文 */
note: string;
/** 首次发布时间,回滚上线的版本可能为空 */
publishedAt?: number;
};
/** 更新日志响应 */
export type AppUpdateNotesResult = {
/** 通道当前版本号,为空表示没有可展示的版本 */
version?: string;
/** 变更说明,按版本号从新到旧 */
notes: AppUpdateNote[];
};