未验证 提交 2730d4df 编写于 作者: RYAN0UP's avatar RYAN0UP 提交者: GitHub

release 1.1.1 (#316)

release 1.1.1
Co-authored-by: NJohn Niang <johnniang@foxmail.com>
......@@ -9,7 +9,7 @@ apply plugin: 'io.spring.dependency-management'
group = 'run.halo.app'
archivesBaseName = 'halo'
version = '1.1.0'
version = '1.1.1'
sourceCompatibility = '1.8'
description = 'Halo, personal blog system developed in Java.'
......
......@@ -23,6 +23,7 @@ import run.halo.app.model.vo.PostListVO;
import run.halo.app.service.*;
import run.halo.app.utils.MarkdownUtils;
import java.io.File;
import java.util.List;
import java.util.concurrent.TimeUnit;
......
......@@ -3,13 +3,19 @@ package run.halo.app.controller.content.api;
import io.swagger.annotations.ApiOperation;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Sort;
import org.springframework.data.web.PageableDefault;
import org.springframework.data.web.SortDefault;
import org.springframework.web.bind.annotation.*;
import run.halo.app.cache.lock.CacheLock;
import run.halo.app.model.dto.BaseCommentDTO;
import run.halo.app.model.dto.JournalDTO;
import run.halo.app.model.dto.JournalWithCmtCountDTO;
import run.halo.app.model.entity.Journal;
import run.halo.app.model.entity.JournalComment;
import run.halo.app.model.enums.CommentStatus;
import run.halo.app.model.enums.JournalType;
import run.halo.app.model.params.JournalCommentParam;
import run.halo.app.model.vo.BaseCommentVO;
import run.halo.app.model.vo.BaseCommentWithParentVO;
......@@ -23,8 +29,11 @@ import java.util.List;
import static org.springframework.data.domain.Sort.Direction.DESC;
/**
* Content Journal controller.
*
* @author johnniang
* @date 19-4-26
* @author ryanwang
* @date 2019-04-26
*/
@RestController("PortalJournalController")
@RequestMapping("/api/content/journals")
......@@ -44,6 +53,20 @@ public class JournalController {
this.optionService = optionService;
}
@GetMapping
@ApiOperation("Lists journals")
public Page<JournalWithCmtCountDTO> pageBy(@PageableDefault(sort = "createTime", direction = DESC) Pageable pageable) {
Page<Journal> journals = journalService.pageBy(JournalType.PUBLIC, pageable);
return journalService.convertToCmtCountDto(journals);
}
@GetMapping("{journalId:\\d+}")
@ApiOperation("Gets a journal detail")
public JournalDTO getBy(@PathVariable("journalId") Integer journalId) {
Journal journal = journalService.getById(journalId);
return journalService.convertTo(journal);
}
@GetMapping("{journalId:\\d+}/comments/top_view")
public Page<CommentWithHasChildrenVO> listTopComments(@PathVariable("journalId") Integer journalId,
@RequestParam(name = "page", required = false, defaultValue = "0") int page,
......
package run.halo.app.controller.content.api;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Sort;
import org.springframework.data.web.PageableDefault;
import org.springframework.data.web.SortDefault;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import run.halo.app.model.dto.PhotoDTO;
import run.halo.app.model.params.PhotoQuery;
import run.halo.app.service.PhotoService;
import java.util.List;
import static org.springframework.data.domain.Sort.Direction.DESC;
/**
* Content photo controller.
*
* @author ryanwang
* @date 2019-09-21
*/
@RestController("ApiContentPhotoController")
@RequestMapping("/api/content/photos")
public class PhotoController {
private final PhotoService photoService;
public PhotoController(PhotoService photoService) {
this.photoService = photoService;
}
/**
* List all photos
*
* @param sort sort
* @return all of photos
*/
@GetMapping(value = "latest")
public List<PhotoDTO> listPhotos(@SortDefault(sort = "updateTime", direction = Sort.Direction.DESC) Sort sort) {
return photoService.listDtos(sort);
}
@GetMapping
public Page<PhotoDTO> pageBy(@PageableDefault(sort = "updateTime", direction = DESC) Pageable pageable,
PhotoQuery photoQuery) {
return photoService.pageDtosBy(pageable, photoQuery);
}
}
......@@ -10,7 +10,6 @@ import org.springframework.data.web.SortDefault;
import org.springframework.web.bind.annotation.*;
import run.halo.app.cache.lock.CacheLock;
import run.halo.app.model.dto.BaseCommentDTO;
import run.halo.app.model.dto.post.BasePostDetailDTO;
import run.halo.app.model.dto.post.BasePostSimpleDTO;
import run.halo.app.model.entity.Post;
import run.halo.app.model.entity.PostComment;
......@@ -55,7 +54,7 @@ public class PostController {
@GetMapping
@ApiOperation("Lists posts")
public Page<BasePostSimpleDTO> pageBy(@PageableDefault(sort = "updateTime", direction = DESC) Pageable pageable) {
public Page<BasePostSimpleDTO> pageBy(@PageableDefault(sort = "createTime", direction = DESC) Pageable pageable) {
Page<Post> postPage = postService.pageBy(PostStatus.PUBLISHED, pageable);
return postService.convertToSimple(postPage);
}
......@@ -71,8 +70,8 @@ public class PostController {
@GetMapping("{postId:\\d+}")
@ApiOperation("Gets a post")
public PostDetailVO getBy(@PathVariable("postId") Integer postId,
@RequestParam(value = "formatDisabled", required = false, defaultValue = "true") Boolean formatDisabled,
@RequestParam(value = "sourceDisabled", required = false, defaultValue = "false") Boolean sourceDisabled) {
@RequestParam(value = "formatDisabled", required = false, defaultValue = "true") Boolean formatDisabled,
@RequestParam(value = "sourceDisabled", required = false, defaultValue = "false") Boolean sourceDisabled) {
PostDetailVO postDetailVO = postService.convertToDetailVo(postService.getById(postId));
if (formatDisabled) {
......
......@@ -3,13 +3,19 @@ package run.halo.app.controller.content.api;
import io.swagger.annotations.ApiOperation;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Sort;
import org.springframework.data.web.PageableDefault;
import org.springframework.data.web.SortDefault;
import org.springframework.web.bind.annotation.*;
import run.halo.app.cache.lock.CacheLock;
import run.halo.app.model.dto.BaseCommentDTO;
import run.halo.app.model.dto.post.BasePostDetailDTO;
import run.halo.app.model.dto.post.BasePostSimpleDTO;
import run.halo.app.model.entity.Sheet;
import run.halo.app.model.entity.SheetComment;
import run.halo.app.model.enums.CommentStatus;
import run.halo.app.model.enums.PostStatus;
import run.halo.app.model.params.SheetCommentParam;
import run.halo.app.model.vo.BaseCommentVO;
import run.halo.app.model.vo.BaseCommentWithParentVO;
......@@ -26,6 +32,7 @@ import static org.springframework.data.domain.Sort.Direction.DESC;
* Sheet controller.
*
* @author johnniang
* @author ryanwang
* @date 19-4-26
*/
@RestController("PortalSheetController")
......@@ -44,6 +51,33 @@ public class SheetController {
this.optionService = optionService;
}
@GetMapping
@ApiOperation("Lists sheets")
public Page<BasePostSimpleDTO> pageBy(@PageableDefault(sort = "createTime", direction = DESC) Pageable pageable) {
Page<Sheet> sheetPage = sheetService.pageBy(PostStatus.PUBLISHED, pageable);
return sheetService.convertToSimple(sheetPage);
}
@GetMapping("{sheetId:\\d+}")
@ApiOperation("Gets a sheet")
public BasePostDetailDTO getBy(@PathVariable("sheetId") Integer sheetId,
@RequestParam(value = "formatDisabled", required = false, defaultValue = "true") Boolean formatDisabled,
@RequestParam(value = "sourceDisabled", required = false, defaultValue = "false") Boolean sourceDisabled) {
BasePostDetailDTO sheetDetailVO = sheetService.convertToDetail(sheetService.getById(sheetId));
if (formatDisabled) {
// Clear the format content
sheetDetailVO.setFormatContent(null);
}
if (sourceDisabled) {
// Clear the original content
sheetDetailVO.setOriginalContent(null);
}
return sheetDetailVO;
}
@GetMapping("{sheetId:\\d+}/comments/top_view")
public Page<CommentWithHasChildrenVO> listTopComments(@PathVariable("sheetId") Integer sheetId,
@RequestParam(name = "page", required = false, defaultValue = "0") int page,
......
package run.halo.app.model.params;
import lombok.Data;
import org.hibernate.validator.constraints.URL;
import run.halo.app.model.dto.base.InputConverter;
import run.halo.app.utils.ReflectionUtils;
......@@ -29,6 +30,7 @@ public abstract class BaseCommentParam<COMMENT> implements InputConverter<COMMEN
private String email;
@Size(max = 127, message = "评论者博客链接的字符长度不能超过 {max}")
@URL(message= "博客链接格式不正确")
private String authorUrl;
@NotBlank(message = "评论内容不能为空")
......
......@@ -13,8 +13,6 @@ public enum SeoProperties implements PropertyEnum {
DESCRIPTION("seo_description", String.class, ""),
BAIDU_TOKEN("seo_baidu_token", String.class, ""),
/**
* 是否禁止爬虫
*/
......
.page-header-wrapper-grid-content-main[data-v-59c6a198]{width:100%;height:100%;min-height:100%;-webkit-transition:.3s;transition:.3s}.page-header-wrapper-grid-content-main .profile-center-avatarHolder[data-v-59c6a198]{text-align:center;margin-bottom:24px}.page-header-wrapper-grid-content-main .profile-center-avatarHolder>.avatar[data-v-59c6a198]{margin:0 auto;width:104px;height:104px;margin-bottom:20px;border-radius:50%;overflow:hidden;cursor:pointer}.page-header-wrapper-grid-content-main .profile-center-avatarHolder>.avatar img[data-v-59c6a198]{height:100%;width:100%}.page-header-wrapper-grid-content-main .profile-center-avatarHolder .username[data-v-59c6a198]{color:rgba(0,0,0,.85);font-size:20px;line-height:28px;font-weight:500;margin-bottom:4px}.page-header-wrapper-grid-content-main .profile-center-detail p[data-v-59c6a198]{margin-bottom:8px;padding-left:26px;position:relative}.page-header-wrapper-grid-content-main .profile-center-detail i[data-v-59c6a198]{position:absolute;height:14px;width:14px;left:0;top:4px}
\ No newline at end of file
.page-header-wrapper-grid-content-main[data-v-63742d21]{width:100%;height:100%;min-height:100%;-webkit-transition:.3s;transition:.3s}.page-header-wrapper-grid-content-main .profile-center-avatarHolder[data-v-63742d21]{text-align:center;margin-bottom:24px}.page-header-wrapper-grid-content-main .profile-center-avatarHolder>.avatar[data-v-63742d21]{margin:0 auto;width:104px;height:104px;margin-bottom:20px;border-radius:50%;overflow:hidden;cursor:pointer}.page-header-wrapper-grid-content-main .profile-center-avatarHolder>.avatar img[data-v-63742d21]{height:100%;width:100%}.page-header-wrapper-grid-content-main .profile-center-avatarHolder .username[data-v-63742d21]{color:rgba(0,0,0,.85);font-size:20px;line-height:28px;font-weight:500;margin-bottom:4px}.page-header-wrapper-grid-content-main .profile-center-detail p[data-v-63742d21]{margin-bottom:8px;padding-left:26px;position:relative}.page-header-wrapper-grid-content-main .profile-center-detail i[data-v-63742d21]{position:absolute;height:14px;width:14px;left:0;top:4px}
\ No newline at end of file
<!DOCTYPE html><html lang=zh-cmn-Hans><head><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge"><meta name=viewport content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no"><meta name=robots content=noindex,nofllow><meta name=generator content=Halo><link rel=icon href=/logo.png><title>Halo Dashboard</title><style>#loader{position:absolute;top:0;right:0;bottom:0;left:0;margin:auto;border:solid 3px #e5e5e5;border-top-color:#333;border-radius:50%;width:30px;height:30px;animation:spin .6s linear infinite}@keyframes spin{to{transform:rotate(360deg)}}</style><link href=/css/chunk-00feb227.84211a72.css rel=prefetch><link href=/css/chunk-09a78eda.0e33e21a.css rel=prefetch><link href=/css/chunk-1922a40e.f4349937.css rel=prefetch><link href=/css/chunk-1e303e8c.46a67c57.css rel=prefetch><link href=/css/chunk-2cf7efe4.0e33e21a.css rel=prefetch><link href=/css/chunk-36ac1a23.0becaf8c.css rel=prefetch><link href=/css/chunk-38e065ca.8f4ac180.css rel=prefetch><link href=/css/chunk-59456d4e.afea7f86.css rel=prefetch><link href=/css/chunk-afda5a22.041fa426.css rel=prefetch><link href=/css/chunk-f1c576e6.b38ba436.css rel=prefetch><link href=/css/fail.809a6bc5.css rel=prefetch><link href=/js/chunk-00feb227.2c332405.js rel=prefetch><link href=/js/chunk-09a78eda.ecea3d8e.js rel=prefetch><link href=/js/chunk-0ba750a2.c7f7fd0b.js rel=prefetch><link href=/js/chunk-13882457.562b4d43.js rel=prefetch><link href=/js/chunk-1922a40e.3378b225.js rel=prefetch><link href=/js/chunk-1e303e8c.f696700e.js rel=prefetch><link href=/js/chunk-2cf7efe4.edad6794.js rel=prefetch><link href=/js/chunk-2d0b383e.6fd94865.js rel=prefetch><link href=/js/chunk-2d0b64bf.db02cecd.js rel=prefetch><link href=/js/chunk-2d0b8b03.818cca76.js rel=prefetch><link href=/js/chunk-2d0cf13d.02e642fe.js rel=prefetch><link href=/js/chunk-2d21a35c.cff39891.js rel=prefetch><link href=/js/chunk-2d228c74.3f60fbb2.js rel=prefetch><link href=/js/chunk-2d228d13.e7c565c8.js rel=prefetch><link href=/js/chunk-36ac1a23.36af80b4.js rel=prefetch><link href=/js/chunk-37a26d88.04a2a49e.js rel=prefetch><link href=/js/chunk-38e065ca.a9b9711f.js rel=prefetch><link href=/js/chunk-59456d4e.13903f8f.js rel=prefetch><link href=/js/chunk-664d53d7.4cc459ed.js rel=prefetch><link href=/js/chunk-6709ac89.606ab90b.js rel=prefetch><link href=/js/chunk-78dfb9ad.2fb3220c.js rel=prefetch><link href=/js/chunk-7f061eff.83785ccc.js rel=prefetch><link href=/js/chunk-afda5a22.464c5981.js rel=prefetch><link href=/js/chunk-b0eebb32.3d368473.js rel=prefetch><link href=/js/chunk-f1c576e6.04de3e8c.js rel=prefetch><link href=/js/fail.ef3c85c4.js rel=prefetch><link href=/css/app.ad52b47a.css rel=preload as=style><link href=/css/chunk-vendors.70dcf28e.css rel=preload as=style><link href=/js/app.0bb46c3a.js rel=preload as=script><link href=/js/chunk-vendors.8dff577d.js rel=preload as=script><link href=/css/chunk-vendors.70dcf28e.css rel=stylesheet><link href=/css/app.ad52b47a.css rel=stylesheet></head><body><noscript><strong>We're sorry but vue-antd-pro doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id=app><div id=loader></div></div><script src=/js/chunk-vendors.8dff577d.js></script><script src=/js/app.0bb46c3a.js></script></body></html>
\ No newline at end of file
<!DOCTYPE html><html lang=zh-cmn-Hans><head><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge"><meta name=viewport content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no"><meta name=robots content=noindex,nofllow><meta name=generator content=Halo><link rel=icon href=/logo.png><title>Halo Dashboard</title><style>#loader{position:absolute;top:0;right:0;bottom:0;left:0;margin:auto;border:solid 3px #e5e5e5;border-top-color:#333;border-radius:50%;width:30px;height:30px;animation:spin .6s linear infinite}@keyframes spin{to{transform:rotate(360deg)}}</style><link href=/css/chunk-00feb227.84211a72.css rel=prefetch><link href=/css/chunk-09a78eda.0e33e21a.css rel=prefetch><link href=/css/chunk-0cc826ee.d94071d6.css rel=prefetch><link href=/css/chunk-1922a40e.f4349937.css rel=prefetch><link href=/css/chunk-1e303e8c.46a67c57.css rel=prefetch><link href=/css/chunk-2cf7efe4.0e33e21a.css rel=prefetch><link href=/css/chunk-36ac1a23.0becaf8c.css rel=prefetch><link href=/css/chunk-59456d4e.afea7f86.css rel=prefetch><link href=/css/chunk-afda5a22.041fa426.css rel=prefetch><link href=/css/chunk-f1c576e6.b38ba436.css rel=prefetch><link href=/css/fail.809a6bc5.css rel=prefetch><link href=/js/chunk-00feb227.9a8da69e.js rel=prefetch><link href=/js/chunk-09a78eda.cc69abe1.js rel=prefetch><link href=/js/chunk-0ba750a2.1fe7a063.js rel=prefetch><link href=/js/chunk-0cc826ee.944fd5f4.js rel=prefetch><link href=/js/chunk-13882457.c82a4d82.js rel=prefetch><link href=/js/chunk-1922a40e.c260b56d.js rel=prefetch><link href=/js/chunk-1e303e8c.13b99962.js rel=prefetch><link href=/js/chunk-2cf7efe4.01e2d029.js rel=prefetch><link href=/js/chunk-2d0b383e.d5e906d0.js rel=prefetch><link href=/js/chunk-2d0b64bf.dc1f06bd.js rel=prefetch><link href=/js/chunk-2d0b8b03.44d2af44.js rel=prefetch><link href=/js/chunk-2d0cf13d.49fc8c5f.js rel=prefetch><link href=/js/chunk-2d21a35c.82f5da19.js rel=prefetch><link href=/js/chunk-2d228c74.931307e8.js rel=prefetch><link href=/js/chunk-2d228d13.c03e48e4.js rel=prefetch><link href=/js/chunk-36ac1a23.907bf32d.js rel=prefetch><link href=/js/chunk-37a26d88.20c02945.js rel=prefetch><link href=/js/chunk-59456d4e.0c1f28f5.js rel=prefetch><link href=/js/chunk-664d53d7.69874f43.js rel=prefetch><link href=/js/chunk-6709ac89.81fe9f80.js rel=prefetch><link href=/js/chunk-78dfb9ad.08dc84c7.js rel=prefetch><link href=/js/chunk-7f061eff.9efbb5ce.js rel=prefetch><link href=/js/chunk-afda5a22.14d03c3c.js rel=prefetch><link href=/js/chunk-b0eebb32.58f570c3.js rel=prefetch><link href=/js/chunk-f1c576e6.a11c537b.js rel=prefetch><link href=/js/fail.244fe78b.js rel=prefetch><link href=/css/app.ad52b47a.css rel=preload as=style><link href=/css/chunk-vendors.70dcf28e.css rel=preload as=style><link href=/js/app.e29a566a.js rel=preload as=script><link href=/js/chunk-vendors.8dff577d.js rel=preload as=script><link href=/css/chunk-vendors.70dcf28e.css rel=stylesheet><link href=/css/app.ad52b47a.css rel=stylesheet></head><body><noscript><strong>We're sorry but vue-antd-pro doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id=app><div id=loader></div></div><script src=/js/chunk-vendors.8dff577d.js></script><script src=/js/app.e29a566a.js></script></body></html>
\ No newline at end of file
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d21a35c"],{bb17:function(t,e,n){"use strict";n.r(e);var a=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"page-header-index-wide"},[n("a-row",{attrs:{gutter:12}},[n("a-col",{style:{"padding-bottom":"12px"},attrs:{xl:10,lg:10,md:10,sm:24,xs:24}},[n("a-card",{attrs:{title:t.title,bodyStyle:{padding:"16px"}}},[n("a-form",{attrs:{layout:"horizontal"}},[n("a-form-item",{attrs:{label:"网站名称:"}},[n("a-input",{model:{value:t.link.name,callback:function(e){t.$set(t.link,"name",e)},expression:"link.name"}})],1),n("a-form-item",{attrs:{label:"网站地址:",help:"* 需要加上 http://"}},[n("a-input",{model:{value:t.link.url,callback:function(e){t.$set(t.link,"url",e)},expression:"link.url"}})],1),n("a-form-item",{attrs:{label:"Logo:"}},[n("a-input",{model:{value:t.link.logo,callback:function(e){t.$set(t.link,"logo",e)},expression:"link.logo"}})],1),n("a-form-item",{attrs:{label:"分组:",help:"* 非必填"}},[n("a-input",{model:{value:t.link.team,callback:function(e){t.$set(t.link,"team",e)},expression:"link.team"}})],1),n("a-form-item",{attrs:{label:"排序编号:"}},[n("a-input",{attrs:{type:"number"},model:{value:t.link.priority,callback:function(e){t.$set(t.link,"priority",e)},expression:"link.priority"}})],1),n("a-form-item",{attrs:{label:"描述:"}},[n("a-input",{attrs:{type:"textarea",autosize:{minRows:5}},model:{value:t.link.description,callback:function(e){t.$set(t.link,"description",e)},expression:"link.description"}})],1),n("a-form-item",["create"===t.formType?n("a-button",{attrs:{type:"primary"},on:{click:t.handleSaveClick}},[t._v("保存")]):n("a-button-group",[n("a-button",{attrs:{type:"primary"},on:{click:t.handleSaveClick}},[t._v("更新")]),"update"===t.formType?n("a-button",{attrs:{type:"dashed"},on:{click:t.handleAddLink}},[t._v("返回添加")]):t._e()],1)],1)],1)],1)],1),n("a-col",{style:{"padding-bottom":"12px"},attrs:{xl:14,lg:14,md:14,sm:24,xs:24}},[n("a-card",{attrs:{title:"所有友情链接",bodyStyle:{padding:"16px"}}},[n("a-table",{attrs:{columns:t.columns,dataSource:t.links,loading:t.loading,rowKey:function(t){return t.id}},scopedSlots:t._u([{key:"url",fn:function(e){return[n("a",{attrs:{target:"_blank",href:e}},[t._v(t._s(e))])]}},{key:"name",fn:function(e){return n("ellipsis",{attrs:{length:15,tooltip:""}},[t._v(t._s(e))])}},{key:"action",fn:function(e,a){return n("span",{},[n("a",{attrs:{href:"javascript:;"},on:{click:function(e){return t.handleEditLink(a.id)}}},[t._v("编辑")]),n("a-divider",{attrs:{type:"vertical"}}),n("a-popconfirm",{attrs:{title:"你确定要删除【"+a.name+"】链接?",okText:"确定",cancelText:"取消"},on:{confirm:function(e){return t.handleDeleteLink(a.id)}}},[n("a",{attrs:{href:"javascript:;"}},[t._v("删除")])])],1)}}])})],1)],1)],1)],1)},i=[],l=(n("b54a"),n("9efd")),o="/api/admin/links",r={listAll:function(){return Object(l["a"])({url:"".concat(o),method:"get"})},create:function(t){return Object(l["a"])({url:o,data:t,method:"post"})},get:function(t){return Object(l["a"])({url:"".concat(o,"/").concat(t),method:"get"})},update:function(t,e){return Object(l["a"])({url:"".concat(o,"/").concat(t),data:e,method:"put"})},delete:function(t){return Object(l["a"])({url:"".concat(o,"/").concat(t),method:"delete"})}},s=r,c=[{title:"名称",dataIndex:"name",scopedSlots:{customRender:"name"}},{title:"网址",dataIndex:"url",scopedSlots:{customRender:"url"}},{title:"分组",dataIndex:"team"},{title:"排序",dataIndex:"priority"},{title:"操作",key:"action",scopedSlots:{customRender:"action"}}],d={data:function(){return{formType:"create",data:[],loading:!1,columns:c,links:[],link:{}}},computed:{title:function(){return this.link.id?"修改友情链接":"添加友情链接"}},created:function(){this.loadLinks()},methods:{loadLinks:function(){var t=this;this.loading=!0,s.listAll().then(function(e){t.links=e.data.data,t.loading=!1})},handleSaveClick:function(){this.createOrUpdateLink()},handleAddLink:function(){this.formType="create",this.link={}},handleEditLink:function(t){var e=this;s.get(t).then(function(t){e.link=t.data.data,e.formType="update"})},handleDeleteLink:function(t){var e=this;s.delete(t).then(function(t){e.$message.success("删除成功!"),e.loadLinks()})},createOrUpdateLink:function(){var t=this;this.link.id?s.update(this.link.id,this.link).then(function(e){t.$message.success("更新成功!"),t.loadLinks()}):s.create(this.link).then(function(e){t.$message.success("保存成功!"),t.loadLinks()}),this.handleAddLink()}}},u=d,p=n("2877"),m=Object(p["a"])(u,a,i,!1,null,null,null);e["default"]=m.exports}}]);
\ No newline at end of file
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d21a35c"],{bb17:function(t,e,n){"use strict";n.r(e);var a=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"page-header-index-wide"},[n("a-row",{attrs:{gutter:12}},[n("a-col",{style:{"padding-bottom":"12px"},attrs:{xl:10,lg:10,md:10,sm:24,xs:24}},[n("a-card",{attrs:{title:t.title,bodyStyle:{padding:"16px"}}},[n("a-form",{attrs:{layout:"horizontal"}},[n("a-form-item",{attrs:{label:"网站名称:"}},[n("a-input",{model:{value:t.link.name,callback:function(e){t.$set(t.link,"name",e)},expression:"link.name"}})],1),n("a-form-item",{attrs:{label:"网站地址:",help:"* 需要加上 http://"}},[n("a-input",{model:{value:t.link.url,callback:function(e){t.$set(t.link,"url",e)},expression:"link.url"}})],1),n("a-form-item",{attrs:{label:"Logo:"}},[n("a-input",{model:{value:t.link.logo,callback:function(e){t.$set(t.link,"logo",e)},expression:"link.logo"}})],1),n("a-form-item",{attrs:{label:"分组:",help:"* 非必填"}},[n("a-input",{model:{value:t.link.team,callback:function(e){t.$set(t.link,"team",e)},expression:"link.team"}})],1),n("a-form-item",{attrs:{label:"描述:"}},[n("a-input",{attrs:{type:"textarea",autosize:{minRows:5}},model:{value:t.link.description,callback:function(e){t.$set(t.link,"description",e)},expression:"link.description"}})],1),n("a-form-item",["create"===t.formType?n("a-button",{attrs:{type:"primary"},on:{click:t.handleSaveClick}},[t._v("保存")]):n("a-button-group",[n("a-button",{attrs:{type:"primary"},on:{click:t.handleSaveClick}},[t._v("更新")]),"update"===t.formType?n("a-button",{attrs:{type:"dashed"},on:{click:t.handleAddLink}},[t._v("返回添加")]):t._e()],1)],1)],1)],1)],1),n("a-col",{style:{"padding-bottom":"12px"},attrs:{xl:14,lg:14,md:14,sm:24,xs:24}},[n("a-card",{attrs:{title:"所有友情链接",bodyStyle:{padding:"16px"}}},[n("a-table",{attrs:{columns:t.columns,dataSource:t.links,loading:t.loading,rowKey:function(t){return t.id}},scopedSlots:t._u([{key:"url",fn:function(e){return[n("a",{attrs:{target:"_blank",href:e}},[t._v(t._s(e))])]}},{key:"name",fn:function(e){return n("ellipsis",{attrs:{length:15,tooltip:""}},[t._v(t._s(e))])}},{key:"action",fn:function(e,a){return n("span",{},[n("a",{attrs:{href:"javascript:;"},on:{click:function(e){return t.handleEditLink(a.id)}}},[t._v("编辑")]),n("a-divider",{attrs:{type:"vertical"}}),n("a-popconfirm",{attrs:{title:"你确定要删除【"+a.name+"】链接?",okText:"确定",cancelText:"取消"},on:{confirm:function(e){return t.handleDeleteLink(a.id)}}},[n("a",{attrs:{href:"javascript:;"}},[t._v("删除")])])],1)}}])})],1)],1)],1)],1)},i=[],l=(n("b54a"),n("9efd")),o="/api/admin/links",r={listAll:function(){return Object(l["a"])({url:"".concat(o),method:"get"})},create:function(t){return Object(l["a"])({url:o,data:t,method:"post"})},get:function(t){return Object(l["a"])({url:"".concat(o,"/").concat(t),method:"get"})},update:function(t,e){return Object(l["a"])({url:"".concat(o,"/").concat(t),data:e,method:"put"})},delete:function(t){return Object(l["a"])({url:"".concat(o,"/").concat(t),method:"delete"})}},c=r,s=[{title:"名称",dataIndex:"name",scopedSlots:{customRender:"name"}},{title:"网址",dataIndex:"url",scopedSlots:{customRender:"url"}},{title:"分组",dataIndex:"team"},{title:"操作",key:"action",scopedSlots:{customRender:"action"}}],d={data:function(){return{formType:"create",data:[],loading:!1,columns:s,links:[],link:{}}},computed:{title:function(){return this.link.id?"修改友情链接":"添加友情链接"}},created:function(){this.loadLinks()},methods:{loadLinks:function(){var t=this;this.loading=!0,c.listAll().then(function(e){t.links=e.data.data,t.loading=!1})},handleSaveClick:function(){this.createOrUpdateLink()},handleAddLink:function(){this.formType="create",this.link={}},handleEditLink:function(t){var e=this;c.get(t).then(function(t){e.link=t.data.data,e.formType="update"})},handleDeleteLink:function(t){var e=this;c.delete(t).then(function(t){e.$message.success("删除成功!"),e.loadLinks()})},createOrUpdateLink:function(){var t=this;this.link.id?c.update(this.link.id,this.link).then(function(e){t.$message.success("更新成功!"),t.loadLinks()}):c.create(this.link).then(function(e){t.$message.success("保存成功!"),t.loadLinks()}),this.handleAddLink()}}},u=d,p=n("2877"),m=Object(p["a"])(u,a,i,!1,null,null,null);e["default"]=m.exports}}]);
\ No newline at end of file
......@@ -21,7 +21,7 @@ spring:
# MySQL 配置
# driver-class-name: com.mysql.cj.jdbc.Driver
# url: jdbc:mysql://127.0.0.1:3306/halodb?characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai
# url: jdbc:mysql://127.0.0.1:3306/halodb?characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true
# username: root
# password: 123456
......
......@@ -21,7 +21,7 @@ spring:
# MySQL 配置
# driver-class-name: com.mysql.cj.jdbc.Driver
# url: jdbc:mysql://127.0.0.1:3306/halodb?characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai
# url: jdbc:mysql://127.0.0.1:3306/halodb?characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true
# username: root
# password: 123456
......
......@@ -12,7 +12,7 @@ spring:
# MySQL 配置,如果你需要使用 H2 Database,请注释掉该配置并取消注释上方 H2 Database 的配置。
# driver-class-name: com.mysql.cj.jdbc.Driver
# url: jdbc:mysql://127.0.0.1:3306/halodb?characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai
# url: jdbc:mysql://127.0.0.1:3306/halodb?characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true
# username: root
# password: 123456
......
......@@ -23,7 +23,7 @@ spring:
# MySQL 配置
# driver-class-name: com.mysql.cj.jdbc.Driver
# url: jdbc:mysql://127.0.0.1:3306/halodb?characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai
# url: jdbc:mysql://127.0.0.1:3306/halodb?characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true
# username: root
# password: 123456
......
......@@ -63,7 +63,7 @@ style:
icon:
name: icon
label: 右上角图标
type: text
type: attachment
post_title_uppper:
name: post_title_uppper
label: 文章标题大写
......@@ -111,12 +111,12 @@ style:
google_color:
name: google_color
label: 浏览器沉浸颜色
type: text
type: color
default: '#fff'
scrollbar:
name: scrollbar
label: 全局滚动条颜色
type: text
type: color
default: '#3798e8'
code_pretty:
name: code_pretty
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册