diff --git a/pom.xml b/pom.xml index a52c79e5..426c4ef5 100644 --- a/pom.xml +++ b/pom.xml @@ -50,7 +50,7 @@ 6.2.0.Final 2.7.8 5.1.0 - 2.12.4 + 2.13.4.1 1.10 2.2.9.RELEASE 1.12.40 diff --git a/zlt-demo/sso-demo/oidc-sso/README.md b/zlt-demo/sso-demo/oidc-sso/README.md index 672698d8..11116508 100644 --- a/zlt-demo/sso-demo/oidc-sso/README.md +++ b/zlt-demo/sso-demo/oidc-sso/README.md @@ -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'; ``` diff --git a/zlt-demo/sso-demo/oidc-sso/src/main/java/com/sso/demo/controller/ApiController.java b/zlt-demo/sso-demo/oidc-sso/src/main/java/com/sso/demo/controller/ApiController.java index 74103b05..72e3ff03 100644 --- a/zlt-demo/sso-demo/oidc-sso/src/main/java/com/sso/demo/controller/ApiController.java +++ b/zlt-demo/sso-demo/oidc-sso/src/main/java/com/sso/demo/controller/ApiController.java @@ -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; @@ -146,7 +149,7 @@ public Map 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> request = new HttpEntity<>(param, headers); ResponseEntity response = restTemplate.postForEntity(accessTokenUri, request , Map.class); diff --git a/zlt-demo/sso-demo/oidc-sso/src/main/resources/bootstrap.yml b/zlt-demo/sso-demo/oidc-sso/src/main/resources/bootstrap.yml index fc4c658e..bb422ead 100644 --- a/zlt-demo/sso-demo/oidc-sso/src/main/resources/bootstrap.yml +++ b/zlt-demo/sso-demo/oidc-sso/src/main/resources/bootstrap.yml @@ -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 \ No newline at end of file + jwt-key-uri: http://127.0.0.1:9900/api-uaa/tokens/key + scope: app \ No newline at end of file diff --git a/zlt-doc/sql/oauth-center.sql b/zlt-doc/sql/oauth-center.sql index 6405352c..bdf168fc 100644 --- a/zlt-doc/sql/oauth-center.sql +++ b/zlt-doc/sql/oauth-center.sql @@ -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); \ No newline at end of file diff --git a/zlt-job/pom.xml b/zlt-job/pom.xml index 06202f4c..bc06e9b8 100644 --- a/zlt-job/pom.xml +++ b/zlt-job/pom.xml @@ -35,7 +35,7 @@ 3.8.1 2.5.5 2.3.0 - 2.9.8 + 2.13.4.1 diff --git a/zlt-web/react-web/README.md b/zlt-web/react-web/README.md new file mode 100644 index 00000000..967e3f6d --- /dev/null +++ b/zlt-web/react-web/README.md @@ -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 图表库