doum
2026-01-27 0694a87211c872d8cecd3d1662a9e0b56644d43b
uk单点登录
已添加3个文件
已修改7个文件
312 ■■■■ 文件已修改
.idea/compiler.xml 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
admin/.env.development 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
admin/package-lock.json 160 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/services/src/main/java/com/doumee/core/constants/Constants.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/services/src/main/java/com/doumee/dao/business/dto/LoginRequestNewParam.java 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/services/src/main/java/com/doumee/dao/business/dto/RoleRequestParam.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/services/src/main/resources/application-pro.yml 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/web/src/main/java/com/doumee/DJWebApplication.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/web/src/main/java/com/doumee/api/web/LoginController.java 100 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/web/src/main/resources/application.yml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
.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" />
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'
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",
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";
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 ç”¨æˆ·åId
    private String rediUrl;// 1 M ç™»å½•账户;
    private String account_no    ;//String    è´¦å·
    private String scode;//String    ç”¨æˆ·å¯¹åº”加盟商Scode
    private List<RoleRequestParam> roles;// 1 M ç™»å½•密码
}
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;//编码;
}
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:
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) ;
//    }
}
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;
    }
}
server/web/src/main/resources/application.yml
@@ -12,7 +12,7 @@
spring:
  profiles:
    active: pro
    active: dev
  # JSON返回配置
  jackson:
    # é»˜è®¤æ—¶åŒº