From 0694a87211c872d8cecd3d1662a9e0b56644d43b Mon Sep 17 00:00:00 2001
From: doum <doum>
Date: 星期二, 27 一月 2026 18:26:58 +0800
Subject: [PATCH] uk单点登录
---
server/services/src/main/java/com/doumee/dao/business/dto/RoleRequestParam.java | 11 +
server/web/src/main/java/com/doumee/api/web/LoginController.java | 100 ++++++++++++++++
server/services/src/main/java/com/doumee/core/constants/Constants.java | 10 +
server/services/src/main/resources/application-pro.yml | 4
.idea/compiler.xml | 1
server/services/src/main/java/com/doumee/dao/business/dto/LoginRequestNewParam.java | 17 ++
admin/package-lock.json | 160 +++++++++++++-------------
server/web/src/main/resources/application.yml | 2
admin/.env.development | 2
server/web/src/main/java/com/doumee/DJWebApplication.java | 5
10 files changed, 223 insertions(+), 89 deletions(-)
diff --git a/.idea/compiler.xml b/.idea/compiler.xml
index baa301d..3a29174 100644
--- a/.idea/compiler.xml
+++ b/.idea/compiler.xml
@@ -2,6 +2,7 @@
<project version="4">
<component name="CompilerConfiguration">
<annotationProcessing>
+ <profile default="true" name="Default" enabled="true" />
<profile name="Maven default annotation processors profile" enabled="true">
<sourceOutputDir name="target/generated-sources/annotations" />
<sourceTestOutputDir name="target/generated-test-sources/test-annotations" />
diff --git a/admin/.env.development b/admin/.env.development
index 8df256e..76ab028 100644
--- a/admin/.env.development
+++ b/admin/.env.development
@@ -1,4 +1,4 @@
# 寮�鍙戠幆澧冮厤缃�
NODE_ENV = 'development'
#VUE_APP_API_URL = 'http://192.168.1.54:10010'
-VUE_APP_API_URL = 'https://jinkuai.832smartfarm.com/jinkuai_admin'
+VUE_APP_API_URL = 'http://localhost:10010'
diff --git a/admin/package-lock.json b/admin/package-lock.json
index 9256a01..58e4f64 100644
--- a/admin/package-lock.json
+++ b/admin/package-lock.json
@@ -1871,63 +1871,6 @@
"integrity": "sha1-/q7SVZc9LndVW4PbwIhRpsY1IPo=",
"dev": true
},
- "ansi-styles": {
- "version": "4.3.0",
- "resolved": "https://registry.npmmirror.com/ansi-styles/-/ansi-styles-4.3.0.tgz",
- "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
- "dev": true,
- "optional": true,
- "requires": {
- "color-convert": "^2.0.1"
- }
- },
- "chalk": {
- "version": "4.1.2",
- "resolved": "https://registry.npmmirror.com/chalk/-/chalk-4.1.2.tgz",
- "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",
- "dev": true,
- "optional": true,
- "requires": {
- "ansi-styles": "^4.1.0",
- "supports-color": "^7.1.0"
- }
- },
- "color-convert": {
- "version": "2.0.1",
- "resolved": "https://registry.npmmirror.com/color-convert/-/color-convert-2.0.1.tgz",
- "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
- "dev": true,
- "optional": true,
- "requires": {
- "color-name": "~1.1.4"
- }
- },
- "color-name": {
- "version": "1.1.4",
- "resolved": "https://registry.npmmirror.com/color-name/-/color-name-1.1.4.tgz",
- "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
- "dev": true,
- "optional": true
- },
- "has-flag": {
- "version": "4.0.0",
- "resolved": "https://registry.npmmirror.com/has-flag/-/has-flag-4.0.0.tgz",
- "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",
- "dev": true,
- "optional": true
- },
- "loader-utils": {
- "version": "2.0.4",
- "resolved": "https://registry.npmmirror.com/loader-utils/-/loader-utils-2.0.4.tgz",
- "integrity": "sha512-xXqpXoINfFhgua9xiqD8fPFHgkoq1mmmpE92WlDbm9rNRd/EbRb+Gqf908T2DMfuHjjJlksiK2RbHVOdD/MqSw==",
- "dev": true,
- "optional": true,
- "requires": {
- "big.js": "^5.2.2",
- "emojis-list": "^3.0.0",
- "json5": "^2.1.2"
- }
- },
"ssri": {
"version": "8.0.1",
"resolved": "https://registry.npm.taobao.org/ssri/download/ssri-8.0.1.tgz?cache=0&sync_timestamp=1617826515595&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fssri%2Fdownload%2Fssri-8.0.1.tgz",
@@ -1935,28 +1878,6 @@
"dev": true,
"requires": {
"minipass": "^3.1.1"
- }
- },
- "supports-color": {
- "version": "7.2.0",
- "resolved": "https://registry.npmmirror.com/supports-color/-/supports-color-7.2.0.tgz",
- "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",
- "dev": true,
- "optional": true,
- "requires": {
- "has-flag": "^4.0.0"
- }
- },
- "vue-loader-v16": {
- "version": "npm:vue-loader@16.8.3",
- "resolved": "https://registry.npmmirror.com/vue-loader/-/vue-loader-16.8.3.tgz",
- "integrity": "sha512-7vKN45IxsKxe5GcVCbc2qFU5aWzyiLrYJyUuMz4BQLKctCj/fmCa0w6fGiiQ2cLFetNcek1ppGJQDCup0c1hpA==",
- "dev": true,
- "optional": true,
- "requires": {
- "chalk": "^4.1.0",
- "hash-sum": "^2.0.0",
- "loader-utils": "^2.0.0"
}
}
}
@@ -13696,6 +13617,87 @@
}
}
},
+ "vue-loader-v16": {
+ "version": "npm:vue-loader@16.8.3",
+ "resolved": "https://registry.npmmirror.com/vue-loader/-/vue-loader-16.8.3.tgz",
+ "integrity": "sha512-7vKN45IxsKxe5GcVCbc2qFU5aWzyiLrYJyUuMz4BQLKctCj/fmCa0w6fGiiQ2cLFetNcek1ppGJQDCup0c1hpA==",
+ "dev": true,
+ "optional": true,
+ "requires": {
+ "chalk": "^4.1.0",
+ "hash-sum": "^2.0.0",
+ "loader-utils": "^2.0.0"
+ },
+ "dependencies": {
+ "ansi-styles": {
+ "version": "4.3.0",
+ "resolved": "https://registry.npmmirror.com/ansi-styles/-/ansi-styles-4.3.0.tgz",
+ "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
+ "dev": true,
+ "optional": true,
+ "requires": {
+ "color-convert": "^2.0.1"
+ }
+ },
+ "chalk": {
+ "version": "4.1.2",
+ "resolved": "https://registry.npmmirror.com/chalk/-/chalk-4.1.2.tgz",
+ "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",
+ "dev": true,
+ "optional": true,
+ "requires": {
+ "ansi-styles": "^4.1.0",
+ "supports-color": "^7.1.0"
+ }
+ },
+ "color-convert": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmmirror.com/color-convert/-/color-convert-2.0.1.tgz",
+ "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
+ "dev": true,
+ "optional": true,
+ "requires": {
+ "color-name": "~1.1.4"
+ }
+ },
+ "color-name": {
+ "version": "1.1.4",
+ "resolved": "https://registry.npmmirror.com/color-name/-/color-name-1.1.4.tgz",
+ "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
+ "dev": true,
+ "optional": true
+ },
+ "has-flag": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmmirror.com/has-flag/-/has-flag-4.0.0.tgz",
+ "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",
+ "dev": true,
+ "optional": true
+ },
+ "loader-utils": {
+ "version": "2.0.4",
+ "resolved": "https://registry.npmmirror.com/loader-utils/-/loader-utils-2.0.4.tgz",
+ "integrity": "sha512-xXqpXoINfFhgua9xiqD8fPFHgkoq1mmmpE92WlDbm9rNRd/EbRb+Gqf908T2DMfuHjjJlksiK2RbHVOdD/MqSw==",
+ "dev": true,
+ "optional": true,
+ "requires": {
+ "big.js": "^5.2.2",
+ "emojis-list": "^3.0.0",
+ "json5": "^2.1.2"
+ }
+ },
+ "supports-color": {
+ "version": "7.2.0",
+ "resolved": "https://registry.npmmirror.com/supports-color/-/supports-color-7.2.0.tgz",
+ "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",
+ "dev": true,
+ "optional": true,
+ "requires": {
+ "has-flag": "^4.0.0"
+ }
+ }
+ }
+ },
"vue-router": {
"version": "3.5.1",
"resolved": "https://registry.nlark.com/vue-router/download/vue-router-3.5.1.tgz?cache=0&sync_timestamp=1620899536020&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fvue-router%2Fdownload%2Fvue-router-3.5.1.tgz",
diff --git a/server/services/src/main/java/com/doumee/core/constants/Constants.java b/server/services/src/main/java/com/doumee/core/constants/Constants.java
index 91cd7ad..ef1250a 100644
--- a/server/services/src/main/java/com/doumee/core/constants/Constants.java
+++ b/server/services/src/main/java/com/doumee/core/constants/Constants.java
@@ -57,7 +57,7 @@
public static final String AUTO_DISPATCH_DISTANCE ="AUTO_DISPATCH_DISTANCE" ;
public static final String AUTO_CONFIRM ="AUTO_CONFIRM" ;
public static final String AUTO_CANCEL_WAIT_PAY ="AUTO_CANCEL_WAIT_PAY" ;
-
+ public static final String UTF = "UTF-8";
public static final String QYWX = "QYWX";
public static final Integer ONE = 1;
public static final Integer TWO = 2;
@@ -70,6 +70,9 @@
public static final String MEMBER_FILES = "MEMBER_FILES";
public static final String CATEGORY_FILES = "CATEGORY_FILES";
public static final String ORDERS_FILES = "ORDERS_FILES";
+ public static final String ZBOM_PARAM ="ZBOM_PARAM" ;
+ public static final String ZBOM_UK_ERROR_URL ="ZBOM_UK_ERROR_URL" ;
+ public static final String ZBOM_TICKET_LOGIN_URL ="ZBOM_TICKET_LOGIN_URL" ;
public static boolean WORKORDER_SHE_EMAIL_SENDING = false;
public static boolean DEALING_COMPANY_SYNC = false ;
public static boolean DEALING_MEMBER_SYNC = false ;
@@ -82,6 +85,11 @@
public static final String FAIL = "FAIL";
public static final String CANCELLED = "CANCELLED";
+ public interface ZbomConst{
+ String TICKET_LOGIN = "https://sso.zbom.com/esc-idm/api/v1/getUserInfo";
+ String TICKET_LOGIN_TEST = "http://testsso.zhibang.com:8080/esc-idm/api/v1/getUserInfo";
+ }
+
public interface uploadType{
String blob = "blob";
diff --git a/server/services/src/main/java/com/doumee/dao/business/dto/LoginRequestNewParam.java b/server/services/src/main/java/com/doumee/dao/business/dto/LoginRequestNewParam.java
new file mode 100644
index 0000000..e2c5e1a
--- /dev/null
+++ b/server/services/src/main/java/com/doumee/dao/business/dto/LoginRequestNewParam.java
@@ -0,0 +1,17 @@
+package com.doumee.dao.business.dto;
+
+
+import lombok.Data;
+
+import java.util.List;
+
+@Data
+public class LoginRequestNewParam {
+ private String appid;// 1 O 鎵嬫満鍙风爜
+ private String user_name;// 1 M 鐢ㄦ埛鍚岻d
+ private String rediUrl;// 1 M 鐧诲綍璐︽埛锛�
+ private String account_no ;//String 璐﹀彿
+ private String scode;//String 鐢ㄦ埛瀵瑰簲鍔犵洘鍟哠code
+ private List<RoleRequestParam> roles;// 1 M 鐧诲綍瀵嗙爜
+
+}
diff --git a/server/services/src/main/java/com/doumee/dao/business/dto/RoleRequestParam.java b/server/services/src/main/java/com/doumee/dao/business/dto/RoleRequestParam.java
new file mode 100644
index 0000000..cbd021e
--- /dev/null
+++ b/server/services/src/main/java/com/doumee/dao/business/dto/RoleRequestParam.java
@@ -0,0 +1,11 @@
+package com.doumee.dao.business.dto;
+
+import lombok.Data;
+
+@Data
+public class RoleRequestParam {
+ private String code;//瑙掕壊缂栫爜
+ private String name;// 瑙掕壊鍚嶇О
+ private String id;//缂栫爜锛�
+
+}
diff --git a/server/services/src/main/resources/application-pro.yml b/server/services/src/main/resources/application-pro.yml
index 1e4659f..b4f7782 100644
--- a/server/services/src/main/resources/application-pro.yml
+++ b/server/services/src/main/resources/application-pro.yml
@@ -1,9 +1,9 @@
spring:
# 鏁版嵁婧愰厤缃�
datasource:
- url: jdbc:mysql://b66cc1a382964a6a9d46a522f2dfe672in01.internal.cn-south-1.mysql.rds.myhuaweicloud.com:3306/jinkuai?useUnicode=true&characterEncoding=utf8&serverTimezone=Asia/Shanghai
+ url: jdbc:mysql://192.168.0.211:3306/zbom_dianjiang?useUnicode=true&characterEncoding=utf8&serverTimezone=Asia/Shanghai
username: root
- password: Jinkuai!@#$%^
+ password: Doumee@168
driver-class-name: com.mysql.cj.jdbc.Driver
type: com.alibaba.druid.pool.DruidDataSource
redis:
diff --git a/server/web/src/main/java/com/doumee/DJWebApplication.java b/server/web/src/main/java/com/doumee/DJWebApplication.java
index 92fb2f4..59dae4c 100644
--- a/server/web/src/main/java/com/doumee/DJWebApplication.java
+++ b/server/web/src/main/java/com/doumee/DJWebApplication.java
@@ -22,9 +22,4 @@
ApplicationContext context = SpringApplication.run(DJWebApplication.class);
context.getEnvironment();
}
-
-// @Override
-// protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) {
-// return builder.sources(JKWebApplication.class) ;
-// }
}
diff --git a/server/web/src/main/java/com/doumee/api/web/LoginController.java b/server/web/src/main/java/com/doumee/api/web/LoginController.java
new file mode 100644
index 0000000..4548846
--- /dev/null
+++ b/server/web/src/main/java/com/doumee/api/web/LoginController.java
@@ -0,0 +1,100 @@
+package com.doumee.api.web;
+
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
+import com.doumee.api.BaseController;
+import com.doumee.biz.system.SystemDictDataBiz;
+import com.doumee.core.annotation.excel.ExcelExporter;
+import com.doumee.core.annotation.pr.PreventRepeat;
+import com.doumee.core.constants.Constants;
+import com.doumee.core.model.ApiResponse;
+import com.doumee.core.model.LoginUserInfo;
+import com.doumee.core.model.PageData;
+import com.doumee.core.model.PageWrap;
+import com.doumee.core.utils.HttpsUtil;
+import com.doumee.dao.business.dto.LoginRequestNewParam;
+import com.doumee.dao.business.model.Category;
+import com.doumee.dao.system.model.SystemJob;
+import com.doumee.service.business.CategoryService;
+import com.sun.deploy.net.HttpUtils;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.shiro.SecurityUtils;
+import org.apache.shiro.authz.annotation.RequiresPermissions;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.servlet.ModelAndView;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.UnsupportedEncodingException;
+import java.net.URLEncoder;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.UUID;
+
+/**
+ * @author 姹熻箘韫�
+ * @date 2025/07/09 12:00
+ */
+@Api(tags = "web鐧诲綍鐩稿叧鎺ュ彛")
+@RestController
+@RequestMapping("/web")
+@Slf4j
+public class LoginController extends BaseController {
+
+ @Autowired
+ private CategoryService categoryService;
+ @Autowired
+ private SystemDictDataBiz systemDictDataBiz;
+
+ @ApiOperation("UK鍗曠偣鐧诲綍")
+ @RequestMapping("/ukLogin")
+ public void ukLogin(String tick, Object obj, HttpServletRequest request, HttpServletResponse response) throws Exception {
+ LoginRequestNewParam requestParam = new LoginRequestNewParam();
+ // UK_ERROR_URL = "http://u.zhibang.com/sso/web/token/error";
+ String errorUrl =systemDictDataBiz.queryByCode(Constants.ZBOM_PARAM,Constants.ZBOM_UK_ERROR_URL).getCode();
+ try {
+ log.error("璇锋眰鍙傛暟TICK鏈�鍘熷===========锛�" + tick);
+ JSONObject urlParams = new JSONObject();
+ log.info("璇锋眰鍙傛暟锛�" + JSON.toJSONString(urlParams));
+ //TICKET_LOGIN_TEST = "http://testsso.zhibang.com:8080/esc-idm/api/v1/getUserInfo";
+ //TICKET_LOGIN = "https://sso.zbom.com/esc-idm/api/v1/getUserInfo";
+ String url = systemDictDataBiz.queryByCode(Constants.ZBOM_PARAM,Constants.ZBOM_TICKET_LOGIN_URL).getCode() + "?tick=" + URLEncoder.encode(tick,Constants.UTF);
+ String post = HttpsUtil.get(url,true);
+ log.info("杩斿洖鍙傛暟锛�" + post);
+ JSONObject json = JSONObject.parseObject(post);
+ if (StringUtils.equals(json.getString("code"), "0")) {
+ JSONObject userInfo = json.getJSONObject("data");
+ requestParam = JSONObject.toJavaObject(userInfo, LoginRequestNewParam.class);
+ } else {
+ log.error("妗堜緥搴撶郴缁熷崟鐐圭櫥褰曞け璐� 閿欒鍘熷洜鑾峰彇tick澶辫触" + json.getString("message"));
+ response.sendRedirect(errorUrl + "?title=" + enCode("鐧婚檰閿欒") + "&msg="+ enCode(json.getString("message")));
+ return;
+ }
+ } catch (Exception e) {
+ log.error("ticket鎺ュ彛璇锋眰閿欒锛�" + e.getMessage());
+ response.sendRedirect(errorUrl + "?title=" + enCode("鐧婚檰閿欒") + "&msg=" + enCode("绯荤粺绻佸繖锛岃绋嶅悗閲嶈瘯~"));
+ return;
+ }
+ requestParam.setRediUrl("http://localhost:10087/#/login");
+ String token = UUID.randomUUID().toString()+"_doumee";
+ response.sendRedirect(requestParam.getRediUrl()+"?token="+token);
+ }
+ private String enCode(String string) {
+ // TODO Auto-generated method stub
+ String str = "";
+ try {
+ str = java.net.URLEncoder.encode(string, "utf-8");
+ } catch (UnsupportedEncodingException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ return str;
+ }
+
+
+}
diff --git a/server/web/src/main/resources/application.yml b/server/web/src/main/resources/application.yml
index 28dea6f..17dde0d 100644
--- a/server/web/src/main/resources/application.yml
+++ b/server/web/src/main/resources/application.yml
@@ -12,7 +12,7 @@
spring:
profiles:
- active: pro
+ active: dev
# JSON杩斿洖閰嶇疆
jackson:
# 榛樿鏃跺尯
--
Gitblit v1.9.3