diff --git a/packages/uni-app-plus/src/service/api/device/brightness.ts b/packages/uni-app-plus/src/service/api/device/brightness.ts index 51920845cdf9b55021041b72da7acbc48fb0443e..122d48137474ccc6fa6d1c1bfdd4923c7fc50050 100644 --- a/packages/uni-app-plus/src/service/api/device/brightness.ts +++ b/packages/uni-app-plus/src/service/api/device/brightness.ts @@ -12,7 +12,7 @@ export const getScreenBrightness = defineAsyncApi( API_GET_SCREEN_BRIGHTNESS, (_, { resolve }) => { - const value = plus.screen.getBrightness() + const value = (plus as any).screen.getBrightness(false) resolve({ value }) } ) @@ -21,7 +21,7 @@ export const setScreenBrightness = defineAsyncApi( API_SET_SCREEN_BRIGHTNESS, (options, { resolve }) => { - plus.screen.setBrightness(options.value) + ;(plus as any).screen.setBrightness(options.value, false) resolve() } )