File tree 1 file changed +24
-14
lines changed
packages/uni-h5/src/service/api/device
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>(
31
31
system,
32
32
deviceOrientation,
33
33
deviceType,
34
+ osname,
35
+ osversion,
34
36
} = browserInfo
35
37
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
+ )
50
60
}
51
61
)
52
62
export const getAppBaseInfo = defineSyncApi < typeof uni . getAppBaseInfo > (
You can’t perform that action at this time.
0 commit comments