Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e778ec3f66 | ||
|
|
32922bbf4b |
No files matched your search
@@ -19,3 +19,6 @@
|
|||||||
npm-debug.log*
|
npm-debug.log*
|
||||||
yarn-debug.log*
|
yarn-debug.log*
|
||||||
yarn-error.log*
|
yarn-error.log*
|
||||||
|
|
||||||
|
glass-player.zip
|
||||||
|
package-lock.json
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
echo "正在打包..."
|
||||||
|
npm run build
|
||||||
|
zip -r -q ./glass-player.zip ./build/*
|
||||||
|
echo "打包完成!"
|
||||||
+7
-8
@@ -3,15 +3,14 @@
|
|||||||
"version": "2.1.2",
|
"version": "2.1.2",
|
||||||
"private": true,
|
"private": true,
|
||||||
"proxy": {
|
"proxy": {
|
||||||
"/netease/*": {
|
"/music": {
|
||||||
"target": "https://glassplayer.dengtongyu.com",
|
"target": "https://api.dengtongyu.com",
|
||||||
"secure": true,
|
"secure": true,
|
||||||
"changeOrigin": true
|
"changeOrigin": true,
|
||||||
},
|
"headers": {
|
||||||
"/kugou/*": {
|
"Origin": "https://glassplayer.dengtongyu.com",
|
||||||
"target": "https://glassplayer.dengtongyu.com",
|
"Referer": "https://glassplayer.dengtongyu.com/"
|
||||||
"secure": true,
|
}
|
||||||
"changeOrigin": true
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { urlFetch, parseLyric} from './Util';
|
import { urlFetch, parseLyric} from './Util';
|
||||||
|
|
||||||
//const host = 'https://node.dengtongyu.com';
|
//const host = 'https://node.dengtongyu.com';
|
||||||
const host = '/kugou';
|
const host = 'https://api.dengtongyu.com/music/kugou';
|
||||||
|
|
||||||
const searchUrl = host + '/songSearch';
|
const searchUrl = host + '/songSearch';
|
||||||
|
|
||||||
@@ -17,6 +17,9 @@ let getKugouSearchSongList = async function(keyWord,page,size) {
|
|||||||
let response = await urlFetch(url);
|
let response = await urlFetch(url);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
if(!response) {
|
||||||
|
return Promise.reject("返回数据为空");
|
||||||
|
}
|
||||||
let data = await response.json();
|
let data = await response.json();
|
||||||
//console.log(data)
|
//console.log(data)
|
||||||
let songs = {};
|
let songs = {};
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
import { urlFetch, parseLyric} from './Util';
|
import { urlFetch, parseLyric} from './Util';
|
||||||
|
|
||||||
const host = '/netease';
|
const host = 'https://api.dengtongyu.com/music/netease';
|
||||||
|
|
||||||
const searchUrl = host + '/search';
|
const searchUrl = host + '/search';
|
||||||
|
|
||||||
const rankUrl = host + '/top/list';
|
const rankUrl = host + '/playlist/detail';
|
||||||
|
|
||||||
const songDetailUrl = host + '/song/detail';
|
const songDetailUrl = host + '/song/detail';
|
||||||
|
|
||||||
@@ -51,7 +51,7 @@ let getNeteaseSearchSongList = async function(keyWord, page, size) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
let getNeteaseHotSongList = async function() {
|
let getNeteaseHotSongList = async function() {
|
||||||
let url = rankUrl + '?idx=1';
|
let url = rankUrl + '?id=3778678';
|
||||||
let response = await urlFetch(url);
|
let response = await urlFetch(url);
|
||||||
try {
|
try {
|
||||||
let data = await response.json();
|
let data = await response.json();
|
||||||
|
|||||||
+8
-1
@@ -4,7 +4,14 @@ let urlFetch = async function (url) {
|
|||||||
if(isFetching) return Promise.reject('您点太快了!');
|
if(isFetching) return Promise.reject('您点太快了!');
|
||||||
|
|
||||||
isFetching = true;
|
isFetching = true;
|
||||||
let result = await fetch(url)
|
let result = null;
|
||||||
|
|
||||||
|
try {
|
||||||
|
result = await fetch(url)
|
||||||
|
}
|
||||||
|
catch (error){
|
||||||
|
isFetching = false;
|
||||||
|
}
|
||||||
isFetching = false;
|
isFetching = false;
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user