|
|
@@ -33,7 +33,6 @@ import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
-import javax.servlet.http.Cookie;
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
import java.io.IOException;
|
|
|
@@ -219,8 +218,8 @@ public class AuthController {
|
|
|
* @param info
|
|
|
* @return
|
|
|
*/
|
|
|
- @GetMapping(value = "/sso/callback/{clientId}", produces = {"application/javascript"})
|
|
|
- public String ssoCallback(HttpServletRequest request, HttpServletResponse response,
|
|
|
+ @GetMapping("/sso/callback/{clientId}")
|
|
|
+ public void 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;
|
|
|
@@ -231,8 +230,8 @@ public class AuthController {
|
|
|
accountDTO = createAccountByCookieInfo(info);
|
|
|
} else {
|
|
|
logger.error(result.getMessage());
|
|
|
- //ServletUtils.writeJsonPMessage(response, callback, false);
|
|
|
- return "successCallback({success:'0'})";
|
|
|
+ ServletUtils.writeJsonPMessage(response, callback, false);
|
|
|
+ return;
|
|
|
}
|
|
|
} else {
|
|
|
accountDTO = result.getData();
|
|
|
@@ -242,8 +241,8 @@ public class AuthController {
|
|
|
Result updateResult = accountApi.update(BeanMapper.map(accountDTO, AccountUpdateDTO.class));
|
|
|
if (!updateResult.isSuccess()) {
|
|
|
logger.error(updateResult.getMessage());
|
|
|
- //ServletUtils.writeJsonPMessage(response, callback, false);
|
|
|
- return "successCallback({success:'0'})";
|
|
|
+ ServletUtils.writeJsonPMessage(response, callback, false);
|
|
|
+ return;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -265,10 +264,8 @@ public class AuthController {
|
|
|
socketMessageApi.sendToClient(clientId, "/sso/callback",
|
|
|
JsonUtils.toJsonString(new AuthDTO(tokenDTO, accountDTO)));
|
|
|
}
|
|
|
- //ServletUtils.writeJsonPMessage(response, callback, true);
|
|
|
- return "successCallback({success:'1'})";
|
|
|
+ ServletUtils.writeJsonPMessage(response, callback, true);
|
|
|
}
|
|
|
- return "successCallback({success:'0'})";
|
|
|
}
|
|
|
|
|
|
/**
|