Browse Source

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

zhuth 7 years ago
parent
commit
cd8fa2339d

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

@@ -124,9 +124,9 @@ public class AuthController {
      * @param info
      * @return
      */
-    @GetMapping("/sso/callback")
+    @GetMapping("/sso/callback/{clientId}")
     public void ssoCallback(HttpServletRequest request, HttpServletResponse response,
-                            String clientId, CookieInfo info) throws IOException{
+                            @PathVariable(required = false) String clientId, CookieInfo info, String callback) throws IOException{
         if (null != info && null != info.getMobile()) {
             AccountDTO accountDTO = null;
             Result<AccountDTO> result = accountApi.getAccount(info.getMobile());
@@ -136,7 +136,7 @@ public class AuthController {
                     accountDTO = createAccountByCookieInfo(info);
                 } else {
                     logger.error(result.getMessage());
-                    ServletErrorUtils.writeMessage(response, "successCallback({success:'0'})");
+                    ServletErrorUtils.writeJsonPMessage(response, callback, false);
                     return;
                 }
             } else {
@@ -147,7 +147,7 @@ public class AuthController {
                     Result updateResult = accountApi.update(BeanMapper.map(accountDTO, AccountUpdateDTO.class));
                     if (!updateResult.isSuccess()) {
                         logger.error(updateResult.getMessage());
-                        ServletErrorUtils.writeMessage(response, "successCallback({success:'0'})");
+                        ServletErrorUtils.writeJsonPMessage(response, callback, false);
                         return;
                     }
                 }
@@ -169,7 +169,7 @@ public class AuthController {
                 TokenDTO tokenDTO = BeanMapper.map(jwtToken, TokenDTO.class);
                 socketMessageApi.sendToClient(clientId, JsonUtils.toJsonString(new AuthDTO(tokenDTO, accountDTO)));
             }
-            ServletErrorUtils.writeMessage(response, "successCallback({success:'1'})");
+            ServletErrorUtils.writeJsonPMessage(response, callback, true);
         }
     }
 

+ 1 - 1
base-servers/gateway-server/src/main/resources/application.yml

@@ -179,7 +179,7 @@ auth:
   public-key: auth/pub.key
   ignores:
     - /api/auth/authorize
-    - /api/auth/sso/callback
+    - /api/auth/sso/callback/**
     - /api/account/account/register
     - /api/auth/info
     - /ws/**

+ 1 - 1
framework/server-starter/src/main/java/com/usoftchina/saas/server/ServerAutoConfiguration.java

@@ -38,7 +38,7 @@ public class ServerAutoConfiguration {
 //                }
 //                logger.error(ServletErrorUtils.buildMessage(request, cause), cause);
 //                try {
-//                    ServletErrorUtils.writerErrorResult(response, cause);
+//                    ServletErrorUtils.writeErrorResult(response, cause);
 //                } catch (IOException ex) {
 //                }
 //                return null;

+ 30 - 1
framework/server-starter/src/main/java/com/usoftchina/saas/server/error/ServletErrorUtils.java

@@ -43,10 +43,39 @@ public class ServletErrorUtils {
      * @throws IOException
      * @throws ServletException
      */
-    public static void writerErrorResult(HttpServletResponse response, Throwable e) throws IOException {
+    public static void writeErrorResult(HttpServletResponse response, Throwable e) throws IOException {
         response.setContentType(MediaType.APPLICATION_JSON_UTF8_VALUE);
         PrintWriter writer = response.getWriter();
         writer.print(JsonUtils.toJsonString(Result.throwable(e)));
         writer.flush();
     }
+
+    public static void writeMessage(HttpServletResponse response, String text) throws IOException {
+        response.setContentType(MediaType.TEXT_HTML_VALUE);
+        response.setCharacterEncoding("UTF-8");
+        PrintWriter writer = response.getWriter();
+        writer.print(text);
+        writer.flush();
+    }
+
+    /**
+     * 输出jsonp
+     *
+     * @param response
+     * @param callbackFn
+     * @param success
+     * @throws IOException
+     */
+    public static void writeJsonPMessage(HttpServletResponse response, String callbackFn, boolean success) throws IOException {
+        response.setContentType(MediaType.TEXT_HTML_VALUE);
+        response.setCharacterEncoding("UTF-8");
+        PrintWriter writer = response.getWriter();
+        writer.print(buildJsonPMessage(callbackFn, success));
+        writer.flush();
+    }
+
+    public static String buildJsonPMessage(String callbackFn, boolean success) {
+        return String.format("%s({success:\"%s\"})", callbackFn, success ? 1 : 0);
+    }
+
 }

+ 1 - 1
framework/server-starter/src/main/java/com/usoftchina/saas/server/error/UnCaughtErrorFilter.java

@@ -30,7 +30,7 @@ public class UnCaughtErrorFilter extends OncePerRequestFilter {
                 cause = ((NestedServletException) ex).getRootCause();
             }
             logger.error(ServletErrorUtils.buildMessage(request, cause), cause);
-            ServletErrorUtils.writerErrorResult(response, cause);
+            ServletErrorUtils.writeErrorResult(response, cause);
         }
     }
 }

+ 7 - 8
frontend/saas-portal-web/src/css/main.css

@@ -379,7 +379,7 @@ main > section {
 .ts-mintext {
     position: absolute;
     top: 142px;
-    right: 380px;
+    right: 240px;
     color: white;
 }
 .ts-mintext p {
@@ -392,8 +392,8 @@ main > section {
     margin-left: -40px;
 }
 .ts-lefttext {
-    left: 300px;
-    width: 280px;
+    left: 40px;
+    width: 560px;
 }
 .ts-textleftimg {
     width: 40px;
@@ -434,7 +434,7 @@ main > section {
 .gn-beijing {
     width: 100%;
     position: absolute;
-    top: 242px;
+    top: 247px;
 }
 .gn-img {
     width: 100px;
@@ -467,7 +467,7 @@ main > section {
     left: 0;
 }
 .gn-hei>div {
-    height: 240px;
+    height: 245px;
 }
 .service-item {
     margin-bottom: 60px;
@@ -639,16 +639,15 @@ main > section {
     color: #fff;
 }
 .footer-section .qr{
-    width: 110px;
     overflow: hidden;
     text-align: right;
+    float: right;
 }
 .footer-section .qr .qr-top{
     overflow: hidden;
 }
 .footer-section .qr .qr-code{
-    float: right;
-    width: 90px;
+    width: 110px;
     font-size: 14px;
     color: #fff;
     text-align: center;

+ 0 - 0
frontend/saas-portal-web/src/img/gongneng/ xiao shou 3@3x.png → frontend/saas-portal-web/src/img/gongneng/xiao shou 3@3x.png


+ 7 - 7
frontend/saas-portal-web/src/index.html

@@ -304,7 +304,7 @@
 								<div class="ts-mintext">
 									<p><img class="ts-textimg" src="./img/assets/xunzhao@2x.png" alt="">迅速找到您想要的</p>
 									<p>寻找供应商资源</p>
-									<p>寻找产品资料 货源</p>
+									<p>寻找产品货源  寻找产品资料</p>
 								</div>
 							</div>
 						</div>
@@ -313,8 +313,8 @@
 								<img class="ts-minimg" style="left:0;" src="./img/assets/2.png" alt="">
 								<div class="ts-mintext ts-lefttext">
 									<p>直观看到您想看的<img class="ts-textleftimg" src="./img/assets/fen xi@2x.png" alt=""></p>
-									<p>月度销售额 采购额</p>
-									<p>经营指标实时看</p>
+									<p>每日订单量、收付款、月度销售分析、采购分析</p>
+									<p>让你成为企业经营老司机</p>
 								</div>
 							</div>
 							<div style="margin:50px 0;">
@@ -327,10 +327,10 @@
 							</div>
 							<div class="right right-text">
 								<img class="ts-minimg" src="./img/assets/1.png" alt="">
-								<div class="ts-mintext" style="right: 250px;">
+								<div class="ts-mintext" style="right: 145px;">
 									<p><img class="ts-textimg" src="./img/assets/kuaisu@2x.png" alt="">快速上手 生意简单做</p>
-									<p>移动端的体验</p>
-									<p>简单的业务线 让您三分钟上手</p>
+									<p>移动端的交互体验</p>
+									<p>简短清晰的业务流程 让你三分钟上手</p>
 								</div>
 							</div>
 						</div>
@@ -583,7 +583,7 @@
 						</ul>
 					</div>
 					
-					<div class="qr" style="float:right">
+					<div class="qr">
 						<div class="qr-top">
 							<div class="qr-tech qr-code">
 								<img src="./img/qr-tech.png" alt="">