|
|
@@ -1,5 +1,6 @@
|
|
|
package com.storlead.centre.app;
|
|
|
|
|
|
+import cn.hutool.core.util.StrUtil;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
@@ -12,6 +13,7 @@ import com.storlead.centre.service.SysAppInfoService;
|
|
|
import com.storlead.centre.service.SysAppPageInfoService;
|
|
|
import com.storlead.centre.util.CryptoZipUtil;
|
|
|
import com.storlead.centre.util.HttpSecurityCheckUtil;
|
|
|
+import com.storlead.framework.auth.vo.LoginUser;
|
|
|
import com.storlead.framework.common.constant.CommonConstant;
|
|
|
import com.storlead.framework.common.util.MD5Util;
|
|
|
import com.storlead.framework.util.LoginUserUtil;
|
|
|
@@ -111,6 +113,10 @@ public class AppManageApiController {
|
|
|
@ApiOperation(value = "应用管理-跳转子页", notes = "应用管理-跳转子页")
|
|
|
public Result<?> jumpToPage(Long pageId) {
|
|
|
|
|
|
+ String token = LoginUserUtil.getLoginToken();
|
|
|
+ if (StrUtil.isBlank(token)) {
|
|
|
+ return Result.error("未登录!");
|
|
|
+ }
|
|
|
SysAppPageInfoEntity page = sysAppPageInfoService.getById(pageId);
|
|
|
if (Objects.isNull(page)) {
|
|
|
return Result.error("无权限");
|
|
|
@@ -121,15 +127,16 @@ public class AppManageApiController {
|
|
|
Map<String,String> argMap = new HashMap<>();
|
|
|
Long dt = System.currentTimeMillis() / 1000 % HttpSecurityCheckUtil.divisor;
|
|
|
argMap.put("dt",dt.toString());
|
|
|
- argMap.put("redirect",info.getRedirectUri());
|
|
|
+ argMap.put("redirect",page.getRedirectUri());
|
|
|
argMap.put("appSecret",info.getAppSecret());
|
|
|
- argMap.put("token","ouunwqlkeklnkljm23jk3nywwqk");
|
|
|
- argMap.put("account","ouunwqlkeklnkljm23jk3nywwqk");
|
|
|
+ argMap.put("token",token);
|
|
|
+ argMap.put("account","admin");
|
|
|
String sign = MD5Util.MD5Encode(HttpSecurityCheckUtil.makeSign(argMap),"UTF-8");
|
|
|
-
|
|
|
argMap.put("sign",sign);
|
|
|
- String urlParam = HttpSecurityCheckUtil.buildUrlParams(argMap);
|
|
|
- String requestUrl = info.getHomepageUrl()+"?"+urlParam;
|
|
|
+ argMap.remove("appSecret");
|
|
|
+// String urlParam = HttpSecurityCheckUtil.buildUrlParams(argMap);
|
|
|
+ String encrypted = CryptoZipUtil.encryptParams(argMap,SALT_KEY);
|
|
|
+ String requestUrl = info.getHomepageUrl()+"/ssoredirect?ticket="+encrypted;
|
|
|
return Result.result(requestUrl);
|
|
|
}
|
|
|
|
|
|
@@ -137,20 +144,24 @@ public class AppManageApiController {
|
|
|
@ApiOperation(value = "应用管理-跳转主页", notes = "应用管理-跳转主页")
|
|
|
public Result<?> jumpToHome(Long appId) {
|
|
|
SysAppInfoEntity info = sysAppInfoService.getById(appId);
|
|
|
+ LoginUser loginUser = LoginUserUtil.getLoginUser();
|
|
|
|
|
|
- LoginUserUtil.getLoginUser();
|
|
|
+ String token = LoginUserUtil.getLoginToken();
|
|
|
+ if (StrUtil.isBlank(token) || Objects.isNull(loginUser)) {
|
|
|
+ return Result.error("未登录!");
|
|
|
+ }
|
|
|
Map<String,String> argMap = new HashMap<>();
|
|
|
Long dt = System.currentTimeMillis() / 1000 % HttpSecurityCheckUtil.divisor;
|
|
|
argMap.put("dt",dt.toString());
|
|
|
argMap.put("redirect",info.getRedirectUri());
|
|
|
argMap.put("appSecret",info.getAppSecret());
|
|
|
- argMap.put("token","ouunwqlkeklnkljm23jk3nywwqk");
|
|
|
- argMap.put("account","ouunwqlkeklnkljm23jk3nywwqk");
|
|
|
+ argMap.put("token",token);
|
|
|
+ argMap.put("account",loginUser.getMobile());
|
|
|
String sign = MD5Util.MD5Encode(HttpSecurityCheckUtil.makeSign(argMap),"UTF-8");
|
|
|
|
|
|
argMap.put("sign",sign);
|
|
|
String urlParam = HttpSecurityCheckUtil.buildUrlParams(argMap);
|
|
|
- String requestUrl = info.getHomepageUrl()+"?"+urlParam;
|
|
|
+ String requestUrl = info.getHomepageUrl()+"/ssoredirect?ticket="+urlParam;
|
|
|
return Result.result(requestUrl);
|
|
|
}
|
|
|
|