Skip to content

Commit 543fc9f

Browse files
committed
fix mac val
1 parent 6fb4a67 commit 543fc9f

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/components/crossPlatforms.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const currenClickPlatform = ref('');
99
if (deviceType.value !== 'other') {
1010
currenClickPlatform.value = deviceType.value;
1111
} else {
12-
deviceType.value = 'mac';
12+
currenClickPlatform.value = 'apple';
1313
}
1414
1515
function showCode(type: string) {

src/hooks/detectDeviceType.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { Ref, ref } from 'vue';
22
import DeviceDetector from 'device-detector-js';
33

4-
type osType = 'linux' | 'windows' | 'mac' | 'other';
4+
type osType = 'linux' | 'windows' | 'apple' | 'other';
55

66
const deviceDetector = new DeviceDetector();
77

@@ -10,7 +10,7 @@ export const useDetectDeviceType = () => {
1010
const useAgent = navigator.userAgent;
1111
const name = deviceDetector.parse(useAgent).os?.name;
1212
if (name === 'Mac') {
13-
deviceType.value = 'mac';
13+
deviceType.value = 'apple';
1414
} else if (name?.includes('Windows')) {
1515
deviceType.value = 'windows';
1616
} else if (name?.includes('Linux') || name?.includes('Debian') || name?.includes('Ubuntu')) {

0 commit comments

Comments
 (0)