-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e917eb3
commit 931c9f6
Showing
6 changed files
with
129 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,17 @@ | ||
import network from "./network.json"; | ||
import axios from "axios"; | ||
const url = `http://${network.host}:${network.port}`; | ||
|
||
/** | ||
* @description 获取语言文件请求 | ||
* @param {"en_us"|"zh_cn"|"auto"} params | ||
* @returns {Promise<AxiosResponse<JSON>>} | ||
*/ | ||
async function getLangFileRequest(params) { | ||
const url = new URL(`http://${network.host}:${network.port}`); | ||
url.searchParams.set("lang", params); | ||
return axios.get(url.href); | ||
const uri = new URL(url); | ||
uri.pathname = "/resource"; | ||
uri.searchParams.set("lang", params); | ||
return axios.get(uri.href); | ||
} | ||
|
||
export { getLangFileRequest }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters