|
@@ -118,31 +118,7 @@ public class SceneApiController {
|
|
|
BeanUtils.copyProperties(dbUser,user);
|
|
|
}
|
|
|
|
|
|
- String token = JwtUtil.createJWT(-1, user.getUserName(),"user");
|
|
|
- loginService.redisLogin(user.getUserName(), JSONObject.toJSONString(user));
|
|
|
-
|
|
|
- //登录成功
|
|
|
- if(scene.getWebSite().contains(sceneProUrl)){
|
|
|
- response.sendRedirect(mainUrl + sceneProUrl.replace("show", "edit").replace("PC", "Mobile") +
|
|
|
- sceneNum + "&t=" +System.currentTimeMillis() + "&token=" + token + "&app" +
|
|
|
- (lang == null ? "" : "&lang=" + lang) + (vlog == null ? "" : "&vlog=" + vlog));
|
|
|
- }
|
|
|
-
|
|
|
- if(scene.getIsUpgrade() != null && scene.getIsUpgrade() == 1){
|
|
|
- if(scene.getWebSite().contains(sceneProV4Url)){
|
|
|
- response.sendRedirect(mainUrl + sceneProV4Url.replace("s", "e") +
|
|
|
- sceneNum + "&t=" +System.currentTimeMillis() + "&token=" + token + "&app" +
|
|
|
- (lang == null ? "" : "&lang=" + lang) + (vlog == null ? "" : "&vlog=" + vlog));
|
|
|
- return;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- if(scene.getWebSite().contains(sceneProNewUrl)){
|
|
|
- response.sendRedirect(mainUrl + sceneProNewUrl.replace("s", "e") +
|
|
|
- sceneNum + "&t=" +System.currentTimeMillis() + "&token=" + token + "&app" +
|
|
|
- (lang == null ? "" : "&lang=" + lang) + (vlog == null ? "" : "&vlog=" + vlog));
|
|
|
- }
|
|
|
- return;
|
|
|
+ sendResponse(user,webSite, response,sceneNum,lang,vlog);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -154,7 +130,6 @@ public class SceneApiController {
|
|
|
if(userId == null) {
|
|
|
throw new BusinessException(SceneConstant.FAILURE_CODE_5013, SceneConstant.FAILURE_MSG_5013);
|
|
|
}
|
|
|
-
|
|
|
User user = userService.getByUserName(phoneNum);
|
|
|
if(user == null){
|
|
|
throw new BusinessException(LoginConstant.FAILURE_CODE_3015, LoginConstant.FAILURE_MSG_3015);
|
|
@@ -174,32 +149,43 @@ public class SceneApiController {
|
|
|
|
|
|
}
|
|
|
|
|
|
- if(!SecurityUtil.MD5(password).equals(ssoUser.getPassword()))
|
|
|
- {
|
|
|
+ if(!SecurityUtil.MD5(password).equals(ssoUser.getPassword())) {
|
|
|
throw new BusinessException(LoginConstant.FAILURE_CODE_3015, LoginConstant.FAILURE_MSG_3015);
|
|
|
}
|
|
|
+ sendResponse(ssoUser,webSite, response,sceneNum,lang,vlog);
|
|
|
|
|
|
- String token = JwtUtil.createJWT(-1, ssoUser.getUserName(),"user");
|
|
|
- loginService.redisLogin(ssoUser.getUserName(),JSONObject.toJSONString(ssoUser));
|
|
|
+ }
|
|
|
+
|
|
|
+ private void sendResponse(UserVo user, String webSite,
|
|
|
+ HttpServletResponse response, String sceneNum, String lang, String vlog) {
|
|
|
+ String token = JwtUtil.createJWT(-1, user.getUserName(),"user");
|
|
|
+ loginService.redisLogin(user.getUserName(),JSONObject.toJSONString(user));
|
|
|
//登录成功
|
|
|
- if(webSite.contains(sceneProUrl)){
|
|
|
- response.sendRedirect(mainUrl + sceneProUrl.replace("show", "edit").replace("PC", "Mobile") +
|
|
|
- sceneNum + "&t=" +System.currentTimeMillis() + "&token=" + token + "&app" +
|
|
|
- (lang == null ? "" : "&lang=" + lang) + (vlog == null ? "" : "&vlog=" + vlog));
|
|
|
- }
|
|
|
+ try {
|
|
|
+ if(webSite.contains(sceneProUrl)){
|
|
|
+ response.sendRedirect(mainUrl + sceneProUrl.replace("show", "edit").replace("PC", "Mobile") +
|
|
|
+ sceneNum + "&t=" +System.currentTimeMillis() + "&token=" + token + "&app" +
|
|
|
+ (lang == null ? "" : "&lang=" + lang) + (vlog == null ? "" : "&vlog=" + vlog));
|
|
|
+ return;
|
|
|
+ }
|
|
|
|
|
|
- if(webSite.contains(sceneProV4Url)){
|
|
|
- response.sendRedirect(mainUrl + sceneProV4Url.replace("s", "e") +
|
|
|
- sceneNum + "&t=" +System.currentTimeMillis() + "&token=" + token + "&app" +
|
|
|
- (lang == null ? "" : "&lang=" + lang) + (vlog == null ? "" : "&vlog=" + vlog));
|
|
|
- return;
|
|
|
- }
|
|
|
+ if(webSite.contains(sceneProV4Url)){
|
|
|
+ response.sendRedirect(mainUrl + sceneProV4Url.replace("s", "e") +
|
|
|
+ sceneNum + "&t=" +System.currentTimeMillis() + "&token=" + token + "&app" +
|
|
|
+ (lang == null ? "" : "&lang=" + lang) + (vlog == null ? "" : "&vlog=" + vlog));
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ if(webSite.contains(sceneProNewUrl)) {
|
|
|
+ response.sendRedirect(mainUrl + sceneProNewUrl.replace("s", "e") +
|
|
|
+ sceneNum + "&t=" + System.currentTimeMillis() + "&token=" + token + "&app" +
|
|
|
+ (lang == null ? "" : "&lang=" + lang) + (vlog == null ? "" : "&vlog=" + vlog));
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ }catch (Exception e){
|
|
|
|
|
|
- if(webSite.contains(sceneProNewUrl)) {
|
|
|
- response.sendRedirect(mainUrl + sceneProNewUrl.replace("s", "e") +
|
|
|
- sceneNum + "&t=" + System.currentTimeMillis() + "&token=" + token + "&app" +
|
|
|
- (lang == null ? "" : "&lang=" + lang) + (vlog == null ? "" : "&vlog=" + vlog));
|
|
|
}
|
|
|
+
|
|
|
}
|
|
|
|
|
|
//app调用 跳转到官网消费页面
|