diff --git a/src/main/java/com/yutou/tools/bangumi/AnimationController.java b/src/main/java/com/yutou/tools/bangumi/AnimationController.java index 25b8985..817f57c 100644 --- a/src/main/java/com/yutou/tools/bangumi/AnimationController.java +++ b/src/main/java/com/yutou/tools/bangumi/AnimationController.java @@ -89,7 +89,7 @@ public class AnimationController { BangumiItem item = new BangumiItem(); item.setId(-1); item.setTitle(title); - item.setTitlekey(title.split("\\?")[1]); + item.setTitlekey(titleKey); i = bangumiService.addBangumiItem(item); json.put("msg", i == 0 ? "添加失败" : "添加成功"); return json; diff --git a/src/main/java/com/yutou/tools/services/BangumiServiceImpl.java b/src/main/java/com/yutou/tools/services/BangumiServiceImpl.java index f518029..29f7bea 100644 --- a/src/main/java/com/yutou/tools/services/BangumiServiceImpl.java +++ b/src/main/java/com/yutou/tools/services/BangumiServiceImpl.java @@ -1,5 +1,6 @@ package com.yutou.tools.services; +import com.alibaba.fastjson2.JSON; import com.alibaba.fastjson2.JSONObject; import com.yutou.tools.mybatis.dao.BangumiItemDao; import com.yutou.tools.mybatis.dao.BangumiListDao; @@ -39,7 +40,7 @@ public class BangumiServiceImpl implements BangumiService { public int addBangumiItem(BangumiItem... list) { for (BangumiItem item : list) { if (item.getId().equals(-1)) { - RedisTools.list_add("anim_tmp_rss",item.getTitle()); + RedisTools.list_add("anim_tmp_rss", JSON.toJSON(item).toString()); } else if (itemDao.insert(item) <= 0) { return 0; } @@ -77,8 +78,7 @@ public class BangumiServiceImpl implements BangumiService { Set strings = RedisTools.list_get("anim_tmp_rss"); items=new ArrayList<>(); for (String string : strings) { - BangumiItem item=new BangumiItem();; - item.setTitle(string); + BangumiItem item=JSON.parseObject(string, BangumiItem.class); items.add(item); } return items; diff --git a/web/html/body/nas/animrss.html b/web/html/body/nas/animrss.html index a957090..b9eea5b 100644 --- a/web/html/body/nas/animrss.html +++ b/web/html/body/nas/animrss.html @@ -208,20 +208,43 @@ } }) function addTmpRss(def) { - layer.prompt({ - formType: 0, - value: '', - title: '请输入RSS地址' - }, function(value, index, elem){ - $.post('/anim/rss/add.do',{ - title: value, - bid:-1 - },function (json) { - console.log(json) - layer.msg(json.msg) - layer.close(index); - }) - }); + let option = ''; + for (let i = 0; i < 20; i++) { + if (i === 1) { + option += '' + } else { + option += '' + } + } + let html = '
标题:
URL: 季度:
' + layer.open({ + type: 0, + area: ['500px', '600px'], + title: '请输入RSS地址', + content: html, + success: function () { + layui.use(['form'], function () { + layui.form.render('select'); + }) + }, + cancel :function (index){ + layer.close(index) + }, + yes: function (index, elem) { + let url = $('#rss_value')[0].value + let title = $('#anim_rss_title')[0].value+ '/Season ' + $('#rss_select')[0].value + + $.post("/anim/rss/add.do", { + title: url + , titleKey: title + , bid: -1 + }, function (json) { + layer.msg(json.msg) + layer.close(index) + }) + } + }) + } layui.use(['layer', 'form', 'element', 'table', 'util'], function () { let layer = layui.layer