This commit is contained in:
parent
3c81e81738
commit
6f4834d34a
|
|
@ -2,6 +2,7 @@
|
|||
"version" : "1.0",
|
||||
"configurations" : [
|
||||
{
|
||||
"customPlaygroundType" : "local",
|
||||
"playground" : "standard",
|
||||
"type" : "uni-app:app-android"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -37,6 +37,9 @@
|
|||
<text class="empty-text">暂无可用功能模块</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 版本更新弹窗 -->
|
||||
<update-dialog :visible="showUpdate" :downloadUrl="updateUrl" :forceUpdate="forceUpdate" @close="showUpdate = false" />
|
||||
</view>
|
||||
</template>
|
||||
|
||||
|
|
@ -45,8 +48,14 @@ import { ref, computed } from 'vue'
|
|||
import { onLoad } from '@dcloudio/uni-app'
|
||||
import store from '@/store'
|
||||
import { getUserModules } from '@/services/permission'
|
||||
import { checkAppVersion } from '@/services/home'
|
||||
import { APP_VERSION } from '@/services/api'
|
||||
import updateDialog from '@/components/update-dialog.vue'
|
||||
|
||||
const statusBarHeight = uni.getSystemInfoSync().statusBarHeight || 0
|
||||
const showUpdate = ref(false)
|
||||
const updateUrl = ref('')
|
||||
const forceUpdate = ref(false)
|
||||
|
||||
// 所有可用功能版块定义
|
||||
const allModules = [
|
||||
|
|
@ -77,7 +86,18 @@ function goSettings() {
|
|||
onLoad(() => {
|
||||
// 页面加载时刷新权限
|
||||
handleRefresh()
|
||||
// 检查版本更新
|
||||
loadVersionCheck()
|
||||
})
|
||||
|
||||
async function loadVersionCheck() {
|
||||
const res = await checkAppVersion(APP_VERSION)
|
||||
if (res.code === 200 && res.data && res.data.needUpdate) {
|
||||
updateUrl.value = res.data.downloadUrl || ''
|
||||
forceUpdate.value = !!res.data.forceUpdate
|
||||
showUpdate.value = true
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
|
|
|||
|
|
@ -1 +0,0 @@
|
|||
forceInstall
|
||||
Binary file not shown.
Loading…
Reference in New Issue
Block a user