|
|
@@ -82,15 +82,7 @@ public class AuthAction extends BaseAction {
|
|
|
public ModelAndView loginForDemo(HttpServletRequest request, HttpServletResponse response) {
|
|
|
String domain = getDomain(request);
|
|
|
String ip = getIpAddr(request);
|
|
|
- Long localSiteId = null;
|
|
|
- String siteIdStr = request.getHeader("Site-Id");
|
|
|
- if(!siteIdStr.isEmpty()){
|
|
|
- try{
|
|
|
- localSiteId = Long.parseLong(siteIdStr);
|
|
|
- }catch (Exception e){
|
|
|
- log.error("Site-Id is not number");
|
|
|
- }
|
|
|
- }
|
|
|
+ Long localSiteId = getLocalSiteId(request);
|
|
|
String agent = request.getHeader("User-Agent").toLowerCase();
|
|
|
ResultMsg<JSONObject> result = authService.login("zh_CN", domain, "demo", "demo", null, null, ip, agent,localSiteId);
|
|
|
if (SystemConstant.RESULT_STATUS_SUCCESS == result.getStatus()) {
|
|
|
@@ -113,15 +105,7 @@ public class AuthAction extends BaseAction {
|
|
|
, @RequestParam(value = "authCode", required = false) String authCode) {
|
|
|
String domain = getDomain(request);
|
|
|
String ip = getIpAddr(request);
|
|
|
- Long localSiteId = null;
|
|
|
- String siteIdStr = request.getHeader("Site-Id");
|
|
|
- if(!siteIdStr.isEmpty()){
|
|
|
- try{
|
|
|
- localSiteId = Long.parseLong(siteIdStr);
|
|
|
- }catch (Exception e){
|
|
|
- log.error("Site-Id is not number");
|
|
|
- }
|
|
|
- }
|
|
|
+ Long localSiteId = getLocalSiteId(request);
|
|
|
String agent = request.getHeader("User-Agent").toLowerCase();
|
|
|
Object session_code = request.getSession().getAttribute(SystemConstant.SYSTEM_LOGIN_AUTHCODE);
|
|
|
ResultMsg<JSONObject> result = authService.login("zh_CN", domain, loginName, loginPass, authCode, session_code, ip, agent,localSiteId);
|