// #ifdef APP-PLUS
import checkVersion from '@/uni_modules/uni-upgrade-center-app/utils/check-update'

// #endif

export function checkUpgrade(toast = false) {
    // #ifdef APP-PLUS
    // 版本更新检查
    if (toast) {
        Message.loading('正在检查更新...')
    }
    checkVersion()
        .then((res) => {
            if (toast && res?.result?.code === 0) {
                Message.toast('已是最新版本~')
            }
        })
        .finally(() => {
            if (toast) {
                Message.hideLoading()
            }
        })
    // #endif
}
