单点登陆修改

dongdingding
dongdingding 8 months ago
parent a76dafe03f
commit a57254ac8b

@ -5,6 +5,7 @@ import cn.hutool.http.HttpUtil;
import cn.hutool.json.JSONObject;
import cn.hutool.json.JSONUtil;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.jjh.declaration.single.dto.response.ChiefResponse;
import com.ruoyi.jjh.declaration.single.service.SingleLoginService;
import io.swagger.annotations.Api;
@ -20,6 +21,7 @@ import javax.annotation.Resource;
/**
*
*
* @author du
* @since 2024/6/4 9:53
*/
@ -45,11 +47,11 @@ public class ChiefController {
@RequestParam("sign") String sign,
@RequestParam("loginType") String loginType
) {
String md5 = accountName+timestamp;
String md5 = accountName + timestamp;
String md5Password = DigestUtils.md5DigestAsHex(md5.getBytes());
if(md5Password.equals(sign.toLowerCase())){
if (md5Password.equals(sign.toLowerCase())) {
//政务端获取用户信息
String url = zwUrl + "?accountName=" + accountName +"&appkey"+appkey;
String url = zwUrl + "?accountName=" + accountName + "&appkey" + appkey;
HttpResponse response = HttpUtil.createGet(url).execute();
// 获取响应状态码
int statusCode = response.getStatus();
@ -58,14 +60,13 @@ public class ChiefController {
JSONObject jsonObj = JSONUtil.parseObj(responseBody);
JSONObject dataObj = jsonObj.getJSONObject("data");
ChiefResponse req = JSONUtil.toBean(dataObj, ChiefResponse.class);
// req.setToken(singleLoginService.singleLogin("1","2",null,"02"));
//判断几个政务端用户
return AjaxResult.success(req);
}
}else {
//跳转到登录页面
} else {
throw new ServiceException("登陆失败");
}
return null;
throw new ServiceException("登陆失败");
}
}

Loading…
Cancel
Save