|
@@ -12,6 +12,7 @@ import org.springframework.web.bind.annotation.PostMapping;
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
|
|
+import java.util.HashMap;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
import java.util.Map;
|
|
import java.util.Map;
|
|
import java.util.UUID;
|
|
import java.util.UUID;
|
|
@@ -25,14 +26,17 @@ public class KuaishouWebController {
|
|
private IKuaishouUserCookieService kuaishouUserCookieService;
|
|
private IKuaishouUserCookieService kuaishouUserCookieService;
|
|
|
|
|
|
@PostMapping(value = "/login/qr")
|
|
@PostMapping(value = "/login/qr")
|
|
- public Result<String> getQrCode() {
|
|
|
|
- Result<String> result = new Result<String>();
|
|
|
|
|
|
+ public Result<Map<String, Object>> getQrCode() {
|
|
|
|
+ Result<Map<String, Object>> result = new Result<Map<String, Object>>();
|
|
try {
|
|
try {
|
|
|
|
+ Map<String, Object> resultMap = new HashMap<>();
|
|
String requestId = UUID.randomUUID().toString();
|
|
String requestId = UUID.randomUUID().toString();
|
|
String img = kuaishouWebInterfaceService.qrLogin(requestId);
|
|
String img = kuaishouWebInterfaceService.qrLogin(requestId);
|
|
|
|
+ resultMap.put("requestId", requestId);
|
|
|
|
+ resultMap.put("qrcode", "data:image/png;base64," + img);
|
|
if (img != null) {
|
|
if (img != null) {
|
|
result.setSuccess(true);
|
|
result.setSuccess(true);
|
|
- result.setResult("data:image/png;base64," + img);
|
|
|
|
|
|
+ result.setResult(resultMap);
|
|
} else {
|
|
} else {
|
|
result.setSuccess(false);
|
|
result.setSuccess(false);
|
|
}
|
|
}
|