...
 
Commits (7)
    https://gitcode.net/qq_16063307/pig/-/commit/f472e701ac774f3ff20aaf24dddefcca90c726e0 :memo: Writing docs. 增加文档说明 2023-06-17T17:15:06+08:00 lbw wangiegie@163.com https://gitcode.net/qq_16063307/pig/-/commit/0f4ca191b290ae9b44c0a1116396a1be9722e40d :art: Improving structure / format of the code. 格式化代码 2023-06-17T18:49:10+08:00 lbw wangiegie@163.com https://gitcode.net/qq_16063307/pig/-/commit/46b0e0aeb22c8af21bc9b7a81c07e4cb12bd1a6a :memo: Writing docs. 增加issue文档 2023-06-17T18:53:19+08:00 lbw wangiegie@163.com https://gitcode.net/qq_16063307/pig/-/commit/8017f0400c704a3cd12a36f5145b52a229dca1ab 修复【字段管理】页面的【字典类型】过滤条件不生效 2023-06-18T16:21:03+08:00 charlessui charles.sui@grapecity.com https://gitcode.net/qq_16063307/pig/-/commit/bb9f9ca038e8f2e4c9d152fee549f4208d69d38a !376 修复【字段管理】页面的【字典类型】过滤条件不生效 2023-06-18T08:29:17+00:00 lengleng wangiegie@gmail.com Merge pull request !376 from xiaochuanchuan/dev https://gitcode.net/qq_16063307/pig/-/commit/12f71f7b76deba5ccd170165219c87f993b24a61 :arrow_up: Upgrading dependencies. nacos-server 2.2.3 close #I7EGAE 2023-06-19T12:21:24+08:00 lbw wangiegie@163.com https://gitcode.net/qq_16063307/pig/-/commit/6077d6e4171cea2a9c51e5f5b33424630aced8ae :art: Improving structure / format of the code. 格式化代码 2023-06-21T09:56:23+08:00 lbw wangiegie@163.com
blank_issues_enabled: false # 不允许用户创建空白 Issue
contact_links:
- name: 遇到问题先去看文档!谢谢! # 外部网站名称
url: https://wiki.pig4cloud.com/ # 跳转的外部网站目标地址
about: 文档可以解决你80%的疑惑 # 跳转外部网站的描述说明
name: 问题咨询
description: "![扫码加入微信群](https://minio.pigx.top/oss/1648184189.png)"
body:
- type: dropdown
id: version
attributes:
label: PIG版本
options:
- "3.6"
- "3.5"
- "3.4"
- "3.3"
- "3.2"
- "3.1"
- "3.0"
validations:
required: true
- type: checkboxes
attributes:
label: 是否修改了包名
options:
- label:
required: false
- type: textarea
id: desired-solution
attributes:
label: 问题描述
description: 详细问题,提供相应截图和日志
validations:
required: true
......@@ -15,19 +15,19 @@
## 文档视频
[ 🚀🚀🚀 低代码数据可视化](http://datav.avuejs.com)
[ 🚀🚀🚀 低代码数据可视化](http://datav.pig4cloud.com)
[ 配套文档 wiki.pigx.vip](https://wiki.pigx.vip)
[ 配套文档 wiki.pig4cloud.com](https://wiki.pig4cloud.com)
[ 配套视频 tv.pigx.vip](https://www.bilibili.com/video/BV12t411B7e9)
[ 配套视频 tv.pig4cloud.com](https://www.bilibili.com/video/BV12t411B7e9)
[PIGX 在线体验 pigx.pigx.vip](http://pigx.pigx.vip)
[PIGX 在线体验 pigx.pig4cloud.com](http://pigx.pig4cloud.com)
[产品白皮书 paper.pigx.vip](https://paper.pigx.vip)
[产品白皮书 paper.pig4cloud.com](https://paper.pig4cloud.com)
## 微信群 [禁广告]
![](https://minio.pigx.vip/oss/1648184189.png)
![](https://minio.pigx.top/oss/1648184189.png)
## 快速开始
......@@ -80,15 +80,10 @@ pig
### 本地开发 运行
pig 提供了详细的[部署文档 wiki.pigx.vip](https://www.yuque.com/pig4cloud/pig/vsdox9),包括开发环境安装、服务端代码运行、前端代码运行等。
pig 提供了详细的[部署文档 wiki.pig4cloud.com](https://www.yuque.com/pig4cloud/pig/vsdox9),包括开发环境安装、服务端代码运行、前端代码运行等。
请务必**完全按照**文档部署运行章节 进行操作,减少踩坑弯路!!
### 定制自己微服务
[PIG DIY](https://pig4cloud.com/#/common/diy)
[PIG ARCHETYPE](https://pig4cloud.com/#/common/archetype)
### Docker 运行
......@@ -111,12 +106,12 @@ cnpm install && cnpm run build:docker && cd docker && docker-compose up -d
<table>
<tr>
<td><a href="https://www.bilibili.com/video/av45084065" target="_blank"><img src="https://minio.pigx.vip/oss/1655474345.jpg"></a></td>
<td><a href="https://www.bilibili.com/video/av77344954" target="_blank"><img src="https://minio.pigx.vip/oss/1656837143.jpg"></a></td>
<td><a href="https://www.bilibili.com/video/av45084065" target="_blank"><img src="https://minio.pigx.top/oss/1655474345.jpg"></a></td>
<td><a href="https://www.bilibili.com/video/av77344954" target="_blank"><img src="https://minio.pigx.top/oss/1656837143.jpg"></a></td>
</tr>
<tr>
<td><a href="https://www.bilibili.com/video/BV1J5411476V" target="_blank"><img src="https://minio.pigx.vip/oss/1655474369.jpg"></a></td>
<td><a href="https://www.bilibili.com/video/BV14p4y197K5" target="_blank"><img src="https://minio.pigx.vip/oss/1655474381.jpg"></a></td>
<td><a href="https://www.bilibili.com/video/BV1J5411476V" target="_blank"><img src="https://minio.pigx.top/oss/1655474369.jpg"></a></td>
<td><a href="https://www.bilibili.com/video/BV14p4y197K5" target="_blank"><img src="https://minio.pigx.top/oss/1655474381.jpg"></a></td>
</tr>
</table>
......@@ -127,7 +122,7 @@ cnpm install && cnpm run build:docker && cd docker && docker-compose up -d
pig 开源软件遵循 [Apache 2.0 协议](https://www.apache.org/licenses/LICENSE-2.0.html)
允许商业使用,但务必保留类作者、Copyright 信息。
![](https://minio.pigx.vip/oss/1655474288.jpg)
![](https://minio.pigx.top/oss/1655474288.jpg)
### 其他说明
......
......@@ -51,7 +51,7 @@ import java.util.Arrays;
/**
* @author lengleng
* @date 2022/5/27
*
* <p>
* 认证服务器配置
*/
@Configuration
......@@ -115,22 +115,17 @@ public class AuthorizationServerConfiguration {
* @return DelegatingAuthenticationConverter
*/
private AuthenticationConverter accessTokenRequestConverter() {
return new DelegatingAuthenticationConverter(Arrays.asList(
new OAuth2ResourceOwnerPasswordAuthenticationConverter(),
new OAuth2ResourceOwnerSmsAuthenticationConverter(),
// OAuth2TokenEndpointFilter中构造的DelegatingAuthenticationConverter中已经创建了这三个,会重复调用
// new OAuth2RefreshTokenAuthenticationConverter(),
// new OAuth2ClientCredentialsAuthenticationConverter(),
// new OAuth2AuthorizationCodeAuthenticationConverter(),
new OAuth2AuthorizationCodeRequestAuthenticationConverter()));
return new DelegatingAuthenticationConverter(
Arrays.asList(new OAuth2ResourceOwnerPasswordAuthenticationConverter(),
new OAuth2ResourceOwnerSmsAuthenticationConverter(),
new OAuth2AuthorizationCodeRequestAuthenticationConverter()));
}
/**
* 注入授权模式实现提供方
*
* <p>
* 1. 密码模式 </br>
* 2. 短信登录 </br>
*
*/
@SuppressWarnings("unchecked")
private void addCustomOAuth2GrantAuthenticationProvider(HttpSecurity http) {
......
......@@ -16,7 +16,6 @@
package com.pig4cloud.pig.common.security.component;
import cn.hutool.core.util.StrUtil;
import com.pig4cloud.pig.common.core.constant.SecurityConstants;
import com.pig4cloud.pig.common.security.annotation.Inner;
import lombok.RequiredArgsConstructor;
......@@ -26,7 +25,6 @@ import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.springframework.core.Ordered;
import org.springframework.core.annotation.AnnotationUtils;
import org.springframework.security.access.AccessDeniedException;
import javax.servlet.http.HttpServletRequest;
......@@ -47,12 +45,6 @@ public class PigSecurityInnerAspect implements Ordered {
@SneakyThrows
@Around("@within(inner) || @annotation(inner)")
public Object around(ProceedingJoinPoint point, Inner inner) {
// 实际注入的inner实体由表达式后一个注解决定,即是方法上的@Inner注解实体,若方法上无@Inner注解,则获取类上的
// 这段代码没有意义,拦截的就是@Inner注解,怎么会为null呢
// if (inner == null) {
// Class<?> clazz = point.getTarget().getClass();
// inner = AnnotationUtils.findAnnotation(clazz, Inner.class);
// }
String header = request.getHeader(SecurityConstants.FROM);
if (inner.value() && !SecurityConstants.FROM_IN.equals(header)) {
log.warn("访问接口 {} 没有权限", point.getSignature().getName());
......
......@@ -27,7 +27,7 @@
<description>nacos 注册配置中心</description>
<properties>
<nacos.version>2.2.0.PIGOEM</nacos.version>
<nacos.version>2.2.3</nacos.version>
</properties>
<dependencies>
......
package com.alibaba.nacos.config.server.service;
import cn.hutool.core.util.StrUtil;
import com.alibaba.nacos.common.utils.Pair;
import com.alibaba.nacos.config.server.model.ConfigHistoryInfo;
import com.alibaba.nacos.config.server.model.ConfigInfoWrapper;
import com.alibaba.nacos.config.server.model.Page;
import com.alibaba.nacos.config.server.service.repository.ConfigInfoPersistService;
import com.alibaba.nacos.config.server.service.repository.HistoryConfigInfoPersistService;
import com.alibaba.nacos.plugin.auth.exception.AccessException;
import com.alibaba.nacos.plugin.encryption.handler.EncryptionHandler;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Objects;
/**
* @author aeizzz
*/
@Service
public class HistoryService {
private final HistoryConfigInfoPersistService historyConfigInfoPersistService;
private final ConfigInfoPersistService configInfoPersistService;
public HistoryService(HistoryConfigInfoPersistService historyConfigInfoPersistService,
ConfigInfoPersistService configInfoPersistService) {
this.historyConfigInfoPersistService = historyConfigInfoPersistService;
this.configInfoPersistService = configInfoPersistService;
}
public Page<ConfigHistoryInfo> listConfigHistory(String dataId, String group, String namespaceId, Integer pageNo,
Integer pageSize) {
return this.historyConfigInfoPersistService.findConfigHistory(dataId, group, namespaceId, pageNo, pageSize);
}
public ConfigHistoryInfo getConfigHistoryInfo(String dataId, String group, String namespaceId, Long nid)
throws AccessException {
ConfigHistoryInfo configHistoryInfo = this.historyConfigInfoPersistService.detailConfigHistory(nid);
if (Objects.isNull(configHistoryInfo)) {
return null;
}
else {
this.checkHistoryInfoPermission(configHistoryInfo, dataId, group, namespaceId);
String encryptedDataKey = configHistoryInfo.getEncryptedDataKey();
Pair<String, String> pair = EncryptionHandler.decryptHandler(dataId, encryptedDataKey,
configHistoryInfo.getContent());
configHistoryInfo.setContent((String) pair.getSecond());
return configHistoryInfo;
}
}
public ConfigHistoryInfo getPreviousConfigHistoryInfo(String dataId, String group, String namespaceId, Long id)
throws AccessException {
ConfigHistoryInfo configHistoryInfo = this.historyConfigInfoPersistService.detailPreviousConfigHistory(id);
if (Objects.isNull(configHistoryInfo)) {
return null;
}
else {
this.checkHistoryInfoPermission(configHistoryInfo, dataId, group, namespaceId);
return configHistoryInfo;
}
}
public List<ConfigInfoWrapper> getConfigListByNamespace(String namespaceId) {
return this.configInfoPersistService.queryConfigInfoByNamespace(namespaceId);
}
/**
* 覆盖原有的校验方式,oracle 数据库没有空 字符串 只有 null
* @param configHistoryInfo
* @param dataId
* @param group
* @param namespaceId
* @throws AccessException
*/
private void checkHistoryInfoPermission(ConfigHistoryInfo configHistoryInfo, String dataId, String group,
String namespaceId) throws AccessException {
if (!Objects.equals(configHistoryInfo.getDataId(), dataId)
|| !Objects.equals(configHistoryInfo.getGroup(), group)
|| (!StrUtil.isEmpty(configHistoryInfo.getTenant())
&& !Objects.equals(configHistoryInfo.getTenant(), namespaceId))) {
throw new AccessException("Please check dataId, group or namespaceId.");
}
}
}
/**
* 处理再oracle数据库下空置的判断
*/
package com.alibaba.nacos.config.server.service;
......@@ -16,13 +16,18 @@
package com.alibaba.nacos.console.controller;
import com.alibaba.nacos.common.utils.VersionUtils;
import com.alibaba.nacos.common.model.RestResult;
import com.alibaba.nacos.common.model.RestResultUtils;
import com.alibaba.nacos.sys.env.EnvUtil;
import com.alibaba.nacos.sys.module.ModuleState;
import com.alibaba.nacos.sys.module.ModuleStateHolder;
import com.alibaba.nacos.sys.utils.DiskUtils;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.io.File;
import java.util.HashMap;
import java.util.Map;
......@@ -35,6 +40,8 @@ import java.util.Map;
@RequestMapping("/v1/console/server")
public class ServerStateController {
private static final String ANNOUNCEMENT_FILE = "announcement.conf";
/**
* Get server state of current server.
* @return state json.
......@@ -42,13 +49,20 @@ public class ServerStateController {
@GetMapping("/state")
public ResponseEntity<Map<String, String>> serverState() {
Map<String, String> serverState = new HashMap<>(4);
serverState.put("standalone_mode",
EnvUtil.getStandaloneMode() ? EnvUtil.STANDALONE_MODE_ALONE : EnvUtil.STANDALONE_MODE_CLUSTER);
serverState.put("function_mode", EnvUtil.getFunctionMode());
serverState.put("version", VersionUtils.version);
for (ModuleState each : ModuleStateHolder.getInstance().getAllModuleStates()) {
each.getStates().forEach((s, o) -> serverState.put(s, null == o ? null : o.toString()));
}
return ResponseEntity.ok().body(serverState);
}
@GetMapping("/announcement")
public RestResult<String> getAnnouncement() {
File announcementFile = new File(EnvUtil.getConfPath(), ANNOUNCEMENT_FILE);
String announcement = null;
if (announcementFile.exists() && announcementFile.isFile()) {
announcement = DiskUtils.readFile(announcementFile);
}
return RestResultUtils.success(announcement);
}
}
......@@ -51,7 +51,7 @@ import java.util.regex.Pattern;
*/
@NacosApi
@RestController
@RequestMapping(path = "/v2/console/namespace")
@RequestMapping("/v2/console/namespace")
public class NamespaceControllerV2 {
private final NamespaceOperationService namespaceOperationService;
......
......@@ -19,6 +19,7 @@ package com.alibaba.nacos.console.service;
import com.alibaba.nacos.api.exception.NacosException;
import com.alibaba.nacos.api.exception.api.NacosApiException;
import com.alibaba.nacos.api.model.v2.ErrorCode;
import com.alibaba.nacos.common.utils.NamespaceUtil;
import com.alibaba.nacos.common.utils.StringUtils;
import com.alibaba.nacos.config.server.model.TenantInfo;
import com.alibaba.nacos.config.server.service.repository.CommonPersistService;
......@@ -70,7 +71,7 @@ public class NamespaceOperationService {
// TODO 获取用kp
List<TenantInfo> tenantInfos = commonPersistService.findTenantByKp(DEFAULT_KP);
Namespace namespace0 = new Namespace("", DEFAULT_NAMESPACE, DEFAULT_QUOTA,
Namespace namespace0 = new Namespace(NamespaceUtil.getNamespaceDefaultId(), DEFAULT_NAMESPACE, DEFAULT_QUOTA,
configInfoPersistService.configInfoCount(DEFAULT_TENANT), NamespaceTypeEnum.GLOBAL.getType());
List<Namespace> namespaceList = new ArrayList<>();
namespaceList.add(namespace0);
......@@ -91,7 +92,7 @@ public class NamespaceOperationService {
*/
public NamespaceAllInfo getNamespace(String namespaceId) throws NacosException {
// TODO 获取用kp
if (StringUtils.isBlank(namespaceId)) {
if (StringUtils.isBlank(namespaceId) || namespaceId.equals(NamespaceUtil.getNamespaceDefaultId())) {
return new NamespaceAllInfo(namespaceId, DEFAULT_NAMESPACE_SHOW_NAME, DEFAULT_QUOTA,
configInfoPersistService.configInfoCount(DEFAULT_TENANT), NamespaceTypeEnum.GLOBAL.getType(),
DEFAULT_NAMESPACE_DESCRIPTION);
......
......@@ -35,7 +35,7 @@
<link rel="stylesheet" type="text/css" href="console-ui/public/css/icon.css">
<link rel="stylesheet" type="text/css" href="console-ui/public/css/font-awesome.css">
<!-- 第三方css结束 -->
<link href="./css/main.css?c18229e4d79449526734" rel="stylesheet"></head>
<link href="./css/main.css?711c34427bb0227d8941" rel="stylesheet"></head>
<body>
<div id="root" style="overflow:hidden"></div>
......@@ -56,6 +56,6 @@
<script src="console-ui/public/js/merge.js"></script>
<script src="console-ui/public/js/loader.js"></script>
<!-- 第三方js结束 -->
<script type="text/javascript" src="./js/main.js?c18229e4d79449526734"></script></body>
<script type="text/javascript" src="./js/main.js?711c34427bb0227d8941"></script></body>
</html>
......@@ -78,6 +78,7 @@ public class SysDictController {
return R.ok(sysDictService.page(page,
Wrappers.<SysDict>lambdaQuery()
.like(StrUtil.isNotBlank(sysDict.getDictKey()), SysDict::getDictKey, sysDict.getDictKey())
.eq(StrUtil.isNotBlank(sysDict.getSystemFlag()), SysDict::getSystemFlag, sysDict.getSystemFlag())
.orderByDesc(SysDict::getUpdateTime)));
}
......