|
@@ -21,6 +21,8 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
+import javax.servlet.http.HttpServletRequest;
|
|
|
+import javax.servlet.http.HttpServletResponse;
|
|
|
import java.lang.reflect.Method;
|
|
|
import java.util.*;
|
|
|
import java.util.stream.Collectors;
|
|
@@ -94,7 +96,7 @@ public class ActivityApiController {
|
|
|
@ApiImplicitParams({
|
|
|
@ApiImplicitParam(name = "id", value = "活动ID", required = true, paramType = "form")
|
|
|
})
|
|
|
- public MessageResult<ActivityInfo> detail(String id, String token){
|
|
|
+ public MessageResult<ActivityInfo> detail(String id,HttpServletRequest request){
|
|
|
MessageResult<ActivityInfo> msgResult = new MessageResult<>();
|
|
|
|
|
|
try{
|
|
@@ -103,6 +105,16 @@ public class ActivityApiController {
|
|
|
throw new Exception("未找到活动!");
|
|
|
}
|
|
|
|
|
|
+ String token = request.getHeader("Authorization");
|
|
|
+
|
|
|
+ if (org.springframework.util.StringUtils.isEmpty(token)){
|
|
|
+ token = (String)request.getSession().getAttribute("token");
|
|
|
+ }
|
|
|
+
|
|
|
+ if (org.springframework.util.StringUtils.isEmpty(token)) {
|
|
|
+ token = request.getParameter("token");
|
|
|
+ }
|
|
|
+
|
|
|
if (StringUtils.isNotEmpty(token)){
|
|
|
String memberId = JwtUtil.decodeToken(jwtSecret,token);
|
|
|
if(StringUtils.isNotEmpty(memberId)){
|