From 55ce8b83eb36a1e91debe1682430a3525459d901 Mon Sep 17 00:00:00 2001 From: 15233722133 <15233722133@163.com> Date: Wed, 3 Jun 2026 10:20:56 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E7=89=88=E6=9C=AC=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E4=BC=98=E5=8C=96=E9=9D=9E=E5=BC=BA=E5=88=B6=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.js | 3 + pages/public/login.vue | 62 --- sheep/platform/index.js | 11 +- utils/hotUpdate.js | 24 +- utils/vconsole.js | 855 ++++++++++++++++++++++++++++++++++++++++ 5 files changed, 885 insertions(+), 70 deletions(-) create mode 100644 utils/vconsole.js diff --git a/main.js b/main.js index 6e5a267..8146f51 100644 --- a/main.js +++ b/main.js @@ -16,11 +16,14 @@ import { } from '@/utils/common' import { createHotUpdate, createLoadingProgress } from '@/utils/hotUpdate' import { gethotupdatelist } from '@/sheep/api/index/index' +import { setupVConsole } from '@/utils/vconsole.js' export function createApp() { + setupVConsole(); + const hotUpdate = createHotUpdate({ progress: createLoadingProgress(), apkMode: 'download', diff --git a/pages/public/login.vue b/pages/public/login.vue index 243443c..9d74f70 100644 --- a/pages/public/login.vue +++ b/pages/public/login.vue @@ -81,7 +81,6 @@ import { ref, reactive } from 'vue'; import sheep from '@/sheep'; import { onLoad } from '@dcloudio/uni-app'; - import { gethotupdatelist } from '@/sheep/api/index/index'; import AuthUtil from '@/sheep/api/member/auth'; let type = ref(2); let formData = reactive({}); @@ -334,67 +333,6 @@ const windowHeight = sysInfo.windowHeight; let height = ref(0); height.value = sysInfo.statusBarHeight + uni.upx2px(88); - - const wgtUp = async () => { - // console.log(plus.runtime); - - let res = await gethotupdatelist(); - if (res.code !== 0) return; - let filePath = res.data.filePath; - let localVersion = uni.getSystemInfoSync().appWgtVersion; - if (res.data.versionNumber != localVersion) { - uni.showModal({ - title: '提示', - content: '发现新的版本,是否更新?', - confirmColor: '#FA7E31', - success: (res) => { - downloadFile(filePath); - }, - }); - } - }; - const downloadFile = (url) => { - uni.downloadFile({ - url: url, - success: (downloadResult) => { - uni.showToast({ - title: '更新中....', - icon: 'none', - }); - if (downloadResult) { - if (downloadResult.statusCode === 200) { - plus.runtime.install( - downloadResult.tempFilePath, - { - force: true, - }, - function () { - uni.showModal({ - title: '成功提示', - content: '热更新成功,请重启应用', - confirmColor: '#FA7E31', - showCancel: false, - success: function (res) { - if (res.confirm) { - plus.runtime.restart(); //自动重启软件 - } - }, - }); - }, - function (e) { - uni.showModal({ - title: '失败提示', - content: e, - showCancel: false, - confirmColor: '#FA7E31', - }); - }, - ); - } - } - }, - }); - };