diff --git a/router/videoInfo.js b/router/videoInfo.js index ec799a4..57e9b50 100644 --- a/router/videoInfo.js +++ b/router/videoInfo.js @@ -53,7 +53,7 @@ router.post("/addSubscribe", async (ctx) => { * 获取订阅列表 */ router.get("/getSubscribe", async (ctx) => { - ctx.body = await getSub() + ctx.body = await getSub(ctx.query.state) }) /** diff --git a/util/sql/video.js b/util/sql/video.js index b38cfe0..90e76f2 100644 --- a/util/sql/video.js +++ b/util/sql/video.js @@ -13,8 +13,8 @@ async function addSub(info){ } // 获取所有订阅 (不包括已完成) -async function getSub(){ - let sql = `select * from VideoInfo where enable=1` +async function getSub(state){ + let sql = `select * from VideoInfo where enable=${state}` let list = await getAll(sql) return list } diff --git a/view/src/api/Video.js b/view/src/api/Video.js index 43445ba..cd3d85d 100644 --- a/view/src/api/Video.js +++ b/view/src/api/Video.js @@ -28,8 +28,12 @@ export async function addSubscribe(data) { return await base.post("/videoInfo/addSubscribe", data) } -export async function getSubscribe(){ - return await base.get("/videoInfo/getSubscribe") +export async function getSubscribe(state){ + return await base.get("/videoInfo/getSubscribe",{ + params:{ + state + } + }) } diff --git a/view/src/page/subscribe/subscribe.vue b/view/src/page/subscribe/subscribe.vue index 94d464a..602a761 100644 --- a/view/src/page/subscribe/subscribe.vue +++ b/view/src/page/subscribe/subscribe.vue @@ -1,12 +1,18 @@