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