根据ua处理下载按钮
All checks were successful
site-dist-deploy / build-and-deploy (push) Successful in 1m39s

This commit is contained in:
speakeloudest 2026-02-24 09:30:06 +02:00
parent 67eb210ded
commit 3599d413d9

View File

@ -72,16 +72,33 @@ const currentPlatform = ref('win')
onMounted(() => { onMounted(() => {
const ua = navigator.userAgent; const ua = navigator.userAgent;
if (/Macintosh|Mac OS X/i.test(ua)) { const platform = navigator.platform || ''; //
currentPlatform.value = 'mac'
} else if (/iPhone|iPad|iPod/i.test(ua)) { // 1. Android ()
currentPlatform.value = 'ios' if (/Android/i.test(ua)) {
} else if (/Android/i.test(ua)) { currentPlatform.value = 'android';
currentPlatform.value = 'android'
} else {
currentPlatform.value = 'win'
} }
}) // 2. iOS (iPhone, iPod)
else if (/iPhone|iPod/i.test(ua)) {
currentPlatform.value = 'ios';
}
// 3. Mac iPad
else if (/Macintosh|Mac OS X/i.test(ua)) {
// iPadOS > 1
// Mac maxTouchPoints 0 undefined
if (navigator.maxTouchPoints > 1) {
currentPlatform.value = 'ios'; // iOS iPad
} else {
currentPlatform.value = 'mac';
}
}
// 4. Windows
else {
currentPlatform.value = 'win';
}
console.log('Detected Platform:', currentPlatform.value);
});
request.get('/api/v1/common/client/download', { request.get('/api/v1/common/client/download', {
invite_code: getAllQueryString('ic'), invite_code: getAllQueryString('ic'),