From 04bb5e65d3344949abe402d3d484403e20ed6d20 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Tue, 29 Apr 2025 19:58:27 +0800 Subject: [PATCH] =?UTF-8?q?reactor=EF=BC=9Aplatform=20=E7=9A=84=E8=8E=B7?= =?UTF-8?q?=E5=8F=96=EF=BC=8C=E4=BB=8E=20getSystemInfoSync=20=E8=BF=81?= =?UTF-8?q?=E7=A7=BB=E5=88=B0=20getAppBaseInfo?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sheep/helper/const.js | 2 +- sheep/helper/index.js | 2 +- sheep/libs/permission.js | 4 +--- sheep/platform/index.js | 2 +- uni_modules/uni-fab/components/uni-fab/uni-fab.vue | 3 +-- .../uni-load-more/components/uni-load-more/uni-load-more.vue | 2 +- 6 files changed, 6 insertions(+), 9 deletions(-) diff --git a/sheep/helper/const.js b/sheep/helper/const.js index 45a63660..42e623c3 100644 --- a/sheep/helper/const.js +++ b/sheep/helper/const.js @@ -17,7 +17,7 @@ export const TerminalEnum = { * @return 终端 */ export const getTerminal = () => { - const platformType = uni.getSystemInfoSync().uniPlatform; + const platformType = uni.getAppBaseInfo().uniPlatform; // 与后端terminal枚举一一对应 switch (platformType) { case 'app': diff --git a/sheep/helper/index.js b/sheep/helper/index.js index 531dcd56..baed3e47 100644 --- a/sheep/helper/index.js +++ b/sheep/helper/index.js @@ -45,7 +45,7 @@ export function sleep(value = 30) { * @link 运行期判断平台 https://uniapp.dcloud.io/frame?id=判断平台 */ export function os() { - return uni.getSystemInfoSync().platform.toLowerCase(); + return uni.getDeviceInfo().platform.toLowerCase(); } /** * @description 获取系统信息同步接口 diff --git a/sheep/libs/permission.js b/sheep/libs/permission.js index 59f9413b..3e05a268 100644 --- a/sheep/libs/permission.js +++ b/sheep/libs/permission.js @@ -234,9 +234,7 @@ function gotoAppPermissionSetting() { const permission = { get isIOS() { - return typeof isIOS === 'boolean' - ? isIOS - : (isIOS = uni.getSystemInfoSync().platform === 'ios'); + return typeof isIOS === 'boolean' ? isIOS : (isIOS = uni.getDeviceInfo().platform === 'ios'); }, requestIOS: requestIOS, requestAndroid: requestAndroid, diff --git a/sheep/platform/index.js b/sheep/platform/index.js index 0956bb03..c0bb0ec7 100644 --- a/sheep/platform/index.js +++ b/sheep/platform/index.js @@ -20,7 +20,7 @@ import Pay from './pay'; const device = uni.getSystemInfoSync(); -const os = device.platform; +const os = uni.getDeviceInfo().platform; let name = ''; let provider = ''; diff --git a/uni_modules/uni-fab/components/uni-fab/uni-fab.vue b/uni_modules/uni-fab/components/uni-fab/uni-fab.vue index 39fac195..dcb44f00 100644 --- a/uni_modules/uni-fab/components/uni-fab/uni-fab.vue +++ b/uni_modules/uni-fab/components/uni-fab/uni-fab.vue @@ -82,10 +82,9 @@