Skip to content

Commit

Permalink
🔨 添加线上接口地址 🎨 优化部分体验
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaozhu188 committed Sep 5, 2019
1 parent 71d2a67 commit fbf8bd7
Show file tree
Hide file tree
Showing 23 changed files with 142 additions and 183 deletions.
5 changes: 0 additions & 5 deletions src/index.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -136,11 +136,6 @@
<!-- Set `__static` path to static files in production -->
<% if (!process.browser) { %>
<script>
// const { remote } = require('electron')
// console.log(22,remote.getGlobal('useWelcome'))
// if(remote.getGlobal('useWelcome')){
// document.getElementById('welcome').style.display='block'
// }
if (process.env.NODE_ENV !== "development")
window.__static = require("path")
.join(__dirname, "/static")
Expand Down
6 changes: 3 additions & 3 deletions src/renderer/api/album.js
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
import request from '@/utils/request.js'

export function getTopAlbum ({limit, offset}) {
return request.get('/api/top/album', {
return request.get('/top/album', {
params: {
limit, offset
}
})
}

export function getNewestAlbum ({limit, offset}) {
return request.get('/api/album/newest', {
return request.get('/album/newest', {
params: {
limit, offset
}
})
}

export function getAlbum (id) {
return request.get('/api/album', {
return request.get('/album', {
params: {
id
}
Expand Down
14 changes: 7 additions & 7 deletions src/renderer/api/artist.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import request from '@/utils/request.js'

export function getArtistList ({cat = '全部', limit = 30, offset = 0, initial = ''}) {
return request.get('/api/artist/list', {
return request.get('/artist/list', {
params: {
cat,
limit,
Expand All @@ -12,7 +12,7 @@ export function getArtistList ({cat = '全部', limit = 30, offset = 0, initial
}

export function getArtistAlbum ({id, limit = 30, offset = 0}) {
return request.get('/api/artist/album', {
return request.get('/artist/album', {
params: {
id,
limit,
Expand All @@ -22,7 +22,7 @@ export function getArtistAlbum ({id, limit = 30, offset = 0}) {
}

export function getArtistMV ({id, limit = 10, offset = 0}) {
return request.get('/api/artist/mv', {
return request.get('/artist/mv', {
params: {
id,
limit,
Expand All @@ -32,7 +32,7 @@ export function getArtistMV ({id, limit = 10, offset = 0}) {
}

export function getArtistSongs ({id, limit = 30, offset = 0}) {
return request.get('/api/artists', {
return request.get('/artists', {
params: {
id,
limit,
Expand All @@ -42,7 +42,7 @@ export function getArtistSongs ({id, limit = 30, offset = 0}) {
}

export function getArtistDesc ({id, limit = 30, offset = 0}) {
return request.get('/api/artist/desc', {
return request.get('/artist/desc', {
params: {
id,
limit,
Expand All @@ -52,7 +52,7 @@ export function getArtistDesc ({id, limit = 30, offset = 0}) {
}
// 相似歌手
export function getArtistSimi ({id, limit = 30, offset = 0}) {
return request.get('/api/simi/artist', {
return request.get('/simi/artist', {
params: {
id,
limit,
Expand All @@ -63,5 +63,5 @@ export function getArtistSimi ({id, limit = 30, offset = 0}) {

// 歌手排行榜
export function getTopArtist () {
return request.get('/api/toplist/artist')
return request.get('/toplist/artist')
}
2 changes: 1 addition & 1 deletion src/renderer/api/banner.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import request from '@/utils/request.js'

export function getBanner () {
return request.get('/api/banner')
return request.get('/banner')
}
12 changes: 6 additions & 6 deletions src/renderer/api/comment.js
Original file line number Diff line number Diff line change
@@ -1,47 +1,47 @@
import request from '@/utils/request.js'

export function getPlaylistComment (id, limit = 20, offset = 0) {
return request.get('/api/comment/playlist', {
return request.get('/comment/playlist', {
params: {
id, limit, offset
}
})
}

export function getAlbumComment (id, limit = 20, offset = 0) {
return request.get('/api/comment/album', {
return request.get('/comment/album', {
params: {
id, limit, offset
}
})
}

export function getMVComment (id, limit = 20, offset = 0) {
return request.get('/api/comment/mv', {
return request.get('/comment/mv', {
params: {
id, limit, offset
}
})
}

export function getVideoComment (id, limit = 20, offset = 0) {
return request.get('/api/comment/video', {
return request.get('/comment/video', {
params: {
id, limit, offset
}
})
}

export function getSongComment (id, limit = 20, offset = 0, before = '') {
return request.get('/api/comment/music', {
return request.get('/comment/music', {
params: {
id, limit, offset, before
}
})
}

export function getDjComment (id, limit = 20, offset = 0, before = '') {
return request.get('/api/comment/dj', {
return request.get('/comment/dj', {
params: {
id, limit, offset, before
}
Expand Down
22 changes: 11 additions & 11 deletions src/renderer/api/dj.js
Original file line number Diff line number Diff line change
@@ -1,50 +1,50 @@
import request from '@/utils/request.js'

export function getRecommendDjprogram () {
return request.get('/api/personalized/djprogram')
return request.get('/personalized/djprogram')
}
export function getDjBanner () {
return request.get('/api/dj/banner')
return request.get('/dj/banner')
}
export function getDjCatelist () {
return request.get('/api/dj/catelist')
return request.get('/dj/catelist')
}
export function getDjByCate ({type, limit = 5, offset = 0}) {
return request.get('/api/dj/recommend/type', {
return request.get('/dj/recommend/type', {
params: {
type, limit, offset
}
})
}
export function getDjCatelistRecommend () {
return request.get('/api/dj/category/recommend')
return request.get('/dj/category/recommend')
}
export function getDjRecommend () {
return request.get('/api/dj/recommend')
return request.get('/dj/recommend')
}
// 今日优选
export function getDjPerfered () {
return request.get('/api/dj/today/perfered')
return request.get('/dj/today/perfered')
}
// 推荐节目
export function getProgramRecommend () {
return request.get('/api/program/recommend')
return request.get('/program/recommend')
}
// 付费精选
export function getDjPaygift () {
return request.get('/api/dj/paygift')
return request.get('/dj/paygift')
}
// 电台详情
export function getDjDetail (rid) {
return request.get('/api/dj/detail', {
return request.get('/dj/detail', {
params: {
rid
}
})
}
// 获取电台的节目
export function getDjProgram ({rid, limit, offset, asc = false}) {
return request.get('/api/dj/program', {
return request.get('/dj/program', {
params: {
rid,
limit,
Expand Down
10 changes: 5 additions & 5 deletions src/renderer/api/login.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
import request from '../utils/request.js'

export function login_cellphone (params) {
return request.get('/api/login/cellphone', {
return request.get('/login/cellphone', {
params
})
}
export function login_email (params) {
return request.get('/api/login/cellphone', {
return request.get('/login/cellphone', {
params
})
}
export function login_refresh () {
return request.get('/api/login/refresh')
return request.get('/login/refresh')
}
export function login_status () {
return request.get('/api/login/status')
return request.get('/login/status')
}
export function logout () {
return request.get('/api/logout')
return request.get('/logout')
}
16 changes: 8 additions & 8 deletions src/renderer/api/mv.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import request from '@/utils/request.js'

export function getPersonalizedMV () {
return request.get('/api/personalized/mv')
return request.get('/personalized/mv')
}

// area: 地区,可选值为全部,内地,港台,欧美,日本,韩国,不填则为全部
Expand All @@ -10,47 +10,47 @@ export function getPersonalizedMV () {
// limit: 取出数量 , 默认为 30
// offset: 偏移数量 , 用于分页 , 如 :( 页数 -1)*50, 其中 50 为 limit 的值 , 默认 为 0
export function getAllMV ({area = '全部', type = '全部', order = '上升最快', limit = 30, offset = 0}) {
return request.get('/api/mv/all', {
return request.get('/mv/all', {
params: {
area, type, order, limit, offset
}
})
}

export function getTopMV ({limit = 30, offset = 0}) {
return request.get('/api/top/mv', {
return request.get('/top/mv', {
params: {
limit, offset
}
})
}

export function getNewMV ({limit = 10}) {
return request.get('/api/mv/first', {
return request.get('/mv/first', {
params: {
limit
}
})
}

export function getMVInfo (mvid) {
return request.get('/api/mv/detail', {
return request.get('/mv/detail', {
params: {
mvid
}
})
}

export function getMvUrl (id) {
return request.get('/api/mv/url', {
return request.get('/mv/url', {
params: {
id
}
})
}

export function getSimiMV (id) {
return request.get('/api/simi/mv', {
return request.get('/simi/mv', {
params: {
mvid: id
}
Expand All @@ -59,7 +59,7 @@ export function getSimiMV (id) {

// 收藏视频 t : 1 为收藏,其他为取消收藏
export function subMV (mvid, t) {
return request.get('/api/mv/sub', {
return request.get('/mv/sub', {
params: {
mvid, t
}
Expand Down
20 changes: 10 additions & 10 deletions src/renderer/api/playlist.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
import request from '@/utils/request.js'

export function getPlaylistTags () {
return request.get('/api/playlist/hot')
return request.get('/playlist/hot')
}

export function getUserPlaylist (uid) {
return request.get('/api/user/playlist', {
return request.get('/user/playlist', {
params: {
uid
}
})
}

export function getPlaylistDetail (id) {
return request.get('/api/playlist/detail', {
return request.get('/playlist/detail', {
params: {
id,
_: new Date().getTime()
Expand All @@ -22,15 +22,15 @@ export function getPlaylistDetail (id) {
}

export function getPlaylistCatlist () {
return request.get('/api/playlist/catlist')
return request.get('/playlist/catlist')
}

export function getPersonalizedPlaylist () {
return request.get('/api/personalized')
return request.get('/personalized')
}

export function getTopPlaylist ({cat = '全部', limit = 10, offset = 0, order = 'new'}) {
return request.get('/api/top/playlist', {
return request.get('/top/playlist', {
params: {
cat,
limit,
Expand All @@ -42,7 +42,7 @@ export function getTopPlaylist ({cat = '全部', limit = 10, offset = 0, order =

// 精品歌单 before: 分页参数,取上一页最后一个歌单的 updateTime 获取下一页数据
export function getHighPlaylist ({cat = '全部', limit = 20, before = ''}) {
return request.get('/api/top/playlist/highquality', {
return request.get('/top/playlist/highquality', {
params: {
cat,
limit,
Expand All @@ -52,19 +52,19 @@ export function getHighPlaylist ({cat = '全部', limit = 20, before = ''}) {
}

export function getRelatedPlaylist (id) {
return request.get('/api/related/playlist', {
return request.get('/related/playlist', {
params: {
id
}
})
}

export function getRecommendPlaylist () {
return request.get('/api/personalized')
return request.get('/personalized')
}

export function getPlaylistSubscribers ({limit = 20, offset = 0, id}) {
return request.get('/api/playlist/subscribers', {
return request.get('/playlist/subscribers', {
params: {
id,
limit,
Expand Down
Loading

0 comments on commit fbf8bd7

Please sign in to comment.