Compare commits
No commits in common. "1788b94653180f5a1fb3b5efb2cdfa9785bf9ec0" and "d9ce1f746b31471dea69b495aae6af280f142cad" have entirely different histories.
1788b94653
...
d9ce1f746b
@ -27,7 +27,6 @@
|
|||||||
综合考虑技术生态、团队能力和平台功能需求,初步考虑以下的技术组合:
|
综合考虑技术生态、团队能力和平台功能需求,初步考虑以下的技术组合:
|
||||||
|
|
||||||
- 前端:Vue + ElementUI + Mapbox GL(可结合已有GIS资源选择) + ECharts/AntV
|
- 前端:Vue + ElementUI + Mapbox GL(可结合已有GIS资源选择) + ECharts/AntV
|
||||||
-- 前端库安装 yarn install
|
|
||||||
- 后端:Spring Boot3.0 + PostgreSQL + PostGIS
|
- 后端:Spring Boot3.0 + PostgreSQL + PostGIS
|
||||||
- 低代码支持:DataEase 开源二次开发
|
- 低代码支持:DataEase 开源二次开发
|
||||||
- DevOps:Docker + Kubernetes
|
- DevOps:Docker + Kubernetes
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
package io.gisbi.application.baseinfo.service.impl;
|
package io.gisbi.application.baseinfo.service.impl;
|
||||||
|
|
||||||
import cn.hutool.core.util.StrUtil;
|
|
||||||
import com.baomidou.mybatisplus.core.assist.ISqlRunner;
|
import com.baomidou.mybatisplus.core.assist.ISqlRunner;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import io.gisbi.application.baseinfo.domain.Application;
|
import io.gisbi.application.baseinfo.domain.Application;
|
||||||
@ -80,8 +79,8 @@ public class ApplicationServiceImpl extends ServiceImpl<ApplicationMapper, Appli
|
|||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public boolean removeById(String id) {
|
public boolean removeById(String id) {
|
||||||
if (StrUtil.isNotBlank(id)) {
|
if (id == null || id.trim().isEmpty()) {
|
||||||
applicationMapper.deleteById(id);
|
this.removeById(id);
|
||||||
moduleService.deleteModulesByAppID(id);
|
moduleService.deleteModulesByAppID(id);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
@ -1,13 +1,10 @@
|
|||||||
package io.gisbi.application.system.controller;
|
package io.gisbi.application.system.controller;
|
||||||
|
|
||||||
import cn.hutool.core.util.ObjUtil;
|
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import io.gisbi.application.system.domain.User;
|
import io.gisbi.application.system.domain.User;
|
||||||
import io.gisbi.application.system.service.IUserService;
|
import io.gisbi.application.system.service.IUserService;
|
||||||
import io.gisbi.config.ResponseResult;
|
import io.gisbi.config.ResponseResult;
|
||||||
import io.gisbi.utils.RsaUtils;
|
|
||||||
import io.micrometer.common.util.StringUtils;
|
import io.micrometer.common.util.StringUtils;
|
||||||
import jakarta.annotation.Resource;
|
import jakarta.annotation.Resource;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
@ -160,23 +157,4 @@ public class UserController {
|
|||||||
return ResponseResult.error();
|
return ResponseResult.error();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@PostMapping("/login")
|
|
||||||
@ResponseBody
|
|
||||||
public ResponseResult login(String username, String password) {
|
|
||||||
if (StringUtils.isEmpty(username) || StringUtils.isEmpty(password)) {
|
|
||||||
return ResponseResult.error("用户名称或者密码不能为空!");
|
|
||||||
}
|
|
||||||
// 根据用户名查询用户
|
|
||||||
QueryWrapper<User> queryWrapper = new QueryWrapper<>();
|
|
||||||
User user = userService.getOne(queryWrapper.eq("username", username));
|
|
||||||
if (ObjUtil.isEmpty( user)) {
|
|
||||||
return ResponseResult.error(String.format("%s您输入的用户账号不存在!", username));
|
|
||||||
}
|
|
||||||
String encryptpass = RsaUtils.encryptStr( password);
|
|
||||||
if(encryptpass.equals(user.getPassword())){
|
|
||||||
return ResponseResult.successData(user);
|
|
||||||
}else{
|
|
||||||
return ResponseResult.error("您输入的密码错误!");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -14,7 +14,6 @@ import io.gisbi.application.system.mapper.RoleMapper;
|
|||||||
import io.gisbi.application.system.mapper.UserMapper;
|
import io.gisbi.application.system.mapper.UserMapper;
|
||||||
import io.gisbi.application.system.service.IUserService;
|
import io.gisbi.application.system.service.IUserService;
|
||||||
import io.gisbi.utils.AuthUtils;
|
import io.gisbi.utils.AuthUtils;
|
||||||
import io.gisbi.utils.RsaUtils;
|
|
||||||
import io.micrometer.common.util.StringUtils;
|
import io.micrometer.common.util.StringUtils;
|
||||||
import io.netty.channel.ChannelInboundHandlerAdapter;
|
import io.netty.channel.ChannelInboundHandlerAdapter;
|
||||||
import jakarta.annotation.Resource;
|
import jakarta.annotation.Resource;
|
||||||
@ -64,9 +63,10 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IU
|
|||||||
//返回信息
|
//返回信息
|
||||||
Map<String, String> result = new HashMap<>();
|
Map<String, String> result = new HashMap<>();
|
||||||
//普通用户
|
//普通用户
|
||||||
//设置缺省密码
|
// BCryptPasswordEncoder passwordEncoder = new BCryptPasswordEncoder();
|
||||||
String cryptPassword = RsaUtils.encryptStr(PASSWORD_VALID);
|
// //设置缺省密码
|
||||||
user.setPassword(cryptPassword);
|
// String cryptPassword = passwordEncoder.encode("123456");
|
||||||
|
user.setPassword(PASSWORD_VALID);
|
||||||
//最近修改日期
|
//最近修改日期
|
||||||
user.setLastmodifydate(LocalDateTime.now());
|
user.setLastmodifydate(LocalDateTime.now());
|
||||||
//最近修改者
|
//最近修改者
|
||||||
@ -347,6 +347,4 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IU
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -21,7 +21,6 @@
|
|||||||
"@codemirror/lang-sql": "^6.4.0",
|
"@codemirror/lang-sql": "^6.4.0",
|
||||||
"@form-create/designer": "^3.2.11",
|
"@form-create/designer": "^3.2.11",
|
||||||
"@form-create/element-ui": "^3.2.22",
|
"@form-create/element-ui": "^3.2.22",
|
||||||
"@form-create/vant": "^3.2.25",
|
|
||||||
"@monaco-editor/loader": "^1.5.0",
|
"@monaco-editor/loader": "^1.5.0",
|
||||||
"@npkg/tinymce-plugins": "^0.0.7",
|
"@npkg/tinymce-plugins": "^0.0.7",
|
||||||
"@tinymce/tinymce-vue": "^5.1.0",
|
"@tinymce/tinymce-vue": "^5.1.0",
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -23,16 +23,9 @@ import java.security.spec.PKCS8EncodedKeySpec;
|
|||||||
import java.security.spec.X509EncodedKeySpec;
|
import java.security.spec.X509EncodedKeySpec;
|
||||||
import java.util.Base64;
|
import java.util.Base64;
|
||||||
|
|
||||||
/**
|
|
||||||
* RSA加密工具类
|
|
||||||
* 提供RSA密钥生成、加密、解密功能,以及AES对称加密相关功能
|
|
||||||
*/
|
|
||||||
@Component
|
@Component
|
||||||
public class RsaUtils {
|
public class RsaUtils {
|
||||||
|
|
||||||
/**
|
|
||||||
* 静态初始化块:添加Bouncy Castle安全提供者
|
|
||||||
*/
|
|
||||||
static {
|
static {
|
||||||
if (ObjectUtils.isNotEmpty(Security.getProvider("BC"))) {
|
if (ObjectUtils.isNotEmpty(Security.getProvider("BC"))) {
|
||||||
Security.removeProvider("BC");
|
Security.removeProvider("BC");
|
||||||
@ -54,10 +47,6 @@ public class RsaUtils {
|
|||||||
RsaUtils.rsaManage = rsaManage;
|
RsaUtils.rsaManage = rsaManage;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 生成RSA密钥对
|
|
||||||
* @return KeyPair对象,包含公钥和私钥
|
|
||||||
*/
|
|
||||||
private static KeyPair getKeyPair() {
|
private static KeyPair getKeyPair() {
|
||||||
KeyPairGenerator generator = null;
|
KeyPairGenerator generator = null;
|
||||||
try {
|
try {
|
||||||
@ -96,13 +85,6 @@ public class RsaUtils {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 使用公钥进行RSA加密
|
|
||||||
* @param data 待加密数据
|
|
||||||
* @param publicKey 公钥
|
|
||||||
* @return 加密后的Base64编码字符串
|
|
||||||
* @throws Exception 加密异常
|
|
||||||
*/
|
|
||||||
private static String encrypt(String data, PublicKey publicKey) throws Exception {
|
private static String encrypt(String data, PublicKey publicKey) throws Exception {
|
||||||
Cipher cipher = Cipher.getInstance("RSA");
|
Cipher cipher = Cipher.getInstance("RSA");
|
||||||
cipher.init(Cipher.ENCRYPT_MODE, publicKey);
|
cipher.init(Cipher.ENCRYPT_MODE, publicKey);
|
||||||
@ -126,13 +108,6 @@ public class RsaUtils {
|
|||||||
return Base64.getEncoder().encodeToString(encryptedData);
|
return Base64.getEncoder().encodeToString(encryptedData);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 使用私钥进行RSA解密
|
|
||||||
* @param data 待解密的Base64编码字符串
|
|
||||||
* @param privateKey 私钥
|
|
||||||
* @return 解密后的原始数据
|
|
||||||
* @throws Exception 解密异常
|
|
||||||
*/
|
|
||||||
private static String decrypt(String data, PrivateKey privateKey) throws Exception {
|
private static String decrypt(String data, PrivateKey privateKey) throws Exception {
|
||||||
Cipher cipher = Cipher.getInstance("RSA");
|
Cipher cipher = Cipher.getInstance("RSA");
|
||||||
cipher.init(Cipher.DECRYPT_MODE, privateKey);
|
cipher.init(Cipher.DECRYPT_MODE, privateKey);
|
||||||
@ -156,10 +131,6 @@ public class RsaUtils {
|
|||||||
return out.toString(StandardCharsets.UTF_8);
|
return out.toString(StandardCharsets.UTF_8);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 生成RSA密钥对和AES密钥
|
|
||||||
* @return RSAModel对象,包含公钥、私钥和AES密钥
|
|
||||||
*/
|
|
||||||
public static RSAModel generate() {
|
public static RSAModel generate() {
|
||||||
KeyPair keyPair = getKeyPair();
|
KeyPair keyPair = getKeyPair();
|
||||||
String privateKey = new String(Base64.getEncoder().encode(keyPair.getPrivate().getEncoded()));
|
String privateKey = new String(Base64.getEncoder().encode(keyPair.getPrivate().getEncoded()));
|
||||||
@ -193,10 +164,6 @@ public class RsaUtils {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取系统存储的私钥
|
|
||||||
* @return CoreRsa对象中的私钥字符串
|
|
||||||
*/
|
|
||||||
public static String privateKey() {
|
public static String privateKey() {
|
||||||
CoreRsa coreRsa = rsaManage.query();
|
CoreRsa coreRsa = rsaManage.query();
|
||||||
return coreRsa.getPrivateKey();
|
return coreRsa.getPrivateKey();
|
||||||
@ -237,17 +204,11 @@ public class RsaUtils {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* AES对称加密算法参数
|
|
||||||
*/
|
|
||||||
private static final String ALGORITHM = "AES";
|
private static final String ALGORITHM = "AES";
|
||||||
public static String symmetricKey = null;
|
public static String symmetricKey = null;
|
||||||
private static final int KEY_SIZE = 128;
|
private static final int KEY_SIZE = 128;
|
||||||
|
|
||||||
/**
|
|
||||||
* 生成AES对称加密密钥
|
|
||||||
* @return Base64编码的密钥字符串
|
|
||||||
*/
|
|
||||||
public static String generateSymmetricKey() {
|
public static String generateSymmetricKey() {
|
||||||
try {
|
try {
|
||||||
if (StringUtils.isEmpty(symmetricKey)) {
|
if (StringUtils.isEmpty(symmetricKey)) {
|
||||||
@ -262,11 +223,6 @@ public class RsaUtils {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 使用AES对称密钥进行加密
|
|
||||||
* @param data 待加密的数据
|
|
||||||
* @return 加密后的Base64编码字符串
|
|
||||||
*/
|
|
||||||
public static String symmetricEncrypt(String data) {
|
public static String symmetricEncrypt(String data) {
|
||||||
try {
|
try {
|
||||||
byte[] iv = IV_KEY.getBytes(StandardCharsets.UTF_8);
|
byte[] iv = IV_KEY.getBytes(StandardCharsets.UTF_8);
|
||||||
@ -281,11 +237,6 @@ public class RsaUtils {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 使用AES对称密钥进行解密
|
|
||||||
* @param data 待解密的Base64编码字符串
|
|
||||||
* @return 解密后的原始数据
|
|
||||||
*/
|
|
||||||
public static String symmetricDecrypt(String data) {
|
public static String symmetricDecrypt(String data) {
|
||||||
try {
|
try {
|
||||||
byte[] iv = IV_KEY.getBytes(StandardCharsets.UTF_8);
|
byte[] iv = IV_KEY.getBytes(StandardCharsets.UTF_8);
|
||||||
|
Loading…
Reference in New Issue
Block a user