Merge branch 'master' of https://gitee.com/op-souls/ghy-all
This commit is contained in:
commit
d6fe137828
|
|
@ -6,6 +6,7 @@ import com.ghy.common.core.controller.BaseController;
|
|||
import com.ghy.common.core.domain.AjaxResult;
|
||||
import com.ghy.common.exception.ServiceException;
|
||||
import com.ghy.common.utils.ExceptionUtil;
|
||||
import com.ghy.common.utils.StringUtils;
|
||||
import com.ghy.common.utils.WxUtils;
|
||||
import com.ghy.common.utils.http.HttpUtils;
|
||||
import com.ghy.customer.domain.Customer;
|
||||
|
|
@ -111,6 +112,22 @@ public class WxController extends BaseController {
|
|||
}
|
||||
}
|
||||
|
||||
@GetMapping("/token/code")
|
||||
@ResponseBody
|
||||
public JSONObject tokenCode(HttpServletRequest request) throws IOException{
|
||||
JSONObject wxUser = WxUtils.getOpenid(request.getParameter("code"), "wx404f2439a8c24e15", "49ade04a817067fe2d65ab2f17afce75");
|
||||
String openId = wxUser.getString("openid");
|
||||
if(StringUtils.isNotEmpty(openId)){
|
||||
String questionUrl = "https://www.opsoul.com:8883/exam/question/details/list/";
|
||||
JSONObject result = new JSONObject();
|
||||
result.put("data", HttpUtils.sendGet(questionUrl + openId));
|
||||
result.put("openid", openId);
|
||||
return result;
|
||||
}else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@GetMapping("/auth/phone")
|
||||
@ResponseBody
|
||||
public AjaxResult authPhone(HttpServletRequest request){
|
||||
|
|
@ -155,7 +172,7 @@ public class WxController extends BaseController {
|
|||
@ResponseBody
|
||||
public String openId(HttpServletRequest request) throws Exception {
|
||||
String code = request.getParameter("code");
|
||||
JSONObject wxUser = WxUtils.getOpenid(code, wxConfig.getAppId(), wxConfig.getSecret());
|
||||
JSONObject wxUser = WxUtils.getOpenid(code, "wx404f2439a8c24e15", "49ade04a817067fe2d65ab2f17afce75");
|
||||
return wxUser.getString("openid");
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -64,9 +64,9 @@ spring:
|
|||
servlet:
|
||||
multipart:
|
||||
# 单个文件大小
|
||||
max-file-size: 50MB
|
||||
max-file-size: 200MB
|
||||
# 设置总上传的文件大小
|
||||
max-request-size: 100MB
|
||||
max-request-size: 200MB
|
||||
# 服务模块
|
||||
devtools:
|
||||
restart:
|
||||
|
|
|
|||
Loading…
Reference in New Issue