11const data : { os : { name ?: string } , cpu : { architecture ?: string } } = new ( window as any ) . UAParser ( ) . getResult ( )
22
33const os = ( data . os . name || '' ) . toLowerCase ( )
4+ const isX64 = ( data . cpu . architecture || '' ) . indexOf ( '64' ) !== - 1
45
56const cn = {
67 home : require ( '../assets/screenshots/home-cn.png' ) ,
@@ -17,19 +18,19 @@ const en = {
1718const changeText = ( ) => {
1819 let text : string
1920 let ext : string
20- if ( os . startsWith ( 'android' ) || os . startsWith ( 'blackberry' ) || os . startsWith ( 'ios' ) || os . startsWith ( 'windows phone' ) ) {
21+ if ( os === 'android' || os === 'blackberry' || os === 'ios' || os === 'windows phone' ) {
2122 text = $i ( 'notSupport' )
2223 $ ( '#download-now' ) . prop ( 'disabled' , true )
23- } else if ( os . startsWith ( 'windows' ) ) {
24- text = `Windows ${ $i ( '32' ) } `
24+ } else if ( os === 'windows' ) {
25+ text = `Windows ${ $i ( isX64 ? '64' : '32' ) } `
2526 ext = 'exe'
26- } else if ( os . startsWith ( 'mac os' ) ) {
27+ } else if ( os === 'mac os' ) {
2728 text = `MACOS ${ $i ( '64' ) } `
2829 ext = 'dmg'
29- } else if ( os . startsWith ( 'debian' ) || os . startsWith ( 'ubuntu' ) || os . startsWith ( 'deepin' ) ) {
30+ } else if ( os === 'debian' || os === 'ubuntu' || os === 'deepin' ) {
3031 text = `Debian Linux ${ $i ( '64' ) } `
3132 ext = 'deb'
32- } else if ( os . startsWith ( 'redhat' ) || os . startsWith ( 'suse' ) || os . startsWith ( 'centos' ) ) {
33+ } else if ( os === 'redhat' || os === 'suse' || os === 'centos' ) {
3334 text = `RedHat Linux ${ $i ( '64' ) } `
3435 ext = 'rpm'
3536 } else {
@@ -40,7 +41,9 @@ const changeText = () => {
4041 if ( ext ) {
4142 $ ( '#release-type' ) . text ( text + ` (${ ext } )` )
4243 btn . onclick = ( ) => void window . open (
43- `https://xmcl.azurewebsites.net/api/pl-get-release?ext=${ ext } &gfw=${ ( window as any ) . currentLang === 'zh-cn' } ` ,
44+ ( window as any ) . currentLang === 'zh-cn'
45+ ? 'https://dl.pl.apisium.cn/pl/PureLauncher.' + ext
46+ : 'https://github.com/Apisium/PureLauncher/releases/latest/download/PureLauncher.' + ext ,
4447 '_blank'
4548 )
4649 } else {
0 commit comments