app自動更新
This commit is contained in:
1 parent
31de6c4cd6
commit
699a26371a
7 files changed
+614
-156
No files matched your search
@@ -14,6 +14,9 @@ import { usePermission } from "@/permission/permission-context";
|
||||
import { pageUrl } from "@/router/routes";
|
||||
import authService from "@/service/security/authService";
|
||||
import { useLoginProfileStore } from "@/stores";
|
||||
// #ifdef APP-PLUS
|
||||
import { checkAppUpdate } from "@/utils/appUpdate";
|
||||
// #endif
|
||||
|
||||
const { t } = useLocale();
|
||||
|
||||
@@ -83,6 +86,13 @@ function onLineSaved(payload: { changed: boolean }): void {
|
||||
setTimeout(() => uni.reLaunch({ url: pageUrl("login") }), 1200);
|
||||
}
|
||||
|
||||
// #ifdef APP-PLUS
|
||||
/** 检查更新(仅 App):拉 FileServer 版本清单比对本机 versionCode,弹窗/下载/安装与失败提示都在 utils/appUpdate 里统一处理 */
|
||||
function handleCheckUpdate(): void {
|
||||
void checkAppUpdate(true);
|
||||
}
|
||||
// #endif
|
||||
|
||||
/** 进入「安全管理」枢纽页:权限体系等基础设定的聚合入口 */
|
||||
function goSecurity(): void {
|
||||
uni.navigateTo({ url: pageUrl("securityPage") });
|
||||
@@ -174,6 +184,22 @@ async function handleLogout(): Promise<void> {
|
||||
</view>
|
||||
<!-- #endif -->
|
||||
|
||||
<!-- 检查更新:仅 App;自检 FileServer 版本清单,发现新版走整包更新(逻辑见 utils/appUpdate.ts) -->
|
||||
<!-- #ifdef APP-PLUS -->
|
||||
<view class="mine-cell" @tap="handleCheckUpdate">
|
||||
<view class="mine-cell__icon">
|
||||
<u-icon name="download" size="30" color="#ffffff" />
|
||||
</view>
|
||||
<text class="mine-cell__title">
|
||||
{{ t("MinePage.checkUpdate") }}
|
||||
</text>
|
||||
<text class="mine-cell__value">
|
||||
v{{ APP_INFO.version }}
|
||||
</text>
|
||||
<u-icon name="arrow-right" size="32" color="#9aa0a6" />
|
||||
</view>
|
||||
<!-- #endif -->
|
||||
|
||||
<!-- 安全管理:进入权限体系基础设定聚合页(/security);仅授 SecurityActor 功能者可见 -->
|
||||
<view v-if="canSeeSecurity" class="mine-cell" @tap="goSecurity">
|
||||
<view class="mine-cell__icon">
|
||||
|
||||
Reference in new issue
Block a user