App端插件:
https://ext.dcloud.net.cn/plugin?id=4542
網頁端后台(統一管理多個app的整包和熱更新):
https://ext.dcloud.net.cn/plugin?id=4470
網頁端后台我是自己搭了一個,並且通過uniCloud托管后台網頁
新增一個app的更新步驟
1、把uni-upgrade-center - App插件引入項目
2、 找到/uni_modules/uni-upgrade-center-app/uniCloud/cloudfunctions/check-version
,右鍵上傳部署
3、在pages.json
中添加頁面路徑
"pages": [ // ……其他頁面配置 { "path": "uni_modules/uni-upgrade-center-app/pages/upgrade-popup", "style": { "disableScroll": true, "app-plus": { "backgroundColorTop": "transparent", "background": "transparent", "titleNView": false, "scrollIndicator": false, "popGesture": "none", "animationType": "fade-in", "animationDuration": 200 } } } ]
4、將/uni_modules/uni-upgrade-center-app/utils/check-update
import到需要用到的地方,調用一下即可,我這邊是放在App.vue中
// #ifdef APP-PLUS import updata from '@/uni_modules/uni-upgrade-center-app/utils/check-update' // #endif export default { onLaunch: function() { // #ifdef APP-PLUS updata() // #endif }
5、創建uniCloud雲開發環境,選擇阿里雲,
然后關聯到后台的的服務空間
這樣就可以了
uniCloud和uni_modules里的是同一個,並且會自動同步