|
|
@@ -1,8 +1,8 @@
|
|
|
package space.anyi.openapi.controller;
|
|
|
|
|
|
-import cn.hutool.crypto.digest.MD5;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
import space.anyi.openAPI.comom.model.User;
|
|
|
+
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
import java.nio.charset.StandardCharsets;
|
|
|
@@ -69,14 +69,14 @@ public class UserController {
|
|
|
String ACCESS_KEY = data[0];
|
|
|
String SECRET_KEY = data[1];
|
|
|
//校验accessKey
|
|
|
- if (!ACCESS_KEY.equals(accessKey)) {
|
|
|
- return "accessKey错误";
|
|
|
- }
|
|
|
+ //if (!ACCESS_KEY.equals(accessKey)) {
|
|
|
+ // return "accessKey错误";
|
|
|
+ //}
|
|
|
//todo:校验timestamp,时间误差不超过1minute
|
|
|
//校验sign
|
|
|
- if (!MD5.create().digestHex16(SECRET_KEY+timestamp+SECRET_KEY).equals(sign)) {
|
|
|
- return "secretKey错误";
|
|
|
- }
|
|
|
+ //if (!MD5.create().digestHex16(SECRET_KEY+timestamp+SECRET_KEY).equals(sign)) {
|
|
|
+ // return "secretKey错误";
|
|
|
+ //}
|
|
|
//todo:校验nonce防止重放攻击
|
|
|
String username = user.getName();
|
|
|
System.out.println(username);
|