Bläddra i källkod

Merge branch 'dev' of ssh://10.10.100.21/source/saas-platform into dev

zhuth 7 år sedan
förälder
incheckning
cb62254490

+ 2 - 2
applications/commons/commons-server/src/main/resources/mapper/HomePageMapper.xml

@@ -67,11 +67,11 @@
     <select id="getSaleData" parameterType="long" resultType="string">
       select concat('[',five,',',other,']') from ((
 
-    select GROUP_CONCAT(concat('{"x":"',si_custname,'","y":',IFNULL(round(si_amount/10000,2),0),'}')) five from (
+    select GROUP_CONCAT(concat('{"x":"',si_custname,'","y":',IFNULL(round(si_amount/10000,2),0),',"z":"',si_custshortname,'"}')) five from (
     select * from statsinfo where companyid=#{componyId} and si_yearmonth=DATE_FORMAT(now(),'%Y%m') and si_type='SALE' ORDER BY si_amount desc limit 0,5
     ) c)d,(
 
-    select concat('{"x":"其它","y":',ifnull(round((all_sum - five_sum)/10000,2),0),'}') other from ( (select sum(si_amount) all_sum from statsinfo  where companyid=#{componyId} and si_yearmonth=DATE_FORMAT(now(),'%Y%m') and si_type='SALE')a,
+    select concat('{"x":"其它","y":',ifnull(round((all_sum - five_sum)/10000,2),0),',"z":"其它"}') other from ( (select sum(si_amount) all_sum from statsinfo  where companyid=#{componyId} and si_yearmonth=DATE_FORMAT(now(),'%Y%m') and si_type='SALE')a,
     ( select sum(si_amount) five_sum from (select si_amount from statsinfo where companyid=#{componyId} and si_yearmonth=DATE_FORMAT(now(),'%Y%m') and si_type='SALE' ORDER BY si_amount desc limit 0,5)f)b))e)
     </select>
 

+ 6 - 16
base-servers/auth/auth-server/src/main/java/com/usoftchina/saas/auth/controller/AuthController.java

@@ -219,8 +219,8 @@ public class AuthController {
      * @param info
      * @return
      */
-    @GetMapping("/sso/callback/{clientId}")
-    public void ssoCallback(HttpServletRequest request, HttpServletResponse response,
+    @GetMapping(value = "/sso/callback/{clientId}", produces = {"application/javascript"})
+    public String ssoCallback(HttpServletRequest request, HttpServletResponse response,
                             @PathVariable(required = false) String clientId, CookieInfo info, String callback) throws IOException{
         if (null != info && null != info.getMobile()) {
             AccountDTO accountDTO = null;
@@ -232,7 +232,7 @@ public class AuthController {
                 } else {
                     logger.error(result.getMessage());
                     ServletUtils.writeJsonPMessage(response, callback, false);
-                    return;
+                    return "successCallback({success:'0'})";
                 }
             } else {
                 accountDTO = result.getData();
@@ -243,7 +243,7 @@ public class AuthController {
                     if (!updateResult.isSuccess()) {
                         logger.error(updateResult.getMessage());
                         ServletUtils.writeJsonPMessage(response, callback, false);
-                        return;
+                        return "successCallback({success:'0'})";
                     }
                 }
             }
@@ -253,18 +253,6 @@ public class AuthController {
             authorizeLogService.save(AuthorizeLog.from(request)
                     .setAccountId(accountDTO.getId())
                     .setAppId(appId).build());
-            //将cookies
-            Cookie[] cookies = request.getCookies();
-            Cookie ssoCookies = null;
-            for (Cookie cookie : cookies) {
-                if (cookieConfig.getName().equals(cookie.getName())) {
-                    ssoCookies = cookie;
-                    break;
-                }
-            }
-            if (null != ssoCookies) {
-                response.addCookie(ssoCookies);
-            }
             // 将登录信息推送到客户端
             if (!StringUtils.isEmpty(clientId)) {
                 Long companyId = null;
@@ -276,9 +264,11 @@ public class AuthController {
                 TokenDTO tokenDTO = BeanMapper.map(jwtToken, TokenDTO.class);
                 socketMessageApi.sendToClient(clientId, "/sso/callback",
                         JsonUtils.toJsonString(new AuthDTO(tokenDTO, accountDTO)));
+                return "successCallback({success:'1'})";
             }
             ServletUtils.writeJsonPMessage(response, callback, true);
         }
+        return "successCallback({success:'0'})";
     }
 
     /**