#
whycq
2024-03-30 9ab6b38c098f857f2ce0772693142c930e4f9b6d
uni_modules/uni-upgrade-center-app/utils/call-check-version.js
New file
@@ -0,0 +1,29 @@
export default function() {
   // #ifdef APP-PLUS
   return new Promise((resolve, reject) => {
      plus.runtime.getProperty(plus.runtime.appid, function(widgetInfo) {
         uniCloud.callFunction({
            name: 'check-version',
            data: {
               appid: plus.runtime.appid,
               appVersion: plus.runtime.version,
               wgtVersion: widgetInfo.version
            },
            success: (e) => {
               resolve(e)
            },
            fail: (error) => {
               reject(error)
            }
         })
      })
   })
   // #endif
   // #ifndef APP-PLUS
   return new Promise((resolve, reject) => {
      reject({
         message: '请在App中使用'
      })
   })
   // #endif
}