|
|
@ -2,8 +2,10 @@ package com.daqing.financial.hrauth.controller; |
|
|
|
|
|
|
|
|
|
|
|
import com.daqing.financial.hrauth.UserLoginControllerApi; |
|
|
|
import com.daqing.financial.hrauth.UserLoginControllerApi; |
|
|
|
import com.daqing.financial.hrauth.config.WeChatConfig; |
|
|
|
import com.daqing.financial.hrauth.config.WeChatConfig; |
|
|
|
|
|
|
|
import com.daqing.financial.hrauth.feign.HrmsFeignService; |
|
|
|
import com.daqing.financial.hrauth.service.UserLoginService; |
|
|
|
import com.daqing.financial.hrauth.service.UserLoginService; |
|
|
|
import com.daqing.financial.hrauth.service.UserService; |
|
|
|
import com.daqing.financial.hrauth.service.UserService; |
|
|
|
|
|
|
|
import com.daqing.framework.domain.hrms.EmployeeEntity; |
|
|
|
import com.daqing.framework.domain.hrms.UserEntity; |
|
|
|
import com.daqing.framework.domain.hrms.UserEntity; |
|
|
|
import com.daqing.framework.domain.hrms.request.*; |
|
|
|
import com.daqing.framework.domain.hrms.request.*; |
|
|
|
import com.daqing.framework.model.response.ResponseResult; |
|
|
|
import com.daqing.framework.model.response.ResponseResult; |
|
|
@ -20,6 +22,7 @@ import javax.servlet.http.HttpServletResponse; |
|
|
|
import javax.validation.Valid; |
|
|
|
import javax.validation.Valid; |
|
|
|
import java.io.IOException; |
|
|
|
import java.io.IOException; |
|
|
|
import java.io.UnsupportedEncodingException; |
|
|
|
import java.io.UnsupportedEncodingException; |
|
|
|
|
|
|
|
import java.net.URLDecoder; |
|
|
|
import java.net.URLEncoder; |
|
|
|
import java.net.URLEncoder; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -42,6 +45,9 @@ public class UserLoginController implements UserLoginControllerApi { |
|
|
|
@Autowired |
|
|
|
@Autowired |
|
|
|
private UserService userService; |
|
|
|
private UserService userService; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
|
|
|
private HrmsFeignService hrmsFeignService; |
|
|
|
|
|
|
|
|
|
|
|
@PostMapping("/loginSuccess") |
|
|
|
@PostMapping("/loginSuccess") |
|
|
|
public String loginSuccess(){ |
|
|
|
public String loginSuccess(){ |
|
|
|
|
|
|
|
|
|
|
@ -134,7 +140,21 @@ public class UserLoginController implements UserLoginControllerApi { |
|
|
|
|
|
|
|
|
|
|
|
String token = user.getToken(); |
|
|
|
String token = user.getToken(); |
|
|
|
// state 当前用户的页面地址,需要拼接 http:// 这样才不会站内跳转
|
|
|
|
// state 当前用户的页面地址,需要拼接 http:// 这样才不会站内跳转
|
|
|
|
response.sendRedirect("http://www.huorantech.cn/dq/index.html#/Dashboard?token="+token); |
|
|
|
//String name = URLEncoder.encode(user.getAccount(),"UTF-8");
|
|
|
|
|
|
|
|
//String account = "";
|
|
|
|
|
|
|
|
/* try { |
|
|
|
|
|
|
|
account = URLDecoder.decode(name,"UTF-8"); |
|
|
|
|
|
|
|
} catch (UnsupportedEncodingException e) { |
|
|
|
|
|
|
|
e.printStackTrace(); |
|
|
|
|
|
|
|
}*/ |
|
|
|
|
|
|
|
String username = user.getAccount(); |
|
|
|
|
|
|
|
String imgUrl = user.getHeadPortaritUrl(); |
|
|
|
|
|
|
|
String encoder = "UTF-8"; |
|
|
|
|
|
|
|
String account = URLEncoder.encode(username,encoder); |
|
|
|
|
|
|
|
String headerImg = URLDecoder.decode(imgUrl,encoder); |
|
|
|
|
|
|
|
//account = new String(username.getBytes("GBK"),"iso-8859-1");
|
|
|
|
|
|
|
|
log.info("account==========="+account+"headerImg============="+headerImg); |
|
|
|
|
|
|
|
response.sendRedirect("http://www.huorantech.cn/dq/index.html#/Dashboard?token="+token+"&account="+account+"&headerImg="+headerImg); |
|
|
|
//response.sendRedirect(state+"?token="+token+"&head_img="+user.getHeadImg()+"&name="+URLEncoder.encode(user.getName(),"UTF-8"));
|
|
|
|
//response.sendRedirect(state+"?token="+token+"&head_img="+user.getHeadImg()+"&name="+URLEncoder.encode(user.getName(),"UTF-8"));
|
|
|
|
} |
|
|
|
} |
|
|
|
}else { |
|
|
|
}else { |
|
|
|