Skip to content

Commit

Permalink
Merge branch 'master' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
zlt2000 authored Nov 10, 2022
2 parents 0e1801e + fa0d663 commit c8a9909
Show file tree
Hide file tree
Showing 5 changed files with 84 additions and 3 deletions.
1 change: 1 addition & 0 deletions zlt-demo/sso-demo/oidc-sso/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ alter table oauth_client_details add support_id_token tinyint(1) DEFAULT 1 COMME
alter table oauth_client_details add id_token_validity int(11) DEFAULT 60 COMMENT 'id_token有效期';

update oauth_client_details set additional_information = '{"LOGOUT_NOTIFY_URL_LIST":"http://127.0.0.1:8082/logoutNotify"}'
, web_server_redirect_uri = 'http://127.0.0.1:8082/callback.html'
where client_id = 'webApp';
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ public class ApiController {
@Value("${zlt.sso.redirect-uri:}")
private String redirectUri;

@Value("${zlt.sso.scope:}")
private String scope;

@Value("${zlt.sso.access-token-uri:}")
private String accessTokenUri;

Expand Down Expand Up @@ -146,7 +149,7 @@ public Map<String, Object> getAccessToken(String code) {
param.add("code", code);
param.add("grant_type", "authorization_code");
param.add("redirect_uri", redirectUri);
param.add("scope", "all");
param.add("scope", scope);
param.add("nonce", this.genNonce());
HttpEntity<MultiValueMap<String, String>> request = new HttpEntity<>(param, headers);
ResponseEntity<Map> response = restTemplate.postForEntity(accessTokenUri, request , Map.class);
Expand Down
3 changes: 2 additions & 1 deletion zlt-demo/sso-demo/oidc-sso/src/main/resources/bootstrap.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ zlt:
client-secret: webApp
redirect-uri: http://127.0.0.1:8082/callback.html
access-token-uri: http://127.0.0.1:9900/api-uaa/oauth/token
jwt-key-uri: http://127.0.0.1:9900/api-uaa/tokens/key
jwt-key-uri: http://127.0.0.1:9900/api-uaa/tokens/key
scope: app
2 changes: 1 addition & 1 deletion zlt-doc/sql/oauth-center.sql
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@ CREATE TABLE `oauth_client_details` (
-- ----------------------------
-- Records of oauth_client_details
-- ----------------------------
INSERT INTO `oauth_client_details` VALUES (1, 'webApp', NULL, '$2a$10$06msMGYRH8nrm4iVnKFNKOoddB8wOwymVhbUzw/d3ZixD7Nq8ot72', 'webApp', 'app', 'authorization_code,password,refresh_token,client_credentials,implicit,password_code,openId,mobile_password', NULL, NULL, 3600, NULL, '{"LOGOUT_NOTIFY_URL_LIST":"http://127.0.0.1:8082/logoutNotify"}', 'true', NULL, NULL, 'pc端', 1, 60);
INSERT INTO `oauth_client_details` VALUES (1, 'webApp', NULL, '$2a$10$06msMGYRH8nrm4iVnKFNKOoddB8wOwymVhbUzw/d3ZixD7Nq8ot72', 'webApp', 'app', 'authorization_code,password,refresh_token,client_credentials,implicit,password_code,openId,mobile_password', 'http://127.0.0.1:8082/callback.html', NULL, 3600, NULL, '{"LOGOUT_NOTIFY_URL_LIST":"http://127.0.0.1:8082/logoutNotify"}', 'true', NULL, NULL, 'pc端', 1, 60);
INSERT INTO `oauth_client_details` VALUES (2, 'app', NULL, '$2a$10$i3F515wEDiB4Gvj9ym9Prui0dasRttEUQ9ink4Wpgb4zEDCAlV8zO', 'app', 'app', 'authorization_code,password,refresh_token', 'http://127.0.0.1:8081/callback.html', NULL, 3600, NULL, '{"LOGOUT_NOTIFY_URL_LIST":"http://127.0.0.1:8081/logoutNotify"}', 'true', NULL, NULL, '移动端', 1, 60);
INSERT INTO `oauth_client_details` VALUES (3, 'zlt', NULL, '$2a$10$/o.wuORzVcXaezmYVzwYMuoY7qeWXBALwQmkskXD/7C6rqfCyPrna', 'zlt', 'all', 'authorization_code,password,refresh_token,client_credentials', 'http://127.0.0.1:8080/singleLogin', NULL, 3600, 28800, '{}', 'true', '2018-12-27 00:50:30', '2018-12-27 00:50:30', '第三方应用', 1, 60);
76 changes: 76 additions & 0 deletions zlt-web/react-web/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# Central-Platform UI

本模块是基于`企业级微服务框架`后端 API 所开发的前端项目。

采用[Ant Design Pro](https://pro.ant.design/)框架,基于[UmiJS v3.x](https://v3.umijs.org/)[ProComponents](https://procomponents.ant.design/);
图表采用[Ant Design Charts](https://charts.ant.design/)

## 1.目录说明
考虑到部署方便,集成了SpringBootWeb,目录结构基于Maven规范。
```lua
zlt-web -- 前端一级工程
│ ├─src -- 源码
│ │ ├─main --
│ │ │ ├─frontend -- 前端源码
│ │ │ ├─java -- 后端源码
```
## 2.后端使用说明
模块已集成Maven插件`frontend-maven-plugin`用于编译前端代码
>由于需要安装前端环境并编译前端代码,首次运行需要时间较长
### 打包运行
```bash
mvn package
```
在target目录下生成zlt-web-5.4.0.jar(springboot jar)。
```bash
java -jar zlt-web-5.4.0.jar
```

### IDE中运行

如在本地开发,在运行`SpringBootApplication`前必须先执行
```bash
mvn compile
```

### 配置
前缀:`zlt.ui`

| 配置项 | 类型 | 是否必须 | 默认值 | 说明 |
|--------------|--------|------|-----|-------|
| path-context | String || "/" | 上下文路径 |

## 3.前端使用说明
所有前端代码在`frontend`目录下。
### 环境准备

安装 `node_modules`:

```bash
npm install
```

or

```bash
yarn
```

### 运行项目

```bash
npm start
```

### 编译项目

```bash
npm run build
```
### More
开发参考
* [Ant Design Pro](https://pro.ant.design/) 开箱即用的中台前端/设计解决方案
* [UmiJS v3.x](https://v3.umijs.org/) 可扩展的企业级前端应用框架
* [Ant Design](https://ant.design/index-cn) 基于 Ant Design 设计体系的 React UI 组件库
* [ProComponents](https://procomponents.ant.design/) 基于 Ant Design 设计规范,提供更高程度的抽象,提供更上层的设计规范
* [Ant Design Charts](https://charts.ant.design/) 简单好用的 React 图表库

0 comments on commit c8a9909

Please sign in to comment.