Commit 60533cbf by wangjf

fix

parent 423c56bd
...@@ -62,6 +62,12 @@ public class TagController { ...@@ -62,6 +62,12 @@ public class TagController {
@GetMapping("/edit") @GetMapping("/edit")
String edit(@RequestParam(name = "packageName") String packageName, Model model) { String edit(@RequestParam(name = "packageName") String packageName, Model model) {
Tag tag = tagDao.find(packageName); Tag tag = tagDao.find(packageName);
if (StringUtils.isNotBlank(tag.getUrl()) && tag.getUrl().length() > 2 && tag.getUrl().startsWith("[") && tag.getUrl().endsWith("]")) {
String url = tag.getUrl().substring(2, tag.getUrl().length() - 2).replace("\"", "").split(",")[0];
tag.setUrl(url);
} else {
tag.setUrl("");
}
model.addAttribute("tag", tag); model.addAttribute("tag", tag);
List<Feat> categoryFeat = featDao.firstList("01"); List<Feat> categoryFeat = featDao.firstList("01");
JSONArray jsonArray = JSONArray.fromObject(categoryFeat); JSONArray jsonArray = JSONArray.fromObject(categoryFeat);
...@@ -81,11 +87,11 @@ public class TagController { ...@@ -81,11 +87,11 @@ public class TagController {
@PostMapping("/save") @PostMapping("/save")
@ResponseBody @ResponseBody
R save(@SessionAttribute(WebSecurityConfig.SESSION_KEY) String userName, R save(@SessionAttribute(WebSecurityConfig.SESSION_KEY) String userName,
@RequestParam(name = "packageName") String packageName, @RequestParam(name = "packageName") String packageName,
@RequestParam(name = "categoryCode", required = false) String categoryCode, @RequestParam(name = "categoryCode", required = false) String categoryCode,
@RequestParam(name = "ruleCode", required = false) String ruleCode, @RequestParam(name = "ruleCode", required = false) String ruleCode,
@RequestParam(name = "styleCode", required = false) String styleCode, @RequestParam(name = "styleCode", required = false) String styleCode,
@RequestParam(name = "themeCode", required = false) String themeCode) { @RequestParam(name = "themeCode", required = false) String themeCode) {
System.out.println("packageName=" + packageName + ",categoryCode=" + categoryCode); System.out.println("packageName=" + packageName + ",categoryCode=" + categoryCode);
Map<String, String> codeMap = new HashMap<String, String>(); Map<String, String> codeMap = new HashMap<String, String>();
Map<String, String> featMap = featService.getMap(); Map<String, String> featMap = featService.getMap();
...@@ -139,7 +145,7 @@ public class TagController { ...@@ -139,7 +145,7 @@ public class TagController {
@PostMapping("/list") @PostMapping("/list")
@ResponseBody @ResponseBody
public PageUtil list(@RequestBody Query query, public PageUtil list(@RequestBody Query query,
@RequestParam(name = "tag", required = false, defaultValue = "0") int tag) { @RequestParam(name = "tag", required = false, defaultValue = "0") int tag) {
PageHelper.startPage(query.getOffset() / query.getLimit() + 1, query.getLimit()); PageHelper.startPage(query.getOffset() / query.getLimit() + 1, query.getLimit());
List<Tag> tags = tagDao.list(tag); List<Tag> tags = tagDao.list(tag);
int total = tagDao.count(tag); int total = tagDao.count(tag);
...@@ -149,14 +155,14 @@ public class TagController { ...@@ -149,14 +155,14 @@ public class TagController {
/* /*
* @GetMapping("/listAll") * @GetMapping("/listAll")
* *
* @ResponseBody public PageUtil * @ResponseBody public PageUtil
* listAll(@SessionAttribute(WebSecurityConfig.SESSION_KEY) String username, * listAll(@SessionAttribute(WebSecurityConfig.SESSION_KEY) String username,
* *
* @RequestParam(value = "offset", defaultValue = "0") int pageNum, * @RequestParam(value = "offset", defaultValue = "0") int pageNum,
* *
* @RequestParam(value = "limit", defaultValue = "10") int pageSize, * @RequestParam(value = "limit", defaultValue = "10") int pageSize,
* *
* @RequestParam(name = "tag", required = false, defaultValue = "1") int tag) { * @RequestParam(name = "tag", required = false, defaultValue = "1") int tag) {
* PageHelper.startPage(pageNum + 1, pageSize); List<Tag> tags = * PageHelper.startPage(pageNum + 1, pageSize); List<Tag> tags =
* tagDao.list(tag, username); int total = tagDao.count(tag, username); PageUtil * tagDao.list(tag, username); int total = tagDao.count(tag, username); PageUtil
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment