From 7d85830f3b7b6b9ef4ffece2b7df7d65c9b30fab Mon Sep 17 00:00:00 2001 From: yn147 <2270338776@qq.com> Date: 星期三, 29 三月 2023 20:15:43 +0800 Subject: [PATCH] 门户跨域 --- src/main/java/com/qxueyou/scc/sys/action/LoginController.java | 23 +++++++++++++---------- 1 files changed, 13 insertions(+), 10 deletions(-) diff --git a/src/main/java/com/qxueyou/scc/sys/action/LoginController.java b/src/main/java/com/qxueyou/scc/sys/action/LoginController.java index 2e07cd7..e0d5693 100644 --- a/src/main/java/com/qxueyou/scc/sys/action/LoginController.java +++ b/src/main/java/com/qxueyou/scc/sys/action/LoginController.java @@ -294,18 +294,21 @@ public Result platformLogin(@RequestParam("account") String account, @RequestParam("password") String password,String uuNumber,String uuReNumber, HttpServletRequest request, HttpServletResponse response, String logType,String organizationId, String platForm) { // response.setHeader("Access-Control-Allow-Origin", "*"); - if(StringUtils.isEmpty(account)) { - return new Result(false, "鐢ㄦ埛璐﹀彿涓嶈兘涓虹┖"); - } + if (StringUtils.isEmpty(account)) { + return new Result(false, "鐢ㄦ埛璐﹀彿涓嶈兘涓虹┖"); + } // System.out.println(account+password); // System.out.println("-------------------------"+organizationId+"--------------"+platForm+"-----------"+logType); - String hql = null; - List<Object> params = null; + String hql = null; + List<Object> params = null; // boolean flag=true; - if("study".equals(logType)){ - hql = "from User where deleteFlag is false and account = ? and password = ? "; - params = CollectionUtils.newList(account,password); - }else{ + if ("study".equals(logType)) { + hql = "from User where deleteFlag is false and account = ? and password = ? "; + params = CollectionUtils.newList(account, password); + }else if("portal".equals(logType)){ + hql = "from User where deleteFlag is false and mobilePhone = ? and password = ? "; + params = CollectionUtils.newList(account, password); + }else{ if(StringUtils.isEmpty(password)) { return new Result(false, "鐢ㄦ埛瀵嗙爜涓嶈兘涓虹┖"); } @@ -371,7 +374,7 @@ // 瀛樺埌redis redisTemplate.opsForValue().set(UserInfoWrapper.SESSION_USER_INFO_KEY, wrapper); request.getSession().setAttribute(UserInfoWrapper.SESSION_USER_INFO_KEY, wrapper); - if ("study".equals(logType)) { + if ("study".equals(logType) || "portal".equals(logType)) { /*if (StringUtils.isEmpty(ClientUtils.getClassId()) && user.getRoles() == null) { return new Result(false, "璇ョ敤鎴锋湭鍔犲叆浠讳綍鐝骇鎴栨湭婵�娲伙紝璇疯仈绯荤彮涓讳换"); }*/ -- Gitblit v1.8.0