下标
This commit is contained in:
@@ -2,7 +2,14 @@ package com.quinn.common;
|
|||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
public class EditText {
|
public class EditText {
|
||||||
|
|
||||||
|
List<EditText> children;
|
||||||
|
|
||||||
String text;
|
String text;
|
||||||
|
|
||||||
|
String type;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ public enum RoleType {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public static RoleType parse(String name){
|
public static RoleType parse(String name){
|
||||||
if (StringUtils.isEmpty(name)){
|
if (!StringUtils.isEmpty(name)){
|
||||||
if (ADMIN.getName().equals(name)){
|
if (ADMIN.getName().equals(name)){
|
||||||
return RoleType.ADMIN;
|
return RoleType.ADMIN;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,8 +3,10 @@ package com.quinn.controller;
|
|||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.quinn.common.QuinnConstant;
|
import com.quinn.common.QuinnConstant;
|
||||||
|
import com.quinn.common.RoleType;
|
||||||
import com.quinn.pojo.*;
|
import com.quinn.pojo.*;
|
||||||
import com.quinn.service.*;
|
import com.quinn.service.*;
|
||||||
|
import com.quinn.vo.FindNavReq;
|
||||||
import com.quinn.vo.MyPageParam;
|
import com.quinn.vo.MyPageParam;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Controller;
|
import org.springframework.stereotype.Controller;
|
||||||
@@ -14,6 +16,7 @@ import org.springframework.web.bind.annotation.GetMapping;
|
|||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -25,7 +28,7 @@ import java.util.List;
|
|||||||
* @since 2022-05-01
|
* @since 2022-05-01
|
||||||
*/
|
*/
|
||||||
@Controller
|
@Controller
|
||||||
public class SearchController {
|
public class SearchController extends BaseModelController{
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
SourceService sourceService;
|
SourceService sourceService;
|
||||||
@@ -39,15 +42,53 @@ public class SearchController {
|
|||||||
SourceCategoryService sourceCategoryService;
|
SourceCategoryService sourceCategoryService;
|
||||||
@Resource
|
@Resource
|
||||||
FindService findService;
|
FindService findService;
|
||||||
|
@Resource
|
||||||
|
UserService userService;
|
||||||
|
|
||||||
@GetMapping("/search")
|
@GetMapping("/search")
|
||||||
public String searchAll(String findWhat,Model model){
|
public String searchAll(HttpServletRequest request, String findWhat, Model model){
|
||||||
/**
|
/**
|
||||||
* 为空返回主页
|
* 为空返回主页
|
||||||
*/
|
*/
|
||||||
if (StringUtils.isEmpty(findWhat)){
|
if (StringUtils.isEmpty(findWhat)){
|
||||||
return "index";
|
return "index";
|
||||||
}
|
}
|
||||||
|
String loginUserId = getLoginUserId(request);
|
||||||
|
User uid = userService.getOne(new QueryWrapper<User>().eq("uid", loginUserId));
|
||||||
|
if (RoleType.ADMIN.getName().equals(uid.getRole())){
|
||||||
|
String result = doAdmin(findWhat, model);
|
||||||
|
if (!QuinnConstant.GUN.equals(result)){
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 正式开始,全局搜索
|
||||||
|
*/
|
||||||
|
MyPageParam myPageParam = new MyPageParam(1, 20);
|
||||||
|
List<FindResult> findList = findService.listFinds(findWhat, myPageParam);
|
||||||
|
model.addAttribute("findWhat",findWhat);
|
||||||
|
// 结果
|
||||||
|
model.addAttribute("findList",findList);
|
||||||
|
model.addAttribute("pageParam",myPageParam);
|
||||||
|
return "page/allsearch";
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/search")
|
||||||
|
public String search(FindNavReq findNavReq, Model model){
|
||||||
|
String findWhat = findNavReq.getFindWhat();
|
||||||
|
if (findNavReq.getPageNum() < 1){
|
||||||
|
findNavReq.setPageNum(1);
|
||||||
|
}
|
||||||
|
MyPageParam myPageParam = new MyPageParam(findNavReq.getPageNum(),findNavReq.getLimit());
|
||||||
|
List<FindResult> findList = findService.listFinds(findWhat, myPageParam);
|
||||||
|
model.addAttribute("findWhat",findWhat);
|
||||||
|
// 结果
|
||||||
|
model.addAttribute("findList",findList);
|
||||||
|
model.addAttribute("pageParam",myPageParam);
|
||||||
|
return "page/allsearch::user_table_refresh";
|
||||||
|
}
|
||||||
|
|
||||||
|
private String doAdmin(String findWhat,Model model){
|
||||||
/**
|
/**
|
||||||
* 新增资源
|
* 新增资源
|
||||||
*/
|
*/
|
||||||
@@ -81,20 +122,9 @@ public class SearchController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return QuinnConstant.GUN;
|
||||||
/**
|
|
||||||
* 正式开始,全局搜索
|
|
||||||
*/
|
|
||||||
MyPageParam myPageParam = new MyPageParam(1, 10);
|
|
||||||
List<FindResult> findList = findService.listFinds(findWhat, myPageParam);
|
|
||||||
model.addAttribute("findWhat",findWhat);
|
|
||||||
// 结果
|
|
||||||
model.addAttribute("findList",findList);
|
|
||||||
model.addAttribute("pageParam",myPageParam);
|
|
||||||
return "page/allsearch";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
|
|||||||
if (roleType == null){
|
if (roleType == null){
|
||||||
roleType = RoleType.NORMAL;
|
roleType = RoleType.NORMAL;
|
||||||
}
|
}
|
||||||
SimpleGrantedAuthority authority = new SimpleGrantedAuthority(roleType.getName());
|
SimpleGrantedAuthority authority = new SimpleGrantedAuthority(roleType.name());
|
||||||
authList.add(authority);
|
authList.add(authority);
|
||||||
//实例化UserDetails对象
|
//实例化UserDetails对象
|
||||||
userDetails=new org.springframework.security.core.userdetails.User(s,password,
|
userDetails=new org.springframework.security.core.userdetails.User(s,password,
|
||||||
|
|||||||
@@ -7,20 +7,31 @@ import org.springframework.util.CollectionUtils;
|
|||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public interface ContentUtil {
|
public class ContentUtil {
|
||||||
|
|
||||||
static String toTextContentFromWangEdit(String wangEdit){
|
public static String toTextContentFromWangEdit(String wangEdit){
|
||||||
List<WangEdit> decode = JsonUtils.decode(wangEdit, new TypeReference<List<WangEdit>>(){});
|
List<WangEdit> decode = JsonUtils.decode(wangEdit, new TypeReference<List<WangEdit>>(){});
|
||||||
StringBuffer sb = new StringBuffer();
|
StringBuffer sb = new StringBuffer();
|
||||||
decode.forEach(x->{
|
decode.forEach(x->{
|
||||||
List<EditText> children = x.getChildren();
|
List<EditText> children = x.getChildren();
|
||||||
if (!CollectionUtils.isEmpty(children)){
|
if (!CollectionUtils.isEmpty(children)){
|
||||||
children.forEach(y ->{
|
children.forEach(y ->{
|
||||||
sb.append(y.getText());
|
getChildText(sb,y);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
return sb.toString();
|
return sb.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static void getChildText(StringBuffer sb, EditText editText){
|
||||||
|
List<EditText> children = editText.getChildren();
|
||||||
|
if (!CollectionUtils.isEmpty(children)){
|
||||||
|
children.forEach(y ->{
|
||||||
|
getChildText(sb,y);
|
||||||
|
});
|
||||||
|
}else {
|
||||||
|
sb.append(editText.getText());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
22
src/main/java/com/quinn/vo/FindNavReq.java
Normal file
22
src/main/java/com/quinn/vo/FindNavReq.java
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
package com.quinn.vo;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@Accessors(chain = true)
|
||||||
|
public class FindNavReq {
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "页码")
|
||||||
|
private int pageNum;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "个数")
|
||||||
|
private int limit;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "用户编号")
|
||||||
|
private String findWhat;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -4,6 +4,8 @@ spring.profiles.active=dev
|
|||||||
spring.servlet.multipart.max-file-size= 20MB
|
spring.servlet.multipart.max-file-size= 20MB
|
||||||
#设置单次请求文件的总大小
|
#设置单次请求文件的总大小
|
||||||
spring.servlet.multipart.max-request-size= 20MB
|
spring.servlet.multipart.max-request-size= 20MB
|
||||||
|
#设置HTTP POST 请求不限制
|
||||||
|
server.tomcat.max-http-form-post-size=-1
|
||||||
|
|
||||||
oss.accessKeyId=LTAIlbtS4W2Xe4OV
|
oss.accessKeyId=LTAIlbtS4W2Xe4OV
|
||||||
oss.accessKeySecret=qWMYkSfmXFtRoIv9q9OCbszcF9U7dX
|
oss.accessKeySecret=qWMYkSfmXFtRoIv9q9OCbszcF9U7dX
|
||||||
|
|||||||
31
src/main/resources/static/bootstrap/css/bootstrapValidator.css
vendored
Executable file
31
src/main/resources/static/bootstrap/css/bootstrapValidator.css
vendored
Executable file
@@ -0,0 +1,31 @@
|
|||||||
|
/**
|
||||||
|
* BootstrapValidator (http://bootstrapvalidator.com)
|
||||||
|
* The best jQuery plugin to validate form fields. Designed to use with Bootstrap 3
|
||||||
|
*
|
||||||
|
* @author http://twitter.com/nghuuphuoc
|
||||||
|
* @copyright (c) 2013 - 2014 Nguyen Huu Phuoc
|
||||||
|
* @license Commercial: http://bootstrapvalidator.com/license/
|
||||||
|
* Non-commercial: http://creativecommons.org/licenses/by-nc-nd/3.0/
|
||||||
|
*/
|
||||||
|
|
||||||
|
.bv-form .help-block {
|
||||||
|
margin-bottom: 0;
|
||||||
|
}
|
||||||
|
.bv-form .tooltip-inner {
|
||||||
|
text-align: left;
|
||||||
|
}
|
||||||
|
.nav-tabs li.bv-tab-success > a {
|
||||||
|
color: #3c763d;
|
||||||
|
}
|
||||||
|
.nav-tabs li.bv-tab-error > a {
|
||||||
|
color: #a94442;
|
||||||
|
}
|
||||||
|
|
||||||
|
.bv-form .bv-icon-no-label {
|
||||||
|
top: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.bv-form .bv-icon-input-group {
|
||||||
|
top: 0;
|
||||||
|
z-index: 100;
|
||||||
|
}
|
||||||
2003
src/main/resources/static/bootstrap/js/bootstrapValidator.js
vendored
Executable file
2003
src/main/resources/static/bootstrap/js/bootstrapValidator.js
vendored
Executable file
File diff suppressed because it is too large
Load Diff
@@ -18,9 +18,9 @@ const editorConfig = {
|
|||||||
uploadImage: {
|
uploadImage: {
|
||||||
fieldName: 'your-fileName',
|
fieldName: 'your-fileName',
|
||||||
server: '#', // 可以配置上传应用的地址
|
server: '#', // 可以配置上传应用的地址
|
||||||
base64LimitSize: 500 * 1024, // 500K 以下插入 base64
|
base64LimitSize: 1 * 1024 * 1024, // 1M 以下插入 base64
|
||||||
// 单个文件的最大体积限制,默认为 500K
|
// 单个文件的最大体积限制,默认为 500K
|
||||||
maxFileSize: 500 * 1024,
|
maxFileSize: 1 * 1024 * 1024,
|
||||||
// 单个文件上传失败
|
// 单个文件上传失败
|
||||||
onFailed(file, res) {
|
onFailed(file, res) {
|
||||||
$('#warn-text').html(res);
|
$('#warn-text').html(res);
|
||||||
@@ -30,7 +30,7 @@ const editorConfig = {
|
|||||||
onError(file, err, res) {
|
onError(file, err, res) {
|
||||||
layer.open({
|
layer.open({
|
||||||
type: 1, //1:自定义内容 2:iframe
|
type: 1, //1:自定义内容 2:iframe
|
||||||
title: '图片过大(MAX:500KB)',
|
title: '图片超过1MB',
|
||||||
// area: ['500px', '170px'],
|
// area: ['500px', '170px'],
|
||||||
content: '资源有限,大佬请使用网络图片╮(╯▽╰)╭',
|
content: '资源有限,大佬请使用网络图片╮(╯▽╰)╭',
|
||||||
btn: ['好吧穷鬼'],
|
btn: ['好吧穷鬼'],
|
||||||
|
|||||||
@@ -68,7 +68,7 @@
|
|||||||
|
|
||||||
<div th:replace="~{common/footer::footer}"></div>
|
<div th:replace="~{common/footer::footer}"></div>
|
||||||
|
|
||||||
<a class="to-top">返回顶部</a>
|
<a class="to-top badge badge-light">返回顶部</a>
|
||||||
<script th:src="@{/js/jquery-3.5.1.min.js}"></script>
|
<script th:src="@{/js/jquery-3.5.1.min.js}"></script>
|
||||||
<script th:src="@{/bootstrap/js/bootstrap.bundle.min.js}"></script>
|
<script th:src="@{/bootstrap/js/bootstrap.bundle.min.js}"></script>
|
||||||
<script th:src="@{/js/toTop.js}"></script>
|
<script th:src="@{/js/toTop.js}"></script>
|
||||||
|
|||||||
@@ -131,7 +131,7 @@
|
|||||||
|
|
||||||
<div th:replace="~{common/footer::footer}"></div>
|
<div th:replace="~{common/footer::footer}"></div>
|
||||||
|
|
||||||
<a class="to-top">返回顶部</a>
|
<a class="to-top badge badge-light">返回顶部</a>
|
||||||
<script th:src="@{/js/jquery-3.5.1.min.js}"></script>
|
<script th:src="@{/js/jquery-3.5.1.min.js}"></script>
|
||||||
<script th:src="@{/bootstrap/js/bootstrap.bundle.min.js}"></script>
|
<script th:src="@{/bootstrap/js/bootstrap.bundle.min.js}"></script>
|
||||||
<script th:src="@{/js/toTop.js}"></script>
|
<script th:src="@{/js/toTop.js}"></script>
|
||||||
|
|||||||
@@ -93,7 +93,7 @@
|
|||||||
<input type="hidden" name="userAvatar" th:value="${session.loginUser.getAvatar()}">
|
<input type="hidden" name="userAvatar" th:value="${session.loginUser.getAvatar()}">
|
||||||
<input type="hidden" id="topicId" name="topicId" th:value="${blog.getBid()}">
|
<input type="hidden" id="topicId" name="topicId" th:value="${blog.getBid()}">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<textarea name="content" class="form-control" rows="3" required></textarea>
|
<input name="content" class="form-control" rows="3" required />
|
||||||
</div>
|
</div>
|
||||||
<button type="submit" onclick="this.disabled=true; this.form.submit();" class="btn btn-primary float-right">提交评论</button>
|
<button type="submit" onclick="this.disabled=true; this.form.submit();" class="btn btn-primary float-right">提交评论</button>
|
||||||
</form>
|
</form>
|
||||||
@@ -125,7 +125,7 @@
|
|||||||
|
|
||||||
<div th:replace="~{common/footer::footer}"></div>
|
<div th:replace="~{common/footer::footer}"></div>
|
||||||
|
|
||||||
<a class="to-top">返回顶部</a>
|
<a class="to-top badge badge-light">返回顶部</a>
|
||||||
<script th:src="@{/js/jquery-3.5.1.min.js}"></script>
|
<script th:src="@{/js/jquery-3.5.1.min.js}"></script>
|
||||||
<script th:src="@{/bootstrap/js/bootstrap.bundle.min.js}"></script>
|
<script th:src="@{/bootstrap/js/bootstrap.bundle.min.js}"></script>
|
||||||
<script th:src="@{/js/toTop.js}"></script>
|
<script th:src="@{/js/toTop.js}"></script>
|
||||||
|
|||||||
@@ -68,7 +68,7 @@
|
|||||||
</main>
|
</main>
|
||||||
<div th:replace="~{common/footer::footer}"></div>
|
<div th:replace="~{common/footer::footer}"></div>
|
||||||
|
|
||||||
<a class="to-top">返回顶部</a>
|
<a class="to-top badge badge-light">返回顶部</a>
|
||||||
<script th:src="@{/js/jquery-3.5.1.min.js}"></script>
|
<script th:src="@{/js/jquery-3.5.1.min.js}"></script>
|
||||||
<script th:src="@{/bootstrap/js/bootstrap.bundle.min.js}"></script>
|
<script th:src="@{/bootstrap/js/bootstrap.bundle.min.js}"></script>
|
||||||
<script th:src="@{/js/toTop.js}"></script>
|
<script th:src="@{/js/toTop.js}"></script>
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
<footer class="container" th:fragment="footer">
|
<footer class="container" th:fragment="footer">
|
||||||
<footer class="my-5 text-muted text-center text-smal">
|
<footer class="my-5 text-muted text-center text-smal">
|
||||||
<p class="mb-1">©QUINN</p><a class="btn btn-default" target="_blank" href = 'https://beian.miit.gov.cn'>浙ICP备2020031991号</a>
|
<p class="badge badge-pill badge-light">©QUINN</p><a class="badge badge-pill badge-light text-decoration-none" target="_blank" href = 'https://beian.miit.gov.cn'>浙ICP备2020031991号</a>
|
||||||
</footer>
|
</footer>
|
||||||
</footer>
|
</footer>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@@ -97,7 +97,7 @@
|
|||||||
</main>
|
</main>
|
||||||
|
|
||||||
<div th:replace="~{common/footer::footer}"></div>
|
<div th:replace="~{common/footer::footer}"></div>
|
||||||
<a class="to-top">返回顶部</a>
|
<a class="to-top badge badge-light">返回顶部</a>
|
||||||
<script th:src="@{/js/jquery-3.5.1.min.js}"></script>
|
<script th:src="@{/js/jquery-3.5.1.min.js}"></script>
|
||||||
<script th:src="@{/bootstrap/js/bootstrap.bundle.min.js}"></script>
|
<script th:src="@{/bootstrap/js/bootstrap.bundle.min.js}"></script>
|
||||||
<script th:src="@{/js/toTop.js}"></script>
|
<script th:src="@{/js/toTop.js}"></script>
|
||||||
|
|||||||
@@ -8,16 +8,14 @@
|
|||||||
<link rel="stylesheet" th:href="@{/css/login.css}">
|
<link rel="stylesheet" th:href="@{/css/login.css}">
|
||||||
</head>
|
</head>
|
||||||
<body class="text-center">
|
<body class="text-center">
|
||||||
|
<form class="form-signin needs-validation" th:action="@{/login}" method="post">
|
||||||
<form class="form-signin" th:action="@{/login}" method="post">
|
|
||||||
|
|
||||||
<img class="mb-4" th:src="@{/images/logo/logo.png}" alt="" width="72" height="72">
|
<img class="mb-4" th:src="@{/images/logo/logo.png}" alt="" width="72" height="72">
|
||||||
<h1 class="h3 mb-3 font-weight-normal">登录</h1>
|
|
||||||
|
|
||||||
<input name="username" class="form-control" placeholder="用户名" required="">
|
<input name="username" class="form-control" placeholder="用户名" required="">
|
||||||
<input type="password" name="password" class="form-control" placeholder="密码" required="">
|
<input type="password" name="password" class="form-control" placeholder="密码" required="">
|
||||||
|
|
||||||
<div class="checkbox mb-3">
|
<div class="checkbox float-left mb-3">
|
||||||
<label>
|
<label>
|
||||||
<input type="checkbox" name="remember" value="remember-me"> 记住密码
|
<input type="checkbox" name="remember" value="remember-me"> 记住密码
|
||||||
</label>
|
</label>
|
||||||
@@ -29,9 +27,13 @@
|
|||||||
<a th:href="@{/register}" class="float-right">没有账号?去注册</a>
|
<a th:href="@{/register}" class="float-right">没有账号?去注册</a>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p class="mt-5 mb-3 text-muted">©QUINN</p>
|
<p class="badge badge-pill badge-light">©QUINN</p>
|
||||||
</form>
|
</form>
|
||||||
|
<a class="to-top badge badge-light">返回顶部</a>
|
||||||
|
<script th:src="@{/js/jquery-3.5.1.min.js}"></script>
|
||||||
|
<script th:src="@{/bootstrap/js/bootstrap.bundle.min.js}"></script>
|
||||||
|
<script th:src="@{/js/toTop.js}"></script>
|
||||||
|
<script th:src="@{/js/jquery-ui.min.js}"></script>
|
||||||
|
<script th:src="@{/live/js/addlive2d.js}"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@@ -43,7 +43,7 @@
|
|||||||
|
|
||||||
<div th:replace="~{common/footer::footer}"></div>
|
<div th:replace="~{common/footer::footer}"></div>
|
||||||
|
|
||||||
<a class="to-top">返回顶部</a>
|
<a class="to-top badge badge-light">返回顶部</a>
|
||||||
<script th:src="@{/js/jquery-3.5.1.min.js}"></script>
|
<script th:src="@{/js/jquery-3.5.1.min.js}"></script>
|
||||||
<script th:src="@{/bootstrap/js/bootstrap.bundle.min.js}"></script>
|
<script th:src="@{/bootstrap/js/bootstrap.bundle.min.js}"></script>
|
||||||
<script th:src="@{/js/toTop.js}"></script>
|
<script th:src="@{/js/toTop.js}"></script>
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
<link rel="stylesheet" th:href="@{/bootstrap/css/bootstrap.min.css}">
|
<link rel="stylesheet" th:href="@{/bootstrap/css/bootstrap.min.css}">
|
||||||
<style>
|
<style>
|
||||||
#maxLength {
|
#maxLength {
|
||||||
max-width: 500px;
|
max-width: 720px;
|
||||||
white-space: nowrap; /* 不换行 */
|
white-space: nowrap; /* 不换行 */
|
||||||
overflow: hidden; /* 超出部分不显示 */
|
overflow: hidden; /* 超出部分不显示 */
|
||||||
text-overflow: ellipsis; /* 超出部分显示为... */
|
text-overflow: ellipsis; /* 超出部分显示为... */
|
||||||
@@ -19,30 +19,30 @@
|
|||||||
<div th:replace="~{common/header::header(activeUrl='blog')}"></div>
|
<div th:replace="~{common/header::header(activeUrl='blog')}"></div>
|
||||||
|
|
||||||
<main role="main" class="container">
|
<main role="main" class="container">
|
||||||
<div class="row">
|
|
||||||
<div class="col-md-12 blog-main">
|
|
||||||
<div class="my-3 p-3 bg-white rounded shadow-sm">
|
<div class="my-3 p-3 bg-white rounded shadow-sm">
|
||||||
<div th:fragment="user_table_refresh" th:id="id_user_table_refresh">
|
<div th:fragment="user_table_refresh" th:id="id_user_table_refresh">
|
||||||
<h6 class="border-bottom border-gray pb-2 mb-0">
|
<input id="findWhat" type="hidden" th:value="${findWhat}">
|
||||||
论坛累计:
|
<h6 class="border-bottom border-gray pb-2 mt-1">
|
||||||
|
搜索结果:
|
||||||
<span th:text="${pageParam.getTotal()}"></span>
|
<span th:text="${pageParam.getTotal()}"></span>
|
||||||
</h6>
|
</h6>
|
||||||
<div th:each="star:${starList}" class="media text-muted pt-1">
|
<div th:each="find:${findList}" class="media-body small pl-2 border-bottom border-gray pb-2 pt-2">
|
||||||
<p class="media-body pb-1 mb-0 small lh-125 border-bottom border-gray" style="margin-left: 5px">
|
|
||||||
<!-- 标题 -->
|
<!-- 标题 -->
|
||||||
<a th:text="${star.getTopicName()}"
|
|
||||||
th:href="@{${star.getTopicCategory()=='BLOG'?'/blog/read/':'/source/view/'} + ${star.getTopicId()}}"
|
|
||||||
class="text-dark font-weight-bold text-decoration-none d-block">
|
|
||||||
</a>
|
|
||||||
<!-- 类型 -->
|
<!-- 类型 -->
|
||||||
<span th:text="${star.getTopicCategory()=='BLOG'?'论坛':'资源'}"
|
<span th:text="${find.getCategory()=='BLOG'?'论坛':'资源'}"
|
||||||
th:class="${star.getTopicCategory()=='BLOG'?'badge badge-success':'badge badge-primary'}">
|
th:class="${find.getCategory()=='BLOG'?'badge badge-success':'badge badge-primary'}">
|
||||||
</span>
|
</span>
|
||||||
|
<a class="sTitle text-dark font-weight-bold text-decoration-none"
|
||||||
|
th:href="@{${find.getCategory()=='BLOG'?'/blog/read/':'/source/view/'} + ${find.getTopicId()}}">
|
||||||
|
[[${find.getTopicName()}]]
|
||||||
|
</a>
|
||||||
<!-- 时间 -->
|
<!-- 时间 -->
|
||||||
<span th:text="${#dates.format(star.getGmtCreate(),'yyyy-MM-dd HH:mm:ss')}"
|
<p class="float-right" th:text="${#dates.format(find.getGmtCreate(),'yyyy-MM-dd HH:mm:ss')}">
|
||||||
class="float-right">
|
|
||||||
</span>
|
|
||||||
</p>
|
</p>
|
||||||
|
<div class="small">
|
||||||
|
<span id="maxLength" class="sContent d-block" th:text="${find.getContentText()}">
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!--分页-->
|
<!--分页-->
|
||||||
<nav aria-label="Page navigation example" class="mt-4">
|
<nav aria-label="Page navigation example" class="mt-4">
|
||||||
@@ -66,34 +66,58 @@
|
|||||||
</nav>
|
</nav>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</main>
|
</main>
|
||||||
|
|
||||||
|
|
||||||
<div th:replace="~{common/footer::footer}"></div>
|
<div th:replace="~{common/footer::footer}"></div>
|
||||||
|
|
||||||
<a class="to-top">返回顶部</a>
|
<a class="to-top badge badge-light">返回顶部</a>
|
||||||
<script th:src="@{/js/jquery-3.5.1.min.js}"></script>
|
<script th:src="@{/js/jquery-3.5.1.min.js}"></script>
|
||||||
<script th:src="@{/bootstrap/js/bootstrap.bundle.min.js}"></script>
|
<script th:src="@{/bootstrap/js/bootstrap.bundle.min.js}"></script>
|
||||||
<script th:src="@{/js/toTop.js}"></script>
|
<script th:src="@{/js/toTop.js}"></script>
|
||||||
<script th:src="@{/js/jquery-ui.min.js}"></script>
|
<script th:src="@{/js/jquery-ui.min.js}"></script>
|
||||||
<script th:src="@{/live/js/addlive2d.js}"></script>
|
<script th:src="@{/live/js/addlive2d.js}"></script>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
function navChange(page){
|
/**
|
||||||
var current = $('#current').text();
|
* 高亮显示搜索串
|
||||||
var pageNum = parseInt(current) + page;
|
*/
|
||||||
$.ajax({
|
function highLine(){
|
||||||
url: "/blog",
|
const searchStr = $('#findWhat').val();
|
||||||
async: false,
|
const reg = new RegExp(searchStr,'g');
|
||||||
type: "post",
|
let newStr = '';
|
||||||
data: {"pageNum": pageNum, "limit": 10},
|
let label = '';
|
||||||
success: function (data) {
|
$('.sTitle').each(function(){
|
||||||
$('#id_s_table_refresh').html(data);
|
label = $(this).html();
|
||||||
}
|
newStr = label.replace(reg,'<span style="color: red">' + searchStr + '</span>');
|
||||||
|
$(this).html(newStr);
|
||||||
|
});
|
||||||
|
|
||||||
|
$('.sContent').each(function(){
|
||||||
|
label = $(this).html();
|
||||||
|
newStr = label.replace(reg,'<span style="color: red">' + searchStr + '</span>');
|
||||||
|
$(this).html(newStr);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
function navChange(page){
|
||||||
|
var findWhat = $('#findWhat').val()
|
||||||
|
var current = $('#current').text()
|
||||||
|
var pageNum = parseInt(current) + page
|
||||||
|
$.ajax({
|
||||||
|
url: "/search",
|
||||||
|
async: false,
|
||||||
|
type: "post",
|
||||||
|
data: {"findWhat":findWhat,"pageNum": pageNum, "limit": 20},
|
||||||
|
success: function (data) {
|
||||||
|
$('#id_user_table_refresh').html(data);
|
||||||
|
highLine();
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(function(){
|
||||||
|
highLine();
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@@ -27,7 +27,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-12 mb-3">
|
<div class="col-md-12 mb-3">
|
||||||
<button type="submit" class="btn btn-primary btn-sm btn-block">发布公告</button>
|
<button type="submit" class="btn btn-primary btn-block">发布公告</button>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
@@ -36,7 +36,7 @@
|
|||||||
|
|
||||||
<div th:replace="~{common/footer::footer}"></div>
|
<div th:replace="~{common/footer::footer}"></div>
|
||||||
|
|
||||||
<a class="to-top">返回顶部</a>
|
<a class="to-top badge badge-light">返回顶部</a>
|
||||||
<script th:src="@{/js/jquery-3.5.1.min.js}"></script>
|
<script th:src="@{/js/jquery-3.5.1.min.js}"></script>
|
||||||
<script th:src="@{/bootstrap/js/bootstrap.bundle.min.js}"></script>
|
<script th:src="@{/bootstrap/js/bootstrap.bundle.min.js}"></script>
|
||||||
<script th:src="@{/js/toTop.js}"></script>
|
<script th:src="@{/js/toTop.js}"></script>
|
||||||
|
|||||||
@@ -9,26 +9,27 @@
|
|||||||
</head>
|
</head>
|
||||||
<body class="text-center">
|
<body class="text-center">
|
||||||
|
|
||||||
<form class="form-signin" th:action="@{/register}" method="post">
|
<form class="form-signin needs-validation" th:action="@{/register}" method="post">
|
||||||
<img class="mb-4" th:src="@{/images/logo/logo.png}" alt="" width="72" height="72">
|
<img class="mb-4" th:src="@{/images/logo/logo.png}" alt="" width="72" height="72">
|
||||||
<h1 class="h3 mb-3 font-weight-normal">注册</h1>
|
|
||||||
|
|
||||||
<p th:text="${registerMsg}" style="color: red"></p>
|
<p th:text="${registerMsg}" style="color: red"></p>
|
||||||
|
|
||||||
<input type="text" name="username" class="form-control mb-2" placeholder="用户名" required="">
|
<input type="text" name="username" class="form-control mb-2" placeholder="用户名" pattern="[a-zA-Z0-9]+" required=true>
|
||||||
<input type="password" name="password" class="form-control" placeholder="密码" required="">
|
<input type="password" name="password" class="form-control" placeholder="密码" required=true>
|
||||||
<input type="password" name="repassword" class="form-control" placeholder="确认密码" required="">
|
<input type="password" name="repassword" class="form-control" placeholder="确认密码" required="">
|
||||||
<input type="text" name="code" class="form-control" placeholder="邀请码" required="">
|
<input type="text" name="code" class="form-control" placeholder="邀请码" required=true>
|
||||||
|
|
||||||
<button class="btn btn-lg btn-primary btn-block mt-3" type="submit" onclick="this.disabled=true; this.form.submit();">注 册</button>
|
<button class="btn btn-lg btn-primary btn-block mt-3" type="submit" onclick="this.disabled=true; this.form.submit();">注 册</button>
|
||||||
|
|
||||||
<p class="clearfix">
|
<p class="clearfix">
|
||||||
<a th:href="@{/toLogin}" class="float-right">已有账号?去登录</a>
|
<a th:href="@{/toLogin}" class="float-right">已有账号?去登录</a>
|
||||||
</p>
|
</p>
|
||||||
|
<p class="badge badge-pill badge-light">©QUINN</p>
|
||||||
<p class="mt-5 mb-3 text-muted">©QUINN</p>
|
|
||||||
</form>
|
</form>
|
||||||
|
<a class="to-top badge badge-light">返回顶部</a>
|
||||||
|
<script th:src="@{/js/jquery-3.5.1.min.js}"></script>
|
||||||
|
<script th:src="@{/bootstrap/js/bootstrap.bundle.min.js}"></script>
|
||||||
|
<script th:src="@{/js/toTop.js}"></script>
|
||||||
|
<script th:src="@{/js/jquery-ui.min.js}"></script>
|
||||||
|
<script th:src="@{/live/js/addlive2d.js}"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@@ -93,7 +93,7 @@
|
|||||||
</main>
|
</main>
|
||||||
<div th:replace="~{common/footer::footer}"></div>
|
<div th:replace="~{common/footer::footer}"></div>
|
||||||
|
|
||||||
<a class="to-top">返回顶部</a>
|
<a class="to-top badge badge-light">返回顶部</a>
|
||||||
<script th:src="@{/js/jquery-3.5.1.min.js}"></script>
|
<script th:src="@{/js/jquery-3.5.1.min.js}"></script>
|
||||||
<script th:src="@{/bootstrap/js/bootstrap.bundle.min.js}"></script>
|
<script th:src="@{/bootstrap/js/bootstrap.bundle.min.js}"></script>
|
||||||
<script th:src="@{/js/toTop.js}"></script>
|
<script th:src="@{/js/toTop.js}"></script>
|
||||||
|
|||||||
@@ -48,7 +48,7 @@
|
|||||||
|
|
||||||
<div th:replace="~{common/footer::footer}"></div>
|
<div th:replace="~{common/footer::footer}"></div>
|
||||||
|
|
||||||
<a class="to-top">返回顶部</a>
|
<a class="to-top badge badge-light">返回顶部</a>
|
||||||
<script th:src="@{/js/jquery-3.5.1.min.js}"></script>
|
<script th:src="@{/js/jquery-3.5.1.min.js}"></script>
|
||||||
<script th:src="@{/bootstrap/js/bootstrap.bundle.min.js}"></script>
|
<script th:src="@{/bootstrap/js/bootstrap.bundle.min.js}"></script>
|
||||||
<script th:src="@{/js/toTop.js}"></script>
|
<script th:src="@{/js/toTop.js}"></script>
|
||||||
|
|||||||
@@ -27,7 +27,7 @@
|
|||||||
<span th:text="${pageParam.getAllTotal()}"></span>
|
<span th:text="${pageParam.getAllTotal()}"></span>
|
||||||
</h6>
|
</h6>
|
||||||
<div th:fragment="s_table_refresh" th:id="id_s_table_refresh">
|
<div th:fragment="s_table_refresh" th:id="id_s_table_refresh">
|
||||||
<div th:each="source:${sourceList}" class="media pt-3 border-bottom border-gray">
|
<div th:each="source:${sourceList}" class="media pt-2 border-bottom border-gray">
|
||||||
<div class="media-body small pl-2">
|
<div class="media-body small pl-2">
|
||||||
<!-- 标题 -->
|
<!-- 标题 -->
|
||||||
<a th:href="@{'/source/view/'+${source.getSid()}}"
|
<a th:href="@{'/source/view/'+${source.getSid()}}"
|
||||||
@@ -122,7 +122,7 @@
|
|||||||
|
|
||||||
<div th:replace="~{common/footer::footer}"></div>
|
<div th:replace="~{common/footer::footer}"></div>
|
||||||
|
|
||||||
<a class="to-top">返回顶部</a>
|
<a class="to-top badge badge-light">返回顶部</a>
|
||||||
<script th:src="@{/js/jquery-3.5.1.min.js}"></script>
|
<script th:src="@{/js/jquery-3.5.1.min.js}"></script>
|
||||||
<script th:src="@{/bootstrap/js/bootstrap.bundle.min.js}"></script>
|
<script th:src="@{/bootstrap/js/bootstrap.bundle.min.js}"></script>
|
||||||
<script th:src="@{/js/toTop.js}"></script>
|
<script th:src="@{/js/toTop.js}"></script>
|
||||||
|
|||||||
@@ -86,7 +86,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</main>
|
</main>
|
||||||
|
|
||||||
<a class="to-top">返回顶部</a>
|
<a class="to-top badge badge-light">返回顶部</a>
|
||||||
<script th:src="@{/js/jquery-3.5.1.min.js}"></script>
|
<script th:src="@{/js/jquery-3.5.1.min.js}"></script>
|
||||||
<script th:src="@{/bootstrap/js/bootstrap.bundle.min.js}"></script>
|
<script th:src="@{/bootstrap/js/bootstrap.bundle.min.js}"></script>
|
||||||
<script th:src="@{/js/toTop.js}"></script>
|
<script th:src="@{/js/toTop.js}"></script>
|
||||||
|
|||||||
@@ -63,7 +63,7 @@
|
|||||||
<input type="hidden" name="userAvatar" th:value="${session.loginUser.getAvatar()}">
|
<input type="hidden" name="userAvatar" th:value="${session.loginUser.getAvatar()}">
|
||||||
<input type="hidden" id="topicId" name="topicId" th:value="${source.getSid()}">
|
<input type="hidden" id="topicId" name="topicId" th:value="${source.getSid()}">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<textarea name="content" class="form-control" rows="3" required></textarea>
|
<input name="content" class="form-control" rows="3" required />
|
||||||
</div>
|
</div>
|
||||||
<button type="submit" onclick="this.disabled=true; this.form.submit();" class="btn btn-primary float-right">提交评论</button>
|
<button type="submit" onclick="this.disabled=true; this.form.submit();" class="btn btn-primary float-right">提交评论</button>
|
||||||
</form>
|
</form>
|
||||||
@@ -95,7 +95,7 @@
|
|||||||
|
|
||||||
<div th:replace="~{common/footer::footer}"></div>
|
<div th:replace="~{common/footer::footer}"></div>
|
||||||
|
|
||||||
<a class="to-top">返回顶部</a>
|
<a class="to-top badge badge-light">返回顶部</a>
|
||||||
<script th:src="@{/js/jquery-3.5.1.min.js}"></script>
|
<script th:src="@{/js/jquery-3.5.1.min.js}"></script>
|
||||||
<script th:src="@{/bootstrap/js/bootstrap.bundle.min.js}"></script>
|
<script th:src="@{/bootstrap/js/bootstrap.bundle.min.js}"></script>
|
||||||
<script th:src="@{/js/toTop.js}"></script>
|
<script th:src="@{/js/toTop.js}"></script>
|
||||||
|
|||||||
@@ -171,7 +171,7 @@
|
|||||||
|
|
||||||
<div th:replace="~{common/footer::footer}"></div>
|
<div th:replace="~{common/footer::footer}"></div>
|
||||||
|
|
||||||
<a class="to-top">返回顶部</a>
|
<a class="to-top badge badge-light">返回顶部</a>
|
||||||
<script th:src="@{/js/jquery-3.5.1.min.js}"></script>
|
<script th:src="@{/js/jquery-3.5.1.min.js}"></script>
|
||||||
<script th:src="@{/bootstrap/js/bootstrap.bundle.min.js}"></script>
|
<script th:src="@{/bootstrap/js/bootstrap.bundle.min.js}"></script>
|
||||||
<script th:src="@{/js/toTop.js}"></script>
|
<script th:src="@{/js/toTop.js}"></script>
|
||||||
|
|||||||
@@ -86,7 +86,7 @@
|
|||||||
|
|
||||||
<div th:replace="~{common/footer::footer}"></div>
|
<div th:replace="~{common/footer::footer}"></div>
|
||||||
|
|
||||||
<a class="to-top">返回顶部</a>
|
<a class="to-top badge badge-light">返回顶部</a>
|
||||||
<script th:src="@{/js/jquery-3.5.1.min.js}"></script>
|
<script th:src="@{/js/jquery-3.5.1.min.js}"></script>
|
||||||
<script th:src="@{/bootstrap/js/bootstrap.bundle.min.js}"></script>
|
<script th:src="@{/bootstrap/js/bootstrap.bundle.min.js}"></script>
|
||||||
<script th:src="@{/js/toTop.js}"></script>
|
<script th:src="@{/js/toTop.js}"></script>
|
||||||
|
|||||||
@@ -106,7 +106,7 @@
|
|||||||
|
|
||||||
<div th:replace="~{common/footer::footer}"></div>
|
<div th:replace="~{common/footer::footer}"></div>
|
||||||
|
|
||||||
<a class="to-top">返回顶部</a>
|
<a class="to-top badge badge-light">返回顶部</a>
|
||||||
<script th:src="@{/js/jquery-3.5.1.min.js}"></script>
|
<script th:src="@{/js/jquery-3.5.1.min.js}"></script>
|
||||||
<script th:src="@{/bootstrap/js/bootstrap.bundle.min.js}"></script>
|
<script th:src="@{/bootstrap/js/bootstrap.bundle.min.js}"></script>
|
||||||
<script th:src="@{/js/toTop.js}"></script>
|
<script th:src="@{/js/toTop.js}"></script>
|
||||||
|
|||||||
@@ -107,7 +107,7 @@
|
|||||||
|
|
||||||
<div th:replace="~{common/footer::footer}"></div>
|
<div th:replace="~{common/footer::footer}"></div>
|
||||||
|
|
||||||
<a class="to-top">返回顶部</a>
|
<a class="to-top badge badge-light">返回顶部</a>
|
||||||
<script th:src="@{/js/jquery-3.5.1.min.js}"></script>
|
<script th:src="@{/js/jquery-3.5.1.min.js}"></script>
|
||||||
<script th:src="@{/bootstrap/js/bootstrap.bundle.min.js}"></script>
|
<script th:src="@{/bootstrap/js/bootstrap.bundle.min.js}"></script>
|
||||||
<script th:src="@{/js/toTop.js}"></script>
|
<script th:src="@{/js/toTop.js}"></script>
|
||||||
|
|||||||
Reference in New Issue
Block a user