Skip to content

Commit a6b7fbc

Browse files
committed
change api url
1 parent ce0d32a commit a6b7fbc

11 files changed

Lines changed: 54 additions & 44 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,14 @@ jobs:
3333
env:
3434
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3535

36-
- name: Upload to cos
37-
uses: TencentCloud/cos-action@v1
36+
- name: Deploy static to Tencent CloudBase
37+
id: deployStatic
38+
uses: TencentCloudBase/cloudbase-action@v1
3839
with:
39-
secret_id: ${{ secrets.TENCENT_CLOUD_SECRET_ID }}
40-
secret_key: ${{ secrets.TENCENT_CLOUD_SECRET_KEY }}
41-
cos_bucket: ${{ secrets.COS_BUCKET }}
42-
cos_region: ${{ secrets.COS_REGION }}
43-
local_path: dist
44-
remote_path: /
45-
clean: true
40+
secretId: ${{ secrets.TENCENT_CLOUD_SECRET_ID }}
41+
secretKey: ${{ secrets.TENCENT_CLOUD_SECRET_KEY }}
42+
envId: ${{ secrets.ENV_ID }}
43+
staticSrcPath: dist
44+
45+
- name: Get the deploy result
46+
run: echo "Deploy to cloudbase result ${{ steps.deployStatic.outputs.deployResult }}"

assets/screenshots/accounts-cn.png

386 Bytes
Loading

assets/screenshots/accounts.png

-95 Bytes
Loading

assets/screenshots/home-cn.png

566 Bytes
Loading

assets/screenshots/home.png

348 Bytes
Loading

assets/screenshots/plugins.png

-566 Bytes
Loading

assets/screenshots/versions-cn.png

61 Bytes
Loading

assets/screenshots/versions.png

-6.58 KB
Loading

src/index.ts

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
const data: { os: { name?: string }, cpu: { architecture?: string } } = new (window as any).UAParser().getResult()
22

33
const os = (data.os.name || '').toLowerCase()
4+
const isX64 = (data.cpu.architecture || '').indexOf('64') !== -1
45

56
const cn = {
67
home: require('../assets/screenshots/home-cn.png'),
@@ -17,19 +18,19 @@ const en = {
1718
const 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 {

src/release.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,12 @@ const f1 = (window as any).setLanguague = (str: string, exec: boolean) => {
33
const isCN = str === 'zh-cn'
44
$('[data-ext]').each((_, it) => {
55
const e = $(it)
6+
const ext = e.data('ext')
67
e.prop(
78
'href',
8-
`https://xmcl.azurewebsites.net/api/pl-get-release?ext=${e.data('ext')}&gfw=${isCN}`
9+
isCN
10+
? 'https://dl.pl.apisium.cn/pl/PureLauncher.' + ext
11+
: 'https://github.com/Apisium/PureLauncher/releases/latest/download/PureLauncher.' + ext
912
)
1013
})
1114
if (!exec) fn1(str)

0 commit comments

Comments
 (0)