Skip to content

Commit

Permalink
feat:getCheckTextUrl增加获取可用域的逻辑,使用可用域
Browse files Browse the repository at this point in the history
  • Loading branch information
luoluoTH committed Jul 4, 2024
1 parent c61edfa commit 92ef611
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions app/main/handlers/utils/network.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,24 +84,25 @@ async function getAvailableOSSDomain() {
}

/**获取校验url */
const getCheckTextUrl=async()=>{
let url=''
const getCheckTextUrl = async () => {
const domain = await getAvailableOSSDomain();
let url = ''
switch (process.platform) {
case "darwin":
if (process.arch === "arm64") {
url = `https://aliyun-oss.yaklang.com/yak/${version}/yak_darwin_arm64.sha256.txt`
url = `https://${domain}/yak/${version}/yak_darwin_arm64.sha256.txt`
} else {
url = `https://aliyun-oss.yaklang.com/yak/${version}/yak_darwin_amd64.sha256.txt`
url = `https://${domain}/yak/${version}/yak_darwin_amd64.sha256.txt`
}
break
case "win32":
url = `https://aliyun-oss.yaklang.com/yak/${version}/yak_windows_amd64.exe.sha256.txt`
url = `https://${domain}/yak/${version}/yak_windows_amd64.exe.sha256.txt`
break
case "linux":
if (process.arch === "arm64") {
url = `https://aliyun-oss.yaklang.com/yak/${version}/yak_linux_arm64.sha256.txt`
url = `https://${domain}.com/yak/${version}/yak_linux_arm64.sha256.txt`
} else {
url = `https://aliyun-oss.yaklang.com/yak/${version}/yak_linux_amd64.sha256.txt`
url = `https://${domain}.com/yak/${version}/yak_linux_amd64.sha256.txt`
}
break
default:
Expand Down

0 comments on commit 92ef611

Please sign in to comment.