feat(version): 桌面端更新面板支持指定版本安装
- 新增公开接口 GET /api/version/list(最近 50 条,字段口径同管理端列表), 桌面端下拉不再拼 OSS 地址(版本包被删后拼地址会 404) - 更新面板(登录页 + 首页)加「指定版本更新」选择器:默认选中最新版, 可选全部已发布版本(含回退),回退/同版给出明确文案与二次确认 - 客户端无需发版:do_update_app(file_url) 本就接受任意版本包直链
This commit is contained in:
@@ -33,6 +33,15 @@
|
||||
<div class="update-hint">{{ hint }}</div>
|
||||
<UpdateLogList :entries="changelog" />
|
||||
<UpdateProgressBar :progress="progress" />
|
||||
<VersionPicker
|
||||
:versions="versions"
|
||||
:current-version="currentVersion"
|
||||
:loading="versionListLoading"
|
||||
:error="versionListError"
|
||||
:updating="updating"
|
||||
@reload="loadVersions(true)"
|
||||
@update="doUpdateVersion"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -106,6 +115,7 @@ import { useVersionUpdate } from '@/shared/composables/useVersionUpdate'
|
||||
import { clearApiSecretCache } from '@/shared/utils/api-secret-store'
|
||||
import UpdateProgressBar from '@/shared/components/UpdateProgressBar.vue'
|
||||
import UpdateLogList from '@/shared/components/UpdateLogList.vue'
|
||||
import VersionPicker from '@/shared/components/VersionPicker.vue'
|
||||
|
||||
const router = useRouter()
|
||||
|
||||
@@ -126,7 +136,7 @@ const rememberPassword = ref(false)
|
||||
const autoLogin = ref(false)
|
||||
const updateOpen = ref(false)
|
||||
|
||||
// 版本检测 / 更新:登录页与首页共用逻辑
|
||||
// 版本检测 / 更新:登录页与首页共用逻辑(指定版本更新见 VersionPicker)
|
||||
const {
|
||||
checking,
|
||||
updating,
|
||||
@@ -138,8 +148,13 @@ const {
|
||||
checked,
|
||||
progress,
|
||||
changelog,
|
||||
versions,
|
||||
versionListLoading,
|
||||
versionListError,
|
||||
loadVersions,
|
||||
runCheck,
|
||||
doUpdate,
|
||||
doUpdateVersion,
|
||||
} = useVersionUpdate()
|
||||
|
||||
function b64Decode(value: string): string {
|
||||
@@ -354,6 +369,10 @@ function toggleUpdate() {
|
||||
if (updateOpen.value && !checked.value && !checking.value) {
|
||||
void runCheck()
|
||||
}
|
||||
// 指定版本更新的可选版本:首次展开面板时拉一次(模块级缓存,切换页面不重复请求)
|
||||
if (updateOpen.value) {
|
||||
void loadVersions()
|
||||
}
|
||||
}
|
||||
|
||||
async function submitLogin() {
|
||||
|
||||
Reference in New Issue
Block a user