commit
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>com.budwk</groupId>
|
||||
<artifactId>v4</artifactId>
|
||||
<artifactId>zhgh_squ</artifactId>
|
||||
<version>5.6.0-plus</version>
|
||||
<build>
|
||||
<resources>
|
||||
|
||||
@@ -165,24 +165,35 @@ public class SysLoginController {
|
||||
@At(value = "/platform/wxwork/oauth2/callback", top = true)
|
||||
@Ok("re")
|
||||
@ApiOperation("企业微信登录回调")
|
||||
@Filters
|
||||
public String wxworkOAuth2(@Param("code") String code, @Param("redirect") String redirect, HttpServletRequest request) {
|
||||
if (StrUtil.isBlank(code)) {
|
||||
return ">>:/platform/home";
|
||||
}
|
||||
String token = redisService.get(RedisConstant.REDIS_KEY_WX_WORK_TOKEN);
|
||||
if (StrUtil.isBlank(token)) {
|
||||
return ">>:/platform/home";
|
||||
}
|
||||
String url = "https://qyapi.weixin.qq.com/cgi-bin/auth/getuserinfo?access_token=ACCESS_TOKEN&code=CODE";
|
||||
url = url.replace("ACCESS_TOKEN", token).replace("CODE", code);
|
||||
String response = HttpUtil.get(url);
|
||||
JSONObject jsonObject = JSONUtil.parseObj(response);
|
||||
if (jsonObject.getInt("errcode") == 0) {
|
||||
String loginName = jsonObject.getStr("userid");
|
||||
sysUserService.checkThirdPlatformLoginName(loginName);
|
||||
Sys_user sysUser = sysUserService.loginByLoginName(loginName);
|
||||
return ">>:" + sysUserService.loginPlus(sysUser, LoginType.QI_YE_WECHAT, request);
|
||||
} else {
|
||||
try {
|
||||
if (StrUtil.isBlank(code)) {
|
||||
return ">>:/platform/home";
|
||||
}
|
||||
String token = redisService.get(RedisConstant.REDIS_KEY_WX_WORK_TOKEN);
|
||||
if (StrUtil.isBlank(token)) {
|
||||
log.error("企业微信 token 为空");
|
||||
return ">>:/platform/home";
|
||||
}
|
||||
String url = "https://qyapi.weixin.qq.com/cgi-bin/auth/getuserinfo?access_token=ACCESS_TOKEN&code=CODE";
|
||||
url = url.replace("ACCESS_TOKEN", token).replace("CODE", code);
|
||||
String response = HttpUtil.get(url);
|
||||
JSONObject jsonObject = JSONUtil.parseObj(response);
|
||||
if (jsonObject.getInt("errcode") == 0) {
|
||||
String loginName = jsonObject.getStr("userid");
|
||||
log.info("企业微信授权成功,userid: " + loginName);
|
||||
sysUserService.checkThirdPlatformLoginName(loginName);
|
||||
Sys_user sysUser = sysUserService.loginByLoginName(loginName);
|
||||
String result = sysUserService.loginPlus(sysUser, LoginType.QI_YE_WECHAT, request);
|
||||
log.info("企业微信登录成功,重定向到:" + result);
|
||||
return ">>:" + result;
|
||||
} else {
|
||||
log.error("企业微信授权失败:" + jsonObject);
|
||||
return ">>:/platform/home/500";
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("企业微信登录异常", e);
|
||||
return ">>:/platform/home/500";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -433,7 +433,8 @@ public class SysUnionController {
|
||||
@SaCheckPermission("sys.manager.union.partUnit")
|
||||
public Result branchUnionPartUnitTransferData(String unionId) {
|
||||
// List<Sys_unit> units = dao.query(Sys_unit.class, Cnd.where("unitLevel", "=", 2).asc("unitcode"));
|
||||
List<Sys_unit> units = dao.query(Sys_unit.class, Cnd.where("unitTypeCode", "=", "1").asc("unitcode"));
|
||||
// List<Sys_unit> units = dao.query(Sys_unit.class, Cnd.where("unitTypeCode", "=", "1").asc("unitcode"));
|
||||
List<Sys_unit> units = dao.query(Sys_unit.class, Cnd.where("unitLevel", "=", "3").asc("unitcode"));
|
||||
List<String> selectUnitIds = units.stream().filter(unit -> StrUtil.isNotBlank(unit.getUnionId()) && unit.getUnionId().equals(unionId)).map(Sys_unit::getId).toList();
|
||||
List<Sys_unit> matchUnits = units.stream().filter(unit -> StrUtil.isBlank(unit.getUnionId()) || (StrUtil.isNotBlank(unit.getUnionId()) && unit.getUnionId().equals(unionId))).toList();
|
||||
NutMap transferData = NutMap.NEW().addv("selectUnitIds", selectUnitIds).addv("allUnits", matchUnits);
|
||||
|
||||
@@ -295,7 +295,7 @@ public class SysUnitController {
|
||||
nodeList.add(new TreeNode<>(list.get(i).getId(), list.get(i).getParentId(), list.get(i).getName(), i)
|
||||
.setExtra(
|
||||
Map.of(
|
||||
"unitType", list.get(i).getUnitType(),
|
||||
// "unitType", list.get(i).getUnitType(),
|
||||
"unitTypeCode", list.get(i).getUnitTypeCode()
|
||||
)
|
||||
));
|
||||
@@ -315,6 +315,7 @@ public class SysUnitController {
|
||||
|
||||
return Result.success(treeList);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return Result.error();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -189,6 +189,11 @@ public class SysDataUserAllUpdateServiceImpl implements SysDataUserUpdateService
|
||||
Sys_user u = new Sys_user();
|
||||
BeanUtils.copyProperties(source, u);
|
||||
|
||||
//单位id取前四位数(二级单位)
|
||||
if (u.getUnitId() != null && u.getUnitId().length() > 4) {
|
||||
u.setUnitId(u.getUnitId().substring(0, 4));
|
||||
}
|
||||
|
||||
if (user == null) {
|
||||
// 新增用户,初始化数据
|
||||
String salt = R.UU32();
|
||||
|
||||
@@ -34,7 +34,7 @@ public class Globals {
|
||||
//项目LOGO
|
||||
public static String AppLogo = "";
|
||||
//项目域名
|
||||
public static String AppDomain = "http://127.0.0.1";
|
||||
public static String AppDomain = "https://zhgh.squ.edu.cn";
|
||||
//文件访问域名
|
||||
public static String AppFileDomain = "";
|
||||
//学校代码
|
||||
|
||||
@@ -227,18 +227,24 @@ public class WkFailProcessor extends ViewProcessor {
|
||||
*/
|
||||
private BrowserPlatform getBrowserPlatform(HttpServletRequest request) {
|
||||
String uaStr = request.getHeader("User-Agent");
|
||||
|
||||
// 优先判断企业微信(无论 PC 还是移动端)
|
||||
if (uaStr.contains("wxwork") || uaStr.contains("WeChatWork")) {
|
||||
return BrowserPlatform.QI_YE_WEI_XIN;
|
||||
}
|
||||
|
||||
// 再判断微信
|
||||
if (uaStr.contains("MicroMessenger")) {
|
||||
return BrowserPlatform.WEI_XIN;
|
||||
}
|
||||
|
||||
// 判断是否为移动端
|
||||
UserAgent ua = UserAgentUtil.parse(uaStr);
|
||||
if (ua.isMobile()) {
|
||||
if (uaStr.contains("MicroMessenger") && uaStr.contains("wxwork")) {
|
||||
return BrowserPlatform.QI_YE_WEI_XIN;
|
||||
}
|
||||
if (uaStr.contains("MicroMessenger")) {
|
||||
return BrowserPlatform.WEI_XIN;
|
||||
}
|
||||
return BrowserPlatform.H5_WEB;
|
||||
} else {
|
||||
return BrowserPlatform.PC_WEB;
|
||||
}
|
||||
|
||||
return BrowserPlatform.PC_WEB;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
E87PddAHxkY7Cvwy
|
||||
@@ -6,21 +6,21 @@ layout("/layouts/platform.html"){
|
||||
background: transparent;
|
||||
padding: 8px;
|
||||
}
|
||||
|
||||
|
||||
/* 节点行高调整 */
|
||||
.custom-tree .el-tree-node {
|
||||
margin: 2px 0;
|
||||
border-radius: 6px;
|
||||
transition: all 0.2s ease;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/* 选中状态 */
|
||||
.custom-tree .el-tree-node.is-current > .el-tree-node__content {
|
||||
background: #e8f4ff;
|
||||
border-left: 3px solid #409eff;
|
||||
}
|
||||
|
||||
|
||||
/* 节点内容区域 */
|
||||
.custom-tree .el-tree-node__content {
|
||||
height: 36px;
|
||||
@@ -29,7 +29,7 @@ layout("/layouts/platform.html"){
|
||||
border-radius: 6px;
|
||||
transition: all 0.2s ease;
|
||||
}
|
||||
|
||||
|
||||
/* 自定义节点内容 */
|
||||
.custom-tree-node {
|
||||
display: flex;
|
||||
@@ -37,8 +37,8 @@ layout("/layouts/platform.html"){
|
||||
width: 100%;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/* 文件夹图标颜色优化 */
|
||||
.el-icon-folder {
|
||||
color: #909399;
|
||||
@@ -46,7 +46,7 @@ layout("/layouts/platform.html"){
|
||||
.el-icon-folder-opened {
|
||||
color: #409eff;
|
||||
}
|
||||
|
||||
|
||||
/* 展开时图标旋转动画 */
|
||||
.custom-tree .el-tree-node__expand-icon {
|
||||
transition: transform 0.3s ease;
|
||||
@@ -54,7 +54,7 @@ layout("/layouts/platform.html"){
|
||||
.custom-tree .el-tree-node__expand-icon.expanded {
|
||||
transform: rotate(90deg);
|
||||
}
|
||||
|
||||
|
||||
/* 节点标签 */
|
||||
.node-label {
|
||||
flex: 1;
|
||||
@@ -62,13 +62,13 @@ layout("/layouts/platform.html"){
|
||||
color: #303133;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
|
||||
/* 禁用展开图标(当无子节点时) */
|
||||
.custom-tree .el-tree-node__expand-icon.is-leaf {
|
||||
color: transparent;
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
|
||||
</style>
|
||||
<div id="app" v-cloak>
|
||||
<el-row type="flex" :gutter="20" style="height: calc(100vh - 126px)">
|
||||
|
||||
Reference in New Issue
Block a user