mirror of
https://gitee.com/lab1024/smart-admin.git
synced 2025-11-21 18:06:52 +08:00
Compare commits
6 Commits
v3.27.0
...
38a92824ba
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
38a92824ba | ||
|
|
bf8311c296 | ||
|
|
686f6ac9a3 | ||
|
|
63ef235b95 | ||
|
|
3ceea05ba1 | ||
|
|
9fda0a7bd6 |
@@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
**<font color="#DC143C">国内首个满足《网络安全-三级等保》、《数据安全》</font>** 功能要求,支持登录限制、接口国产加解密、数据脱敏等一系列安全要求。
|
**<font color="#DC143C">国内首个满足《网络安全-三级等保》、《数据安全》</font>** 功能要求,支持登录限制、接口国产加解密、数据脱敏等一系列安全要求。
|
||||||
|
|
||||||
**<font color="#DC143C">支持国产数据库:【达梦、金仓、南大通用、OceanBase、GaussDB 高斯、阿里PolarDB、GoldenDB】等,主流数据库:【Mysql, PostgreSQL】等</font>**
|
**<font color="#DC143C">支持国产数据库:【达梦、金仓、南大通用、海量数据、神州通用、OceanBase、GaussDB 高斯、阿里PolarDB、GoldenDB】等,主流数据库:【Mysql, PostgreSQL】等</font>**
|
||||||
|
|
||||||
**<font color="#DC143C">前端提供JavaScript和TypeScript双版本,后端提供Java8+SpringBoot2.X和Java17+SpringBoot3.X 双版本</font>**。
|
**<font color="#DC143C">前端提供JavaScript和TypeScript双版本,后端提供Java8+SpringBoot2.X和Java17+SpringBoot3.X 双版本</font>**。
|
||||||
|
|
||||||
|
|||||||
@@ -20,17 +20,25 @@ public class LongJsonSerializer extends JsonSerializer<Long> {
|
|||||||
|
|
||||||
public static final LongJsonSerializer INSTANCE = new LongJsonSerializer();
|
public static final LongJsonSerializer INSTANCE = new LongJsonSerializer();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* JS 安全整数范围
|
||||||
|
* 根据 JS Number.MIN_SAFE_INTEGER 与 Number.MAX_SAFE_INTEGER 得来
|
||||||
|
*/
|
||||||
|
private static final long JS_MIN_SAFE_INTEGER = -9007199254740991L;
|
||||||
|
private static final long JS_MAX_SAFE_INTEGER = 9007199254740991L;
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void serialize(Long value, JsonGenerator gen, SerializerProvider serializerProvider) throws IOException, JsonProcessingException {
|
public void serialize(Long value, JsonGenerator gen, SerializerProvider serializerProvider) throws IOException, JsonProcessingException {
|
||||||
if (null == value) {
|
if (null == value) {
|
||||||
gen.writeNull();
|
gen.writeNull();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// js中最大安全整数16位 Number.MAX_SAFE_INTEGER
|
// 如果超出了 JavaScript 安全整数范围,则序列化为字符串
|
||||||
String longStr = String.valueOf(value);
|
if (value < JS_MIN_SAFE_INTEGER || value > JS_MAX_SAFE_INTEGER) {
|
||||||
if (longStr.length() > 16) {
|
gen.writeString(Long.toString(value));
|
||||||
gen.writeString(longStr);
|
|
||||||
} else {
|
} else {
|
||||||
|
// 否则,序列化为数字
|
||||||
gen.writeNumber(value);
|
gen.writeNumber(value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package net.lab1024.sa.base.config;
|
|||||||
|
|
||||||
import cn.hutool.core.date.DatePattern;
|
import cn.hutool.core.date.DatePattern;
|
||||||
import cn.hutool.core.date.LocalDateTimeUtil;
|
import cn.hutool.core.date.LocalDateTimeUtil;
|
||||||
|
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||||
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateDeserializer;
|
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateDeserializer;
|
||||||
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
|
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
|
||||||
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateSerializer;
|
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateSerializer;
|
||||||
@@ -13,6 +14,8 @@ import org.springframework.context.annotation.Bean;
|
|||||||
import org.springframework.context.annotation.Configuration;
|
import org.springframework.context.annotation.Configuration;
|
||||||
import org.springframework.core.convert.converter.Converter;
|
import org.springframework.core.convert.converter.Converter;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.math.BigInteger;
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.time.format.DateTimeParseException;
|
import java.time.format.DateTimeParseException;
|
||||||
@@ -37,6 +40,9 @@ public class JsonConfig {
|
|||||||
builder.serializers(new LocalDateSerializer(DatePattern.NORM_DATE_FORMAT.getDateTimeFormatter()));
|
builder.serializers(new LocalDateSerializer(DatePattern.NORM_DATE_FORMAT.getDateTimeFormatter()));
|
||||||
builder.serializers(new LocalDateTimeSerializer(DatePattern.NORM_DATETIME_FORMAT.getDateTimeFormatter()));
|
builder.serializers(new LocalDateTimeSerializer(DatePattern.NORM_DATETIME_FORMAT.getDateTimeFormatter()));
|
||||||
builder.serializerByType(Long.class, LongJsonSerializer.INSTANCE);
|
builder.serializerByType(Long.class, LongJsonSerializer.INSTANCE);
|
||||||
|
builder.serializerByType(Long.TYPE, LongJsonSerializer.INSTANCE);
|
||||||
|
builder.serializerByType(BigInteger.class, ToStringSerializer.instance);
|
||||||
|
builder.serializerByType(BigDecimal.class, ToStringSerializer.instance);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,6 @@ import org.springframework.data.redis.cache.RedisCacheManager;
|
|||||||
import org.springframework.data.redis.connection.RedisConnection;
|
import org.springframework.data.redis.connection.RedisConnection;
|
||||||
import org.springframework.data.redis.connection.RedisConnectionFactory;
|
import org.springframework.data.redis.connection.RedisConnectionFactory;
|
||||||
|
|
||||||
import java.nio.charset.StandardCharsets;
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
@@ -54,7 +53,7 @@ public class RedisCacheServiceImpl implements CacheService {
|
|||||||
|
|
||||||
if (keys != null) {
|
if (keys != null) {
|
||||||
return keys.stream().map(key -> {
|
return keys.stream().map(key -> {
|
||||||
String redisKey = StrUtil.str(key, StandardCharsets.UTF_8);
|
String redisKey = StrUtil.str(key, "utf-8");
|
||||||
// 从 Redis 键中提取出最后一个冒号后面的字符串作为真正的键
|
// 从 Redis 键中提取出最后一个冒号后面的字符串作为真正的键
|
||||||
return redisKey.substring(redisKey.lastIndexOf(":") + 1);
|
return redisKey.substring(redisKey.lastIndexOf(":") + 1);
|
||||||
}).collect(Collectors.toList());
|
}).collect(Collectors.toList());
|
||||||
|
|||||||
@@ -1,144 +0,0 @@
|
|||||||
package net.lab1024.sa.base.module.support.cache.manager;
|
|
||||||
|
|
||||||
import cn.hutool.core.util.StrUtil;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.springframework.boot.convert.DurationStyle;
|
|
||||||
import org.springframework.data.redis.cache.*;
|
|
||||||
|
|
||||||
import java.time.Duration;
|
|
||||||
|
|
||||||
import static net.lab1024.sa.base.common.constant.StringConst.COLON;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 自定义 RedisCacheManager,支持在 cacheName 中通过 '#' 指定 TTL(过期时间)。
|
|
||||||
* @Author CoderKK
|
|
||||||
* @Date 2025-08-15 13:01:01
|
|
||||||
* <p>
|
|
||||||
* 支持格式:{@code cacheName#ttl},其中 ttl 支持 Spring 的 Duration 格式。
|
|
||||||
* 特殊值:{@code -1} 表示永久缓存(永不过期)。
|
|
||||||
* </p>
|
|
||||||
*
|
|
||||||
* <h3>使用示例:</h3>
|
|
||||||
* <pre>
|
|
||||||
* // 10 秒后过期
|
|
||||||
* @Cacheable(value = "user#10s", key = "#id")
|
|
||||||
* // 2 小时后过期
|
|
||||||
* @Cacheable(value = "report#2h", key = "#date")
|
|
||||||
* // 30 分钟后过期
|
|
||||||
* @Cacheable(value = "session#30m", key = "#token")
|
|
||||||
* // 永不过期(永久缓存),适用于极少变化的配置数据
|
|
||||||
* @Cacheable(value = "appConfig#-1", key = "'globalSettings'")
|
|
||||||
* // 无 TTL,使用全局默认过期时间(如 7 天)
|
|
||||||
* @Cacheable(value = "product", key = "#productId")
|
|
||||||
* </pre>
|
|
||||||
*
|
|
||||||
* <h3>生成的 Redis Key 格式:</h3>
|
|
||||||
* <pre>
|
|
||||||
* cache:cacheName:key
|
|
||||||
* 例如:cache:user:123
|
|
||||||
* cache:appConfig:globalSettings
|
|
||||||
* </pre>
|
|
||||||
*
|
|
||||||
* <h3>支持的 TTL 单位:</h3>
|
|
||||||
* <ul>
|
|
||||||
* <li>{@code ms} / {@code millis} / {@code milliseconds} - 毫秒</li>
|
|
||||||
* <li>{@code s} / {@code secs} / {@code seconds} - 秒</li>
|
|
||||||
* <li>{@code m} / {@code mins} / {@code minutes} - 分钟</li>
|
|
||||||
* <li>{@code h} / {@code hrs} / {@code hours} - 小时</li>
|
|
||||||
* <li>{@code d} / {@code days} - 天</li>
|
|
||||||
* </ul>
|
|
||||||
*
|
|
||||||
* <h3>注意事项:</h3>
|
|
||||||
* <ul>
|
|
||||||
* <li>不写单位默认为毫秒</li>
|
|
||||||
* <li>永久缓存(#-1)不会自动过期,请配合 @CacheEvict 手动清理。</li>
|
|
||||||
* <li>避免对频繁更新的数据使用永久缓存,防止数据陈旧。</li>
|
|
||||||
* <li>cacheName 中的 '#' 只解析第一个,后续字符将作为 TTL 处理。</li>
|
|
||||||
* </ul>
|
|
||||||
*/
|
|
||||||
@Slf4j
|
|
||||||
public class CustomRedisCacheManager extends RedisCacheManager {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 缓存全局前缀
|
|
||||||
*/
|
|
||||||
private static final String CACHE_PREFIX = "cache";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 自定义 TTL 分隔符,用于在 cacheName 后附加过期时间
|
|
||||||
*/
|
|
||||||
private static final String CUSTOM_TTL_SEPARATOR = "#";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 默认缓存过期时间:7 天
|
|
||||||
*/
|
|
||||||
private static final Duration DEFAULT_TTL = Duration.ofDays(7);
|
|
||||||
|
|
||||||
public CustomRedisCacheManager(RedisCacheWriter cacheWriter, RedisCacheConfiguration defaultCacheConfiguration) {
|
|
||||||
super(cacheWriter, defaultCacheConfiguration);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 创建 RedisCache 实例,支持从 cacheName 解析 TTL
|
|
||||||
*
|
|
||||||
* @param name 缓存名称(支持 name#ttl 格式)
|
|
||||||
* @param cacheConfig 默认缓存配置
|
|
||||||
* @return RedisCache
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
protected RedisCache createRedisCache(String name, RedisCacheConfiguration cacheConfig) {
|
|
||||||
Duration ttl = parseTtlFromCacheName(name);
|
|
||||||
if (ttl == null) {
|
|
||||||
ttl = DEFAULT_TTL;
|
|
||||||
}
|
|
||||||
|
|
||||||
CacheKeyPrefix keyPrefix = cacheName -> {
|
|
||||||
if (StrUtil.isBlank(cacheName)) {
|
|
||||||
return CACHE_PREFIX + COLON;
|
|
||||||
}
|
|
||||||
String[] parts = cacheName.split(CUSTOM_TTL_SEPARATOR, 2);
|
|
||||||
String cleanName = StrUtil.trim(parts[0]);
|
|
||||||
return CACHE_PREFIX + COLON + cleanName + COLON;
|
|
||||||
};
|
|
||||||
|
|
||||||
// 构建最终缓存配置:设置 key 前缀 + TTL
|
|
||||||
RedisCacheConfiguration config = cacheConfig.computePrefixWith(keyPrefix).entryTtl(ttl);
|
|
||||||
|
|
||||||
return super.createRedisCache(name, config);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 从 cacheName 中解析 TTL
|
|
||||||
*
|
|
||||||
* @param name 缓存名称,格式如:users#10m, products#2h, config#-1(永久)
|
|
||||||
* @return 解析出的 Duration若无效则返回 null;若为 -1,则返回 Duration.ofMillis(-1) 表示永久缓存
|
|
||||||
*/
|
|
||||||
private Duration parseTtlFromCacheName(String name) {
|
|
||||||
if (StrUtil.isBlank(name)) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
String[] parts = name.split(CUSTOM_TTL_SEPARATOR, 2);
|
|
||||||
if (parts.length < 2) {
|
|
||||||
return null; // 无 TTL 部分
|
|
||||||
}
|
|
||||||
|
|
||||||
String ttlStr = StrUtil.trim(parts[1]);
|
|
||||||
if (StrUtil.isBlank(ttlStr)) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 特殊处理:-1 表示永久缓存
|
|
||||||
if ("-1".equals(ttlStr)) {
|
|
||||||
return Duration.ofMillis(-1); // Spring Redis 中负数 Duration 表示永不过期
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
|
||||||
Duration ttl = DurationStyle.detectAndParse(ttlStr);
|
|
||||||
return ttl.toSeconds() > 0 ? ttl : null;
|
|
||||||
} catch (IllegalArgumentException e) {
|
|
||||||
log.debug("解析缓存 TTL 失败,cacheName='{}', ttl='{}', 错误: {}", name, ttlStr, e.getMessage());
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -20,17 +20,25 @@ public class LongJsonSerializer extends JsonSerializer<Long> {
|
|||||||
|
|
||||||
public static final LongJsonSerializer INSTANCE = new LongJsonSerializer();
|
public static final LongJsonSerializer INSTANCE = new LongJsonSerializer();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* JS 安全整数范围
|
||||||
|
* 根据 JS Number.MIN_SAFE_INTEGER 与 Number.MAX_SAFE_INTEGER 得来
|
||||||
|
*/
|
||||||
|
private static final long JS_MIN_SAFE_INTEGER = -9007199254740991L;
|
||||||
|
private static final long JS_MAX_SAFE_INTEGER = 9007199254740991L;
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void serialize(Long value, JsonGenerator gen, SerializerProvider serializerProvider) throws IOException, JsonProcessingException {
|
public void serialize(Long value, JsonGenerator gen, SerializerProvider serializerProvider) throws IOException, JsonProcessingException {
|
||||||
if (null == value) {
|
if (null == value) {
|
||||||
gen.writeNull();
|
gen.writeNull();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// js中最大安全整数16位 Number.MAX_SAFE_INTEGER
|
// 如果超出了 JavaScript 安全整数范围,则序列化为字符串
|
||||||
String longStr = String.valueOf(value);
|
if (value < JS_MIN_SAFE_INTEGER || value > JS_MAX_SAFE_INTEGER) {
|
||||||
if (longStr.length() > 16) {
|
gen.writeString(Long.toString(value));
|
||||||
gen.writeString(longStr);
|
|
||||||
} else {
|
} else {
|
||||||
|
// 否则,序列化为数字
|
||||||
gen.writeNumber(value);
|
gen.writeNumber(value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package net.lab1024.sa.base.config;
|
|||||||
|
|
||||||
import cn.hutool.core.date.DatePattern;
|
import cn.hutool.core.date.DatePattern;
|
||||||
import cn.hutool.core.date.LocalDateTimeUtil;
|
import cn.hutool.core.date.LocalDateTimeUtil;
|
||||||
|
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||||
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateDeserializer;
|
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateDeserializer;
|
||||||
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
|
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
|
||||||
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateSerializer;
|
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateSerializer;
|
||||||
@@ -13,6 +14,8 @@ import org.springframework.context.annotation.Bean;
|
|||||||
import org.springframework.context.annotation.Configuration;
|
import org.springframework.context.annotation.Configuration;
|
||||||
import org.springframework.core.convert.converter.Converter;
|
import org.springframework.core.convert.converter.Converter;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.math.BigInteger;
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.time.format.DateTimeParseException;
|
import java.time.format.DateTimeParseException;
|
||||||
@@ -37,6 +40,9 @@ public class JsonConfig {
|
|||||||
builder.serializers(new LocalDateSerializer(DatePattern.NORM_DATE_FORMAT.getDateTimeFormatter()));
|
builder.serializers(new LocalDateSerializer(DatePattern.NORM_DATE_FORMAT.getDateTimeFormatter()));
|
||||||
builder.serializers(new LocalDateTimeSerializer(DatePattern.NORM_DATETIME_FORMAT.getDateTimeFormatter()));
|
builder.serializers(new LocalDateTimeSerializer(DatePattern.NORM_DATETIME_FORMAT.getDateTimeFormatter()));
|
||||||
builder.serializerByType(Long.class, LongJsonSerializer.INSTANCE);
|
builder.serializerByType(Long.class, LongJsonSerializer.INSTANCE);
|
||||||
|
builder.serializerByType(Long.TYPE, LongJsonSerializer.INSTANCE);
|
||||||
|
builder.serializerByType(BigInteger.class, ToStringSerializer.instance);
|
||||||
|
builder.serializerByType(BigDecimal.class, ToStringSerializer.instance);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -24,7 +24,7 @@
|
|||||||
"axios": "1.6.8",
|
"axios": "1.6.8",
|
||||||
"clipboard": "2.0.11",
|
"clipboard": "2.0.11",
|
||||||
"crypto-js": "4.1.1",
|
"crypto-js": "4.1.1",
|
||||||
"dayjs": "1.10.5",
|
"dayjs": "1.11.13",
|
||||||
"decimal.js": "10.3.1",
|
"decimal.js": "10.3.1",
|
||||||
"diff": "5.2.0",
|
"diff": "5.2.0",
|
||||||
"diff2html": "3.4.47",
|
"diff2html": "3.4.47",
|
||||||
|
|||||||
@@ -8,6 +8,7 @@
|
|||||||
* @Copyright 1024创新实验室 ( https://1024lab.net ),Since 2012
|
* @Copyright 1024创新实验室 ( https://1024lab.net ),Since 2012
|
||||||
*/
|
*/
|
||||||
import { defineStore } from 'pinia';
|
import { defineStore } from 'pinia';
|
||||||
|
import { smartSentry } from '/@/lib/smart-sentry.js';
|
||||||
|
|
||||||
export const useSpinStore = defineStore({
|
export const useSpinStore = defineStore({
|
||||||
id: 'spin',
|
id: 'spin',
|
||||||
@@ -18,13 +19,27 @@ export const useSpinStore = defineStore({
|
|||||||
actions: {
|
actions: {
|
||||||
hide() {
|
hide() {
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
let spins = document.querySelector('.ant-spin-nested-loading');
|
// 安全的DOM操作,避免null引用错误
|
||||||
spins.style.zIndex = 999;
|
try {
|
||||||
|
const spins = document.querySelector('.ant-spin-nested-loading');
|
||||||
|
if (spins) {
|
||||||
|
spins.style.zIndex = '999';
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
smartSentry.captureError('Spin hide操作失败:', error);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
show() {
|
show() {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
let spins = document.querySelector('.ant-spin-nested-loading');
|
// 安全的DOM操作,避免null引用错误
|
||||||
spins.style.zIndex = 1001;
|
try {
|
||||||
|
const spins = document.querySelector('.ant-spin-nested-loading');
|
||||||
|
if (spins) {
|
||||||
|
spins.style.zIndex = '1001';
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
smartSentry.captureError('Spin hide操作失败:', error);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ JavaTypeMap.set('blob', 'String');
|
|||||||
JavaTypeMap.set('date', 'LocalDate');
|
JavaTypeMap.set('date', 'LocalDate');
|
||||||
JavaTypeMap.set('datetime', 'LocalDateTime');
|
JavaTypeMap.set('datetime', 'LocalDateTime');
|
||||||
JavaTypeMap.set('timestamp', 'LocalDateTime');
|
JavaTypeMap.set('timestamp', 'LocalDateTime');
|
||||||
|
JavaTypeMap.set('timestamp without time zone', 'LocalDateTime');
|
||||||
|
|
||||||
export const JavaTypeList = [
|
export const JavaTypeList = [
|
||||||
'Boolean', //
|
'Boolean', //
|
||||||
@@ -67,6 +68,7 @@ JsTypeMap.set('blob', 'String');
|
|||||||
JsTypeMap.set('date', 'Date');
|
JsTypeMap.set('date', 'Date');
|
||||||
JsTypeMap.set('datetime', 'Date');
|
JsTypeMap.set('datetime', 'Date');
|
||||||
JsTypeMap.set('timestamp', 'Date');
|
JsTypeMap.set('timestamp', 'Date');
|
||||||
|
JsTypeMap.set('timestamp without time zone', 'Date');
|
||||||
|
|
||||||
export const JsTypeList = [
|
export const JsTypeList = [
|
||||||
'Boolean', //
|
'Boolean', //
|
||||||
@@ -106,6 +108,7 @@ FrontComponentMap.set('longtext', 'Textarea');
|
|||||||
FrontComponentMap.set('blob', 'FileUpload');
|
FrontComponentMap.set('blob', 'FileUpload');
|
||||||
FrontComponentMap.set('date', 'Date');
|
FrontComponentMap.set('date', 'Date');
|
||||||
FrontComponentMap.set('datetime', 'DateTime');
|
FrontComponentMap.set('datetime', 'DateTime');
|
||||||
|
FrontComponentMap.set('timestamp without time zone', 'DateTime');
|
||||||
|
|
||||||
export function getFrontComponent(dataType) {
|
export function getFrontComponent(dataType) {
|
||||||
return FrontComponentMap.get(dataType);
|
return FrontComponentMap.get(dataType);
|
||||||
|
|||||||
@@ -234,12 +234,21 @@
|
|||||||
</script>
|
</script>
|
||||||
<style lang="less" scoped>
|
<style lang="less" scoped>
|
||||||
.center-container {
|
.center-container {
|
||||||
|
height: 100%;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
|
||||||
.header-title {
|
.header-title {
|
||||||
font-size: 20px;
|
font-size: 20px;
|
||||||
|
flex-shrink: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.center-form-area {
|
.center-form-area {
|
||||||
margin-top: 20px;
|
margin-top: 20px;
|
||||||
|
flex: 1;
|
||||||
|
overflow-y: auto;
|
||||||
|
min-height: 0;
|
||||||
|
|
||||||
|
|
||||||
.avatar-container {
|
.avatar-container {
|
||||||
position: relative;
|
position: relative;
|
||||||
|
|||||||
@@ -54,11 +54,11 @@
|
|||||||
</a-col>
|
</a-col>
|
||||||
<!--更新日志-->
|
<!--更新日志-->
|
||||||
<a-col :span="24">
|
<a-col :span="24">
|
||||||
<ToBeDoneCard />
|
<ChangelogCard />
|
||||||
</a-col>
|
</a-col>
|
||||||
<!--待办、已办-->
|
<!--待办、已办-->
|
||||||
<a-col :span="24">
|
<a-col :span="24">
|
||||||
<ChangelogCard />
|
<ToBeDoneCard />
|
||||||
</a-col>
|
</a-col>
|
||||||
</a-row>
|
</a-row>
|
||||||
</a-col>
|
</a-col>
|
||||||
|
|||||||
@@ -24,7 +24,7 @@
|
|||||||
"axios": "1.6.8",
|
"axios": "1.6.8",
|
||||||
"clipboard": "2.0.11",
|
"clipboard": "2.0.11",
|
||||||
"crypto-js": "4.1.1",
|
"crypto-js": "4.1.1",
|
||||||
"dayjs": "1.10.5",
|
"dayjs": "1.11.13",
|
||||||
"decimal.js": "10.3.1",
|
"decimal.js": "10.3.1",
|
||||||
"default-passive-events": "^2.0.0",
|
"default-passive-events": "^2.0.0",
|
||||||
"diff": "5.2.0",
|
"diff": "5.2.0",
|
||||||
|
|||||||
@@ -8,6 +8,7 @@
|
|||||||
* @Copyright 1024创新实验室 ( https://1024lab.net ),Since 2012
|
* @Copyright 1024创新实验室 ( https://1024lab.net ),Since 2012
|
||||||
*/
|
*/
|
||||||
import { defineStore } from 'pinia';
|
import { defineStore } from 'pinia';
|
||||||
|
import { smartSentry } from '/@/lib/smart-sentry.js';
|
||||||
|
|
||||||
export const useSpinStore = defineStore({
|
export const useSpinStore = defineStore({
|
||||||
id: 'spin',
|
id: 'spin',
|
||||||
@@ -18,13 +19,27 @@ export const useSpinStore = defineStore({
|
|||||||
actions: {
|
actions: {
|
||||||
hide() {
|
hide() {
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
let spins = document.querySelector('.ant-spin-nested-loading');
|
// 安全的DOM操作,避免null引用错误
|
||||||
spins.style.zIndex = 999;
|
try {
|
||||||
|
const spins = document.querySelector('.ant-spin-nested-loading');
|
||||||
|
if (spins) {
|
||||||
|
spins.style.zIndex = '999';
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
smartSentry.captureError('Spin hide操作失败:', error);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
show() {
|
show() {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
let spins = document.querySelector('.ant-spin-nested-loading');
|
// 安全的DOM操作,避免null引用错误
|
||||||
spins.style.zIndex = 1001;
|
try {
|
||||||
|
const spins = document.querySelector('.ant-spin-nested-loading');
|
||||||
|
if (spins) {
|
||||||
|
spins.style.zIndex = '1001';
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
smartSentry.captureError('Spin hide操作失败:', error);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ JavaTypeMap.set('blob', 'String');
|
|||||||
JavaTypeMap.set('date', 'LocalDate');
|
JavaTypeMap.set('date', 'LocalDate');
|
||||||
JavaTypeMap.set('datetime', 'LocalDateTime');
|
JavaTypeMap.set('datetime', 'LocalDateTime');
|
||||||
JavaTypeMap.set('timestamp', 'LocalDateTime');
|
JavaTypeMap.set('timestamp', 'LocalDateTime');
|
||||||
|
JavaTypeMap.set('timestamp without time zone', 'LocalDateTime');
|
||||||
|
|
||||||
export const JavaTypeList = [
|
export const JavaTypeList = [
|
||||||
'Boolean', //
|
'Boolean', //
|
||||||
@@ -67,6 +68,7 @@ JsTypeMap.set('blob', 'String');
|
|||||||
JsTypeMap.set('date', 'Date');
|
JsTypeMap.set('date', 'Date');
|
||||||
JsTypeMap.set('datetime', 'Date');
|
JsTypeMap.set('datetime', 'Date');
|
||||||
JsTypeMap.set('timestamp', 'Date');
|
JsTypeMap.set('timestamp', 'Date');
|
||||||
|
JsTypeMap.set('timestamp without time zone', 'Date');
|
||||||
|
|
||||||
export const JsTypeList = [
|
export const JsTypeList = [
|
||||||
'Boolean', //
|
'Boolean', //
|
||||||
@@ -106,6 +108,7 @@ FrontComponentMap.set('longtext', 'Textarea');
|
|||||||
FrontComponentMap.set('blob', 'FileUpload');
|
FrontComponentMap.set('blob', 'FileUpload');
|
||||||
FrontComponentMap.set('date', 'Date');
|
FrontComponentMap.set('date', 'Date');
|
||||||
FrontComponentMap.set('datetime', 'DateTime');
|
FrontComponentMap.set('datetime', 'DateTime');
|
||||||
|
FrontComponentMap.set('timestamp without time zone', 'DateTime');
|
||||||
|
|
||||||
export function getFrontComponent(dataType) {
|
export function getFrontComponent(dataType) {
|
||||||
return FrontComponentMap.get(dataType);
|
return FrontComponentMap.get(dataType);
|
||||||
|
|||||||
@@ -234,12 +234,21 @@
|
|||||||
</script>
|
</script>
|
||||||
<style lang="less" scoped>
|
<style lang="less" scoped>
|
||||||
.center-container {
|
.center-container {
|
||||||
|
height: 100%;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
|
||||||
.header-title {
|
.header-title {
|
||||||
font-size: 20px;
|
font-size: 20px;
|
||||||
|
flex-shrink: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.center-form-area {
|
.center-form-area {
|
||||||
margin-top: 20px;
|
margin-top: 20px;
|
||||||
|
flex: 1;
|
||||||
|
overflow-y: auto;
|
||||||
|
min-height: 0;
|
||||||
|
|
||||||
|
|
||||||
.avatar-container {
|
.avatar-container {
|
||||||
position: relative;
|
position: relative;
|
||||||
|
|||||||
@@ -1,9 +1,15 @@
|
|||||||
### 数据库脚本
|
|
||||||
默认数据库为Mysql,若为其他数据库,请关注:[SmartAdmin其他数据库](https://smartadmin.vip/views/other/china-db/)
|
|
||||||
|
|
||||||
#### 第一次
|
|
||||||
如果是第一次部署,只需要执行 smart_admin_v3.sql 文件中的SQL语句即可;
|
|
||||||
|
|
||||||
|
|
||||||
#### 更新
|
序号| 数据库 | 类型 | 支持 | 下载
|
||||||
跟随 SmartAdmin更新,则需要执行 sql-update-log目录中的SQL脚本,需要按照文件版本从小到大执行;
|
-------- |-------------------------------------------------------------------|--------------------| ----- | ----
|
||||||
|
1| [Mysql](https://www.mysql.com) | 国外 | Java8+Java17 都支持 ✔️ | [下载代码和SQL](https://gitee.com/lab1024/smart-admin/tree/master/%E6%95%B0%E6%8D%AE%E5%BA%93SQL%E8%84%9A%E6%9C%AC/mysql)
|
||||||
|
2| [PostgreSQL](https://www.postgresql.org/) | 国外 | Java8+Java17都支持 ✔️ | [下载代码和SQL](https://smartadmin.vip/views/other/china-db/)
|
||||||
|
3| [达梦数据库 DM8](https://www.dameng.com/DM8.html) | 国产 | Java8+Java17 都支持 ✔️ | [下载代码和SQL](https://smartadmin.vip/views/other/china-db/)
|
||||||
|
4| [电科(人大)金仓 KingBaseES](https://www.kingbase.com.cn) | 国产 | Java8+Java17都支持 ✔️ | [下载代码和SQL](https://smartadmin.vip/views/other/china-db/)
|
||||||
|
5| [华为高斯 GaussDB](https://www.huaweicloud.com/product/gaussdb.html) | 国产 | Java8+Java17都支持 ✔️ | [下载代码和SQL](https://smartadmin.vip/views/other/china-db/)
|
||||||
|
6| [OpenGaussDB](https://opengauss.org/zh/) | 国产 | Java8+Java17都支持 ✔️ | [下载代码和SQL](https://smartadmin.vip/views/other/china-db/)
|
||||||
|
7| [神通数据库 ShenTong](http://www.shentongdata.com.cn/) | 国产 | Java8+Java17都支持 ✔️ | [下载代码和SQL](https://smartadmin.vip/views/other/china-db/)
|
||||||
|
8| [海量数据库 VastData](https://www.vastdata.com.cn) | 国产 | Java8+Java17都支持 ✔️ | [下载代码和SQL](https://smartadmin.vip/views/other/china-db/)
|
||||||
|
9| [海扬数据库 OceanBase](https://www.oceanbase.com/) | 国产 | Java8+Java17都支持 ✔️ | [下载代码和SQL](https://smartadmin.vip/views/other/china-db/)
|
||||||
|
10| [阿里云 PolarDB](https://www.polardbx.com/) | 国产 | Java8+Java17都支持 ✔️ | [下载代码和SQL](https://smartadmin.vip/views/other/china-db/)
|
||||||
|
|
||||||
|
|||||||
9
数据库SQL脚本/mysql/README.md
Normal file
9
数据库SQL脚本/mysql/README.md
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
### 数据库脚本
|
||||||
|
默认数据库为Mysql,若为其他数据库,请关注:[SmartAdmin其他数据库](https://smartadmin.vip/views/other/china-db/)
|
||||||
|
|
||||||
|
#### 第一次
|
||||||
|
如果是第一次部署,只需要执行 smart_admin_v3.sql 文件中的SQL语句即可;
|
||||||
|
|
||||||
|
|
||||||
|
#### 更新
|
||||||
|
跟随 SmartAdmin更新,则需要执行 sql-update-log目录中的SQL脚本,需要按照文件版本从小到大执行;
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
|
|
||||||
|
|
||||||
## 主流
|
|
||||||
|
|
||||||
序号| 数据库 | 状态 | 下载
|
|
||||||
-------- |-------------------------------------------|-------------------| -----
|
|
||||||
1| [Mysql](https://www.mysql.com) | Java8+Java17 都支持 ✔️ |
|
|
||||||
2| [PostgreSQL](https://www.postgresql.org/) | Java8+Java17都支持 ✔️ | [下载代码和SQL](https://smartadmin.vip/views/other/china-db/)
|
|
||||||
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
|
|
||||||
|
|
||||||
## 国产数据库支持
|
|
||||||
|
|
||||||
序号| 数据库 | 支持 | 下载
|
|
||||||
-------- |---------------------------------------------------| ----- | ----
|
|
||||||
1| [达梦数据库 DM8](https://www.dameng.com/DM8.html) | Java8+Java17 都支持 ✔️ | [下载代码和SQL](https://smartadmin.vip/views/other/china-db/)
|
|
||||||
2| [电科(人大)金仓KingBaseES](https://www.kingbase.com.cn) | Java8+Java17都支持 ✔️ | [下载代码和SQL](https://smartadmin.vip/views/other/china-db/)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
|
|
||||||
|
|
||||||
## 国产数据库支持
|
|
||||||
|
|
||||||
序号| 数据库 | 支持 | 下载
|
|
||||||
-------- |---------------------------------------------------| ----- | ----
|
|
||||||
1| [达梦数据库 DM8](https://www.dameng.com/DM8.html) | Java8+Java17 都支持 ✔️ | [下载代码和SQL](https://smartadmin.vip/views/other/china-db/)
|
|
||||||
2| [电科(人大)金仓KingBaseES](https://www.kingbase.com.cn) | Java8+Java17都支持 ✔️ | [下载代码和SQL](https://smartadmin.vip/views/other/china-db/)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
|
|
||||||
|
|
||||||
## 国产数据库支持
|
|
||||||
|
|
||||||
序号| 数据库 | 支持 | 下载
|
|
||||||
-------- |---------------------------------------------------| ----- | ----
|
|
||||||
1| [达梦数据库 DM8](https://www.dameng.com/DM8.html) | Java8+Java17 都支持 ✔️ | [下载代码和SQL](https://smartadmin.vip/views/other/china-db/)
|
|
||||||
2| [电科(人大)金仓KingBaseES](https://www.kingbase.com.cn) | Java8+Java17都支持 ✔️ | [下载代码和SQL](https://smartadmin.vip/views/other/china-db/)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
|
|
||||||
|
|
||||||
## 国产数据库支持
|
|
||||||
|
|
||||||
序号| 数据库 | 支持 | 下载
|
|
||||||
-------- |---------------------------------------------------| ----- | ----
|
|
||||||
1| [达梦数据库 DM8](https://www.dameng.com/DM8.html) | Java8+Java17 都支持 ✔️ | [下载代码和SQL](https://smartadmin.vip/views/other/china-db/)
|
|
||||||
2| [电科(人大)金仓KingBaseES](https://www.kingbase.com.cn) | Java8+Java17都支持 ✔️ | [下载代码和SQL](https://smartadmin.vip/views/other/china-db/)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
|
|
||||||
|
|
||||||
## 国产数据库支持
|
|
||||||
|
|
||||||
序号| 数据库 | 支持 | 下载
|
|
||||||
-------- |---------------------------------------------------| ----- | ----
|
|
||||||
1| [达梦数据库 DM8](https://www.dameng.com/DM8.html) | Java8+Java17 都支持 ✔️ | [下载代码和SQL](https://smartadmin.vip/views/other/china-db/)
|
|
||||||
2| [电科(人大)金仓KingBaseES](https://www.kingbase.com.cn) | Java8+Java17都支持 ✔️ | [下载代码和SQL](https://smartadmin.vip/views/other/china-db/)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
|
|
||||||
|
|
||||||
## 国产数据库支持
|
|
||||||
|
|
||||||
序号| 数据库 | 支持 | 下载
|
|
||||||
-------- |---------------------------------------------------| ----- | ----
|
|
||||||
1| [达梦数据库 DM8](https://www.dameng.com/DM8.html) | Java8+Java17 都支持 ✔️ | [下载代码和SQL](https://smartadmin.vip/views/other/china-db/)
|
|
||||||
2| [电科(人大)金仓KingBaseES](https://www.kingbase.com.cn) | Java8+Java17都支持 ✔️ | [下载代码和SQL](https://smartadmin.vip/views/other/china-db/)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
|
|
||||||
|
|
||||||
## 国产数据库支持
|
|
||||||
|
|
||||||
序号| 数据库 | 支持 | 下载
|
|
||||||
-------- |---------------------------------------------------| ----- | ----
|
|
||||||
1| [达梦数据库 DM8](https://www.dameng.com/DM8.html) | Java8+Java17 都支持 ✔️ | [下载代码和SQL](https://smartadmin.vip/views/other/china-db/)
|
|
||||||
2| [电科(人大)金仓KingBaseES](https://www.kingbase.com.cn) | Java8+Java17都支持 ✔️ | [下载代码和SQL](https://smartadmin.vip/views/other/china-db/)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Reference in New Issue
Block a user