File tree Expand file tree Collapse file tree 1 file changed +24
-14
lines changed
packages/uni-h5/src/service/api/device Expand file tree Collapse file tree 1 file changed +24
-14
lines changed Original file line number Diff line number Diff line change @@ -31,22 +31,32 @@ export const getDeviceInfo = defineSyncApi<typeof uni.getDeviceInfo>(
3131 system,
3232 deviceOrientation,
3333 deviceType,
34+ osname,
35+ osversion,
3436 } = browserInfo
3537
36- return {
37- brand,
38- deviceBrand,
39- deviceModel,
40- devicePixelRatio : __NODE_JS__ ? 1 : window . devicePixelRatio ,
41- deviceId : __NODE_JS__
42- ? Date . now ( ) + '' + Math . floor ( Math . random ( ) * 1e7 )
43- : deviceId ( ) ,
44- deviceOrientation,
45- deviceType,
46- model,
47- platform,
48- system,
49- }
38+ return extend (
39+ {
40+ brand,
41+ deviceBrand,
42+ deviceModel,
43+ devicePixelRatio : __NODE_JS__ ? 1 : window . devicePixelRatio ,
44+ deviceId : __NODE_JS__
45+ ? Date . now ( ) + '' + Math . floor ( Math . random ( ) * 1e7 )
46+ : deviceId ( ) ,
47+ deviceOrientation,
48+ deviceType,
49+ model,
50+ platform,
51+ system,
52+ } ,
53+ __X__
54+ ? {
55+ osName : osname ? osname . toLocaleLowerCase ( ) : undefined ,
56+ osVersion : osversion ,
57+ }
58+ : { }
59+ )
5060 }
5161)
5262export const getAppBaseInfo = defineSyncApi < typeof uni . getAppBaseInfo > (
You can’t perform that action at this time.
0 commit comments