修改 表单构建 2021年11月12日14:55:05

master
zhangmeng 2021-11-12 14:55:41 +08:00
parent 17f9e600b1
commit c476488de0
29 changed files with 170 additions and 46 deletions

View File

@ -0,0 +1,42 @@
package com.zhangmeng.admin.manager.controller;
import cn.hutool.crypto.digest.DigestUtil;
import com.zhangmeng.api.service.admin_manager.EncryptControllerApi;
import com.zhangmeng.model.base.baseController.BaseController;
import com.zhangmeng.model.base.baseUtil.CommonUtil;
import com.zhangmeng.model.dto.system.EncryptType;
import com.zhangmeng.model.vo.Result;
import com.zhangmeng.model.vo.StatusCode;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("/crypt")
public class EncryptController extends BaseController implements EncryptControllerApi {
@Override
@PostMapping("/encode")
public Result encode(Model model, EncryptType encryptType, String text) {
EncryptType[] values = EncryptType.values();
model.addAttribute("values",values);
String encrypt_text = null;
if (encryptType != null) {
switch (encryptType) {
case Md5:
encrypt_text = CommonUtil.md5Encrypt(text);
break;
case SHA256:
encrypt_text = DigestUtil.sha256Hex(text);
break;
case BCryptPasswordEncoder:
encrypt_text = CommonUtil.bCryptPasswordEncoder(text);
break;
}
}
return new Result(true, StatusCode.OK,"查询成功",encrypt_text);
}
}

View File

@ -5,7 +5,7 @@ import com.zhangmeng.admin.manager.utils.UserUtil;
import com.zhangmeng.api.service.admin_manager.PermissionControllerApi;
import com.zhangmeng.model.base.baseController.BaseController;
import com.zhangmeng.model.base.baseUtil.CommonUtil;
import com.zhangmeng.model.dto.Menu;
import com.zhangmeng.model.dto.system.Menu;
import com.zhangmeng.model.entity.Permission;
import com.zhangmeng.model.vo.Result;
import com.zhangmeng.model.vo.ResultTree;

View File

@ -11,7 +11,8 @@ import com.zhangmeng.admin.manager.service.UserService;
import com.zhangmeng.admin.manager.utils.UserUtil;
import com.zhangmeng.model.base.baseController.BaseController;
import com.zhangmeng.model.base.baseUtil.CommonUtil;
import com.zhangmeng.model.dto.Menu;
import com.zhangmeng.model.dto.system.EncryptType;
import com.zhangmeng.model.dto.system.Menu;
import com.zhangmeng.model.dto.query.QueryParams;
import com.zhangmeng.model.entity.*;
import org.springframework.beans.factory.annotation.Autowired;
@ -23,8 +24,6 @@ import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;
import springfox.documentation.annotations.ApiIgnore;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
import java.util.*;
/**
@ -328,4 +327,26 @@ public class UrlRequestController extends BaseController {
}
return this.jumpPage("admin/job/job-edit");
}
@GetMapping("/crypt/encrypt")
public ModelAndView index(Model model) {
EncryptType[] values = EncryptType.values();
model.addAttribute("encryptTypeList",values);
return this.jumpPage("admin/code/encrypt");
}
@GetMapping("/admin/form/tools")
public ModelAndView form_gen(){
return this.jumpPage("admin/code/form");
}
@GetMapping("/mail/index")
public ModelAndView mail_index() {
return this.jumpPage("admin/mail/list");
}
@GetMapping("/mail/add")
public ModelAndView mail_add() {
return this.jumpPage("admin/mail/add");
}
}

View File

@ -1,6 +1,6 @@
package com.zhangmeng.admin.manager.feign;
import com.zhangmeng.model.dto.SysConstant;
import com.zhangmeng.model.dto.system.SysConstant;
import com.zhangmeng.model.entity.Article;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;

View File

@ -1,7 +1,6 @@
package com.zhangmeng.admin.manager.feign;
import com.zhangmeng.model.dto.SysConstant;
import com.zhangmeng.model.entity.Article;
import com.zhangmeng.model.dto.system.SysConstant;
import com.zhangmeng.model.entity.Category;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;

View File

@ -1,6 +1,6 @@
package com.zhangmeng.admin.manager.feign;
import com.zhangmeng.model.dto.SysConstant;
import com.zhangmeng.model.dto.system.SysConstant;
import com.zhangmeng.model.entity.QuartzJob;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;

View File

@ -1,7 +1,7 @@
package com.zhangmeng.admin.manager.service;
import com.zhangmeng.model.base.baseService.BaseService;
import com.zhangmeng.model.dto.Menu;
import com.zhangmeng.model.dto.system.Menu;
import com.zhangmeng.model.entity.Permission;
import java.util.List;

View File

@ -3,7 +3,7 @@ package com.zhangmeng.admin.manager.service.impl;
import com.zhangmeng.admin.manager.dao.PermissionDao;
import com.zhangmeng.admin.manager.service.PermissionService;
import com.zhangmeng.model.base.baseService.impl.AbstractBaseServiceImpl;
import com.zhangmeng.model.dto.Menu;
import com.zhangmeng.model.dto.system.Menu;
import com.zhangmeng.model.entity.Permission;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;

View File

@ -111,6 +111,9 @@ var checkCron_url = gate_way_url + "/" + quartz_url + "/quartz/cron" + access_to
var quartz_delete_url = gate_way_url + "/" + quartz_url + "/quartz/delete" ;
//定时任务批量删除
var quartz_batchRemove_url = gate_way_url + "/" + quartz_url + "/quartz/batchRemove" ;
//---------------------------------------------------------------------------------------------------------------
//加密工具
var crypt_encode_url = gate_way_url + "/" + admin_manager_url + "/crypt/encode";
//页面跳转
function postToPage(url, token) {

View File

@ -3,7 +3,7 @@
<head>
<meta charset="UTF-8">
<title>权限管理</title>
<link rel="stylesheet" href="${springMacroRequestContext.contextPath}/system/component/pear/css/pear.css"/>
<link rel="stylesheet" href="${springMacroRequestContext.contextPath}/mystyle-cloud-admin-manager/system/component/pear/css/pear.css"/>
</head>
<body class="pear-container">
<div class="layui-col-md9">
@ -47,8 +47,9 @@
</div>
</div>
</div>
<script src="${springMacroRequestContext.contextPath}/system/component/layui/layui.js"></script>
<script src="${springMacroRequestContext.contextPath}/system/component/pear/pear.js"></script>
<script src="${springMacroRequestContext.contextPath}/mystyle-cloud-admin-manager/system/component/layui/layui.js"></script>
<script src="${springMacroRequestContext.contextPath}/mystyle-cloud-admin-manager/system/component/pear/pear.js"></script>
<script src="${springMacroRequestContext.contextPath}/mystyle-cloud-admin-manager/system/admin/js/mystyle-admin.js"></script>
<script>
layui.use(['table', 'form', 'jquery', 'treetable'], function () {
let table = layui.table;
@ -64,9 +65,9 @@
$("#content").val(code);
} else {
var obj = data.field;
obj['token'] = localStorage.getItem("token");
obj['access_token'] = access_token;
$.ajax({
url: '/crypt/encode',
url: crypt_encode_url,
data: obj,
type: 'post',
success: function (result) {

View File

@ -5,8 +5,8 @@
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>layui表单生成器</title>
<link rel="stylesheet" href="${springMacroRequestContext.contextPath}/system/component/pear/css/pear.css">
<link rel="stylesheet" href="${springMacroRequestContext.contextPath}/system/component/code/css/style.css">
<link rel="stylesheet" href="${springMacroRequestContext.contextPath}/mystyle-cloud-admin-manager/system/component/pear/css/pear.css">
<link rel="stylesheet" href="${springMacroRequestContext.contextPath}/mystyle-cloud-admin-manager/system/component/code/css/style.css">
</head>
<body>
<div class="layui-fluid">
@ -73,8 +73,8 @@
</div>
</div>
</body>
<script type="text/javascript" src="${springMacroRequestContext.contextPath}/system/component/layui/layui.js"></script>
<script type="text/javascript" src="${springMacroRequestContext.contextPath}/system/component/pear/pear.js"></script>
<script type="text/javascript" src="${springMacroRequestContext.contextPath}/mystyle-cloud-admin-manager/system/component/layui/layui.js"></script>
<script type="text/javascript" src="${springMacroRequestContext.contextPath}/mystyle-cloud-admin-manager/system/component/pear/pear.js"></script>
<script>
layui.use('design');
</script>

View File

@ -3,13 +3,7 @@
<head>
<meta charset="utf-8">
<title>邮件管理</title>
<link rel="stylesheet" href="${springMacroRequestContext.contextPath}/system/component/pear/css/pear.css" />
<style>
.layui-table-cell{
display:table-cell;
vertical-align: middle;
}
</style>
<link rel="stylesheet" href="${springMacroRequestContext.contextPath}/mystyle-cloud-admin-manager/system/component/pear/css/pear.css" />
</head>
<body class="pear-container">
<div class="layui-card">
@ -80,8 +74,9 @@
}}
</script>
<script src="${springMacroRequestContext.contextPath}/system/component/layui/layui.js"></script>
<script src="${springMacroRequestContext.contextPath}/system/component/pear/pear.js"></script>
<script src="${springMacroRequestContext.contextPath}/mystyle-cloud-admin-manager/system/component/layui/layui.js"></script>
<script src="${springMacroRequestContext.contextPath}/mystyle-cloud-admin-manager/system/component/pear/pear.js"></script>
<script src="${springMacroRequestContext.contextPath}/mystyle-cloud-admin-manager/system/admin/js/mystyle-admin.js"></script>
<script>
layui.use(['table', 'form', 'jquery','common'], function() {
let table = layui.table;
@ -149,7 +144,7 @@
headers: {token: localStorage.getItem("token")},
page: true,
cols: cols,
skin: 'line',
skin: 'rows',
even: true, //开启隔行背景
toolbar: '#mail-toolbar',
defaultToolbar: [{

View File

@ -0,0 +1,15 @@
package com.zhangmeng.api.service.admin_manager;
import com.zhangmeng.model.dto.system.EncryptType;
import com.zhangmeng.model.vo.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.PostMapping;
@Api(tags = "加密")
public interface EncryptControllerApi {
@ApiOperation("加密")
public Result encode(Model model, EncryptType encryptType, String text);
}

View File

@ -1,6 +1,6 @@
package com.zhangmeng.blog.feign;
import com.zhangmeng.model.dto.SysConstant;
import com.zhangmeng.model.dto.system.SysConstant;
import com.zhangmeng.model.entity.User;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;

View File

@ -1,6 +1,6 @@
package com.zhangmeng.file.feign;
import com.zhangmeng.model.dto.SysConstant;
import com.zhangmeng.model.dto.system.SysConstant;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

View File

@ -1,6 +1,6 @@
package com.zhangmeng.file.feign;
import com.zhangmeng.model.dto.SysConstant;
import com.zhangmeng.model.dto.system.SysConstant;
import com.zhangmeng.model.entity.Permission;
import com.zhangmeng.model.entity.User;
import org.springframework.cloud.openfeign.FeignClient;

View File

@ -7,7 +7,7 @@ import com.zhangmeng.file.service.FileInfoService;
import com.zhangmeng.file.service.UploadService;
import com.zhangmeng.file.utils.FastDfsClient;
import com.zhangmeng.file.utils.FileUtil;
import com.zhangmeng.model.dto.FastDfsFileInfo;
import com.zhangmeng.model.dto.system.FastDfsFileInfo;
import com.zhangmeng.model.entity.FileInfo;
import com.zhangmeng.model.vo.Result;
import com.zhangmeng.model.vo.StatusCode;
@ -21,10 +21,7 @@ import org.springframework.web.multipart.MultipartFile;
import javax.imageio.ImageIO;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.time.LocalDate;
import java.util.Date;
import java.util.Objects;

View File

@ -1,5 +1,6 @@
package com.zhangmeng.file.utils;
import com.zhangmeng.model.dto.system.FastDfsFileInfo;
import org.csource.common.NameValuePair;
import org.csource.fastdfs.*;
import org.springframework.core.io.ClassPathResource;
@ -26,7 +27,7 @@ public class FastDfsClient {
* @param file
* @return
*/
public static String[] upload(com.zhangmeng.model.dto.FastDfsFileInfo file) {
public static String[] upload(FastDfsFileInfo file) {
try {
TrackerClient trackerClient = new TrackerClient();
TrackerServer trackerServer = trackerClient.getConnection();

View File

@ -105,5 +105,9 @@
<artifactId>spring-cloud-starter-oauth2</artifactId>
<version>2.2.4.RELEASE</version>
</dependency>
<dependency>
<groupId>cn.hutool</groupId>
<artifactId>hutool-all</artifactId>
</dependency>
</dependencies>
</project>

View File

@ -1,6 +1,8 @@
package com.zhangmeng.model.base.baseUtil;
import cn.hutool.crypto.digest.DigestUtil;
import com.zhangmeng.model.dto.date.DateBean;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import java.io.BufferedInputStream;
import java.io.IOException;
@ -363,4 +365,25 @@ public class CommonUtil {
}
return null;
}
/**
* md5
*
* @param encodeStr
* @return md5
*/
public static String md5Encrypt(String encodeStr) {
return DigestUtil.md5Hex(encodeStr);
}
/**
* spring security
*
* @param encrypt
* @return String
*/
public static String bCryptPasswordEncoder(String encrypt) {
BCryptPasswordEncoder bCryptPasswordEncoder = new BCryptPasswordEncoder();
return bCryptPasswordEncoder.encode(encrypt);
}
}

View File

@ -0,0 +1,24 @@
package com.zhangmeng.model.dto.system;
/**
*
*/
public enum EncryptType {
Md5("md5"),
SHA256("SHA-256"),
BCryptPasswordEncoder("bCryptPasswordEncoder"),
editPlusCodeGen("editPlusCodeGen");
EncryptType(String desc) {
this.desc = desc;
}
private String desc;
public String getDesc() {
return desc;
}
public void setDesc(String desc) {
this.desc = desc;
}
}

View File

@ -1,4 +1,4 @@
package com.zhangmeng.model.dto;
package com.zhangmeng.model.dto.system;
import lombok.Data;

View File

@ -1,4 +1,4 @@
package com.zhangmeng.model.dto;
package com.zhangmeng.model.dto.system;
import lombok.Data;

View File

@ -1,4 +1,4 @@
package com.zhangmeng.model.dto;
package com.zhangmeng.model.dto.system;
import com.zhangmeng.model.base.baseEntity.BaseEntity;
import lombok.Data;

View File

@ -1,4 +1,4 @@
package com.zhangmeng.model.dto;
package com.zhangmeng.model.dto.system;
import com.wf.captcha.SpecCaptcha;
import lombok.Data;

View File

@ -1,4 +1,4 @@
package com.zhangmeng.model.dto;
package com.zhangmeng.model.dto.system;
/**
* @author

View File

@ -1,4 +1,4 @@
package com.zhangmeng.model.dto;
package com.zhangmeng.model.dto.system;
/**
*

View File

@ -1,10 +1,9 @@
package com.zhangmeng.oauth.feign;
import com.zhangmeng.model.dto.SysConstant;
import com.zhangmeng.model.dto.system.SysConstant;
import com.zhangmeng.model.entity.Permission;
import com.zhangmeng.model.entity.User;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

View File

@ -1,6 +1,6 @@
package com.zhangmeng.oauth.service.impl;
import com.zhangmeng.model.dto.SysConstant;
import com.zhangmeng.model.dto.system.SysConstant;
import com.zhangmeng.model.dto.exception.CustomizeException;
import com.zhangmeng.oauth.dto.AuthToken;
import com.zhangmeng.oauth.service.AuthService;