mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/student-h5.git
synced 2025-12-06 09:26:46 +08:00
feat:苹果手机windows.open失效问题
This commit is contained in:
@@ -112,10 +112,16 @@ function downloadFile(url) {
|
||||
"url222",
|
||||
import.meta.env.VITE_BOE_API_URL + import.meta.env.VITE_FILE_PATH + url
|
||||
);
|
||||
window.open(
|
||||
import.meta.env.VITE_BOE_API_URL + import.meta.env.VITE_FILE_PATH + url,
|
||||
"_top"
|
||||
);
|
||||
let userAgent = navigator.userAgent;
|
||||
let isiOS = !!userAgent.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/);
|
||||
if(isiOS){
|
||||
window.location.href = import.meta.env.VITE_BOE_API_URL + import.meta.env.VITE_FILE_PATH + url;
|
||||
}else{
|
||||
window.open(
|
||||
import.meta.env.VITE_BOE_API_URL + import.meta.env.VITE_FILE_PATH + url,
|
||||
"_top"
|
||||
);
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
|
||||
Reference in New Issue
Block a user