Commit 9996c05c authored by jiaorz's avatar jiaorz

验证码图片问题

parent 597862ec
...@@ -5,22 +5,14 @@ import com.github.wxiaoqi.security.auth.service.AuthService; ...@@ -5,22 +5,14 @@ import com.github.wxiaoqi.security.auth.service.AuthService;
import com.github.wxiaoqi.security.auth.util.user.JwtAuthenticationRequest; import com.github.wxiaoqi.security.auth.util.user.JwtAuthenticationRequest;
import com.github.wxiaoqi.security.common.constant.RequestTypeConstants; import com.github.wxiaoqi.security.common.constant.RequestTypeConstants;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse; import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.github.wxiaoqi.security.common.util.ClientUtil;
import com.github.wxiaoqi.security.common.util.EntityUtils;
import com.github.wxiaoqi.security.common.util.IpUtil;
import com.github.wxiaoqi.security.common.util.process.ResultCode; import com.github.wxiaoqi.security.common.util.process.ResultCode;
import com.github.wxiaoqi.security.common.util.result.JsonResultUtil; import com.github.wxiaoqi.security.common.util.result.JsonResultUtil;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.springframework.web.context.request.RequestAttributes;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import java.util.Map; import java.util.Map;
...@@ -83,9 +75,9 @@ public class AuthController { ...@@ -83,9 +75,9 @@ public class AuthController {
return new ObjectRestResponse<>(); return new ObjectRestResponse<>();
} }
@RequestMapping(value = "/sendsms", method = RequestMethod.POST) @RequestMapping(value = "/sendsms", method = RequestMethod.POST)
public JSONObject sendsms(@RequestParam(value="username",defaultValue="")String username, @RequestParam(value="type",defaultValue="0")Integer type)throws Exception{ public JSONObject sendsms(@RequestParam(value="username",defaultValue="")String username, @RequestParam(value="type",defaultValue="0")Integer type, String pointList)throws Exception{
log.info(username+"----require sendsms..."); log.info(username+"----require sendsms...");
return appAuthService.sendsms(username,type); return appAuthService.sendsms(username,type,pointList);
} }
@RequestMapping(value = "/register", method = RequestMethod.POST) @RequestMapping(value = "/register", method = RequestMethod.POST)
public JSONObject register(@RequestParam(value="username",defaultValue="")String username, public JSONObject register(@RequestParam(value="username",defaultValue="")String username,
...@@ -178,7 +170,7 @@ public class AuthController { ...@@ -178,7 +170,7 @@ public class AuthController {
@RequestMapping(value = "other/sendsms", method = RequestMethod.GET) @RequestMapping(value = "other/sendsms", method = RequestMethod.GET)
public JSONObject otherSendsms(@RequestParam(value="username",defaultValue="")String username, @RequestParam(value="type",defaultValue="0")Integer type)throws Exception{ public JSONObject otherSendsms(@RequestParam(value="username",defaultValue="")String username, @RequestParam(value="type",defaultValue="0")Integer type)throws Exception{
log.info(username+"----require sendsms..."); log.info(username+"----require sendsms...");
return appAuthService.sendsms(username,type); return appAuthService.sendsms(username,type, "");
} }
@RequestMapping(value = "/otherLogin", method = RequestMethod.POST) @RequestMapping(value = "/otherLogin", method = RequestMethod.POST)
......
...@@ -29,7 +29,7 @@ public interface IUserService { ...@@ -29,7 +29,7 @@ public interface IUserService {
AppUserInfo AppValidate(@RequestBody JwtAuthenticationRequest authenticationRequest); AppUserInfo AppValidate(@RequestBody JwtAuthenticationRequest authenticationRequest);
@RequestMapping(value = "/api/app/user/sendsms", method = RequestMethod.POST) @RequestMapping(value = "/api/app/user/sendsms", method = RequestMethod.POST)
public JSONObject sendsms(@RequestParam(value="username",defaultValue="")String username, @RequestParam(value="type",defaultValue="0")Integer type); public JSONObject sendsms(@RequestParam(value="username",defaultValue="")String username, @RequestParam(value="type",defaultValue="0")Integer type, @RequestParam(value="pointList")String pointList);
@RequestMapping(value = "/api/app/user/register", method = RequestMethod.POST) @RequestMapping(value = "/api/app/user/register", method = RequestMethod.POST)
public JSONObject register( @RequestParam(value="username",defaultValue="")String username, public JSONObject register( @RequestParam(value="username",defaultValue="")String username,
@RequestParam(value="mobilecode",defaultValue="")String mobilecode, @RequestParam(value="mobilecode",defaultValue="")String mobilecode,
......
...@@ -4,16 +4,13 @@ package com.github.wxiaoqi.security.auth.service; ...@@ -4,16 +4,13 @@ package com.github.wxiaoqi.security.auth.service;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.github.wxiaoqi.security.auth.util.user.JwtAuthenticationRequest; import com.github.wxiaoqi.security.auth.util.user.JwtAuthenticationRequest;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse; import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import org.springframework.web.bind.annotation.RequestParam;
import javax.servlet.http.HttpServletRequest;
public interface AuthService { public interface AuthService {
String login(JwtAuthenticationRequest authenticationRequest) throws Exception; String login(JwtAuthenticationRequest authenticationRequest) throws Exception;
ObjectRestResponse loginSmall(JwtAuthenticationRequest authenticationRequest) throws Exception; ObjectRestResponse loginSmall(JwtAuthenticationRequest authenticationRequest) throws Exception;
String refresh(String oldToken) throws Exception; String refresh(String oldToken) throws Exception;
void validate(String token) throws Exception; void validate(String token) throws Exception;
JSONObject sendsms(String username, Integer type) throws Exception; JSONObject sendsms(String username, Integer type, String pointList) throws Exception;
JSONObject register(String username, String mobilecode, String password,String code) throws Exception; JSONObject register(String username, String mobilecode, String password,String code) throws Exception;
JSONObject wxregister( String username, String mobilecode, String password, String nickname, String headimgurl, String openid, String unionid, Integer type,Integer isQQ,String code) throws Exception; JSONObject wxregister( String username, String mobilecode, String password, String nickname, String headimgurl, String openid, String unionid, Integer type,Integer isQQ,String code) throws Exception;
JSONObject checkBindWechat(String username) throws Exception; JSONObject checkBindWechat(String username) throws Exception;
......
...@@ -13,14 +13,11 @@ import com.github.wxiaoqi.security.common.constant.RequestTypeConstants; ...@@ -13,14 +13,11 @@ import com.github.wxiaoqi.security.common.constant.RequestTypeConstants;
import com.github.wxiaoqi.security.common.exception.auth.UserInvalidException; import com.github.wxiaoqi.security.common.exception.auth.UserInvalidException;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse; import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.github.wxiaoqi.security.common.util.process.ResultCode; import com.github.wxiaoqi.security.common.util.process.ResultCode;
import io.swagger.models.auth.In;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils; import org.springframework.util.StringUtils;
import javax.servlet.http.HttpServletRequest;
/** /**
* @author keliii * @author keliii
*/ */
...@@ -69,8 +66,8 @@ public class AppAuthServiceImpl implements AuthService { ...@@ -69,8 +66,8 @@ public class AppAuthServiceImpl implements AuthService {
jwtTokenUtil.getInfoFromToken(token); jwtTokenUtil.getInfoFromToken(token);
} }
@Override @Override
public JSONObject sendsms(String username, Integer type) throws Exception { public JSONObject sendsms(String username, Integer type, String pointList) throws Exception {
return userService.sendsms(username,type); return userService.sendsms(username,type,pointList);
} }
@Override @Override
......
...@@ -71,7 +71,7 @@ public class AppUserRest { ...@@ -71,7 +71,7 @@ public class AppUserRest {
*/ */
@RequestMapping(value = "/user/sendsms", method = RequestMethod.POST) @RequestMapping(value = "/user/sendsms", method = RequestMethod.POST)
public @ResponseBody public @ResponseBody
JSONObject sendsms(@RequestParam(value="username",defaultValue="")String username, @RequestParam(value="type",defaultValue="0")Integer type, String pointList){ JSONObject sendsms(@RequestParam(value="username",defaultValue="")String username, @RequestParam(value="type",defaultValue="0")Integer type, @RequestParam(value="pointList")String pointList){
return appPermissionService.sendSMS(username,type, pointList); return appPermissionService.sendSMS(username,type, pointList);
} }
......
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