Commit ad86dc4a by 袁伟铭

1.0.0

parent e67bc01a
......@@ -9,9 +9,7 @@ import com.zq.api.form.ApiForm;
import com.zq.api.form.ApiResp;
import com.zq.api.service.ApiService;
import com.zq.api.utils.ApiUtils;
import com.zq.common.config.security.ApiTokenUtils;
import com.zq.common.utils.ThrowableUtil;
import com.zq.common.vo.ApiTokenVo;
import com.zq.common.vo.ResultVo;
import feign.FeignException;
import io.swagger.annotations.Api;
......@@ -22,7 +20,6 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest;
import java.util.Arrays;
@Api(tags = "API接口")
@Slf4j
......@@ -34,11 +31,6 @@ public class ApiController {
private final ApiService apiService;
/**
* 允许用户未登录状态下执行的方法名
*/
private final String[] allowMethod = {"sendCode"};
/**
* 获取信息入口
* <p>
* 2016年10月3日 下午1:38:27
......@@ -64,24 +56,6 @@ public class ApiController {
form.setMethod(method);
}
if (StrUtil.isBlank(form.getToken())) {
boolean contains = Arrays.asList(allowMethod).contains(method);
if (!contains) {
return ApiUtils.getLoginValidError(form);
}
}
ApiTokenVo tokenVo = ApiTokenUtils.getAppTokenVo(form.getToken());
if (tokenVo == null) {
boolean contains = Arrays.asList(allowMethod).contains(method);
if (!contains) {
return ApiUtils.getLoginValidError(form);
}
} else {
form.setUserId(String.valueOf(tokenVo.getUserId()));
form.setApiTokenVo(tokenVo);
}
String stackTrace = "";
// 调用接口方法
ApiResp resp;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment