Skip to content

Commit

Permalink
v 0.1.1 将api地址改为弹出输入式
Browse files Browse the repository at this point in the history
  • Loading branch information
timlzh committed Feb 14, 2021
1 parent ec52de7 commit 3a5cddc
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 23 deletions.
27 changes: 8 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,25 +38,7 @@

部署网易云 API,详情参见 [Binaryify/NeteaseCloudMusicApi](https://github.com/Binaryify/NeteaseCloudMusicApi)

3. 更改api地址

打开`./source/js/main.js`,将第二行apiAd的值修改为api地址。**一定不要忘了地址最后的`/`**

```javascript
//api地址
let apiAd = "";//一定不要忘了地址最后的'/'
```

如:

```javascript
//api地址
let apiAd = "http://127.0.0.1:3000/";//一定不要忘了地址最后的'/'
```

如果你是在本地部署的api,则api地址为`"http://localhost:3000/"`

4. 部署网页
3. 部署网页

- Windows

Expand Down Expand Up @@ -108,13 +90,20 @@

请使用Apache服务或Nginx服务部署。

4. 在网页中输入api地址,一定不要忘了地址最后的/

如: `http://127.0.0.1:3000/`

如果你是在本地部署的api,则api地址为`"http://localhost:3000/"`

## 贡献者

@[Timlzh](https://github.com/timlzh/)

## 鸣谢

[qier222/YesPlayMusic](https://github.com/qier222/YesPlayMusic)

[Binaryify/NeteaseCloudMusicApi](https://github.com/Binaryify/NeteaseCloudMusicApi)


Expand Down
16 changes: 12 additions & 4 deletions source/js/main.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
//api地址
let apiAd = "http://csgo.itstim.xyz:3000/";//一定不要忘了地址最后的'/'

//变量声明
let apiAd = localStorage.apiAd;
let loginMethod = 1;
let loginStatus = 0;
let loginCookie = localStorage.cookie;
Expand Down Expand Up @@ -65,7 +63,17 @@ shuffledPlayingIndexs = localStorage.shuffledPlayingIndexs ? JSON.parse(localSto
$(".me").hide();
$(".list").hide();
$(".playing_div").hide();
if(apiAd == "") alert("请正确填入api地址!");
if(!apiAd){
localStorage.apiAd = apiAd = prompt("请输入api地址 \n 一定不要忘了地址最后的/","http://localhost:3000/");
location.reload();
}else{
let api_adr = apiAd + "search/hot";
let data;
if (!(data = ajaxGet(api_adr))) {
localStorage.apiAd = apiAd = "";
location.reload();
}
}
transInputIcon(".search_input", ".search_btn");
transInputIcon("#account_input", ".fa-envelope");
transInputIcon("#account_input", ".fa-mobile-alt");
Expand Down

0 comments on commit 3a5cddc

Please sign in to comment.