|
@@ -1,5 +1,6 @@
|
|
|
package com.caimei.controller;
|
|
|
|
|
|
+import com.alibaba.fastjson.JSONObject;
|
|
|
import com.caimei.model.ResponseJson;
|
|
|
import com.caimei.model.dto.BuyerUserDto;
|
|
|
import com.caimei.model.vo.BuyerUserVo;
|
|
@@ -35,12 +36,14 @@ public class LoginApi {
|
|
|
/**
|
|
|
* 小程序授权登录
|
|
|
*
|
|
|
- * @param code 小程序登录唯一凭证
|
|
|
+ * @param params {"code":"" } code小程序登录唯一凭证
|
|
|
*/
|
|
|
@ApiOperation("授权登录")
|
|
|
@PostMapping("/authorization")
|
|
|
- @ApiImplicitParam(name = "code", value = "登录凭证", required = true)
|
|
|
- public ResponseJson<BuyerUserVo> authorizationLogin(@RequestBody String code) {
|
|
|
+ //@ApiImplicitParam(name = "params", value = "code登录凭证", required = true)
|
|
|
+ public ResponseJson<BuyerUserVo> authorizationLogin(@RequestBody String params) {
|
|
|
+ JSONObject parseObject = JSONObject.parseObject(params);
|
|
|
+ String code = parseObject.getString("code");
|
|
|
if (StringUtils.isEmpty(code)) {
|
|
|
return ResponseJson.error("参数异常", null);
|
|
|
}
|
|
@@ -53,6 +56,10 @@ public class LoginApi {
|
|
|
@ApiOperation("邀请码登录")
|
|
|
@PostMapping("/invitation/code")
|
|
|
public ResponseJson<BuyerUserVo> invitationCode(@RequestBody BuyerUserDto buyerUserDto) {
|
|
|
+ if (StringUtils.isEmpty(buyerUserDto.getInvitationCode()) || StringUtils.isEmpty(buyerUserDto.getOpenid())
|
|
|
+ || StringUtils.isEmpty(buyerUserDto.getNickName())) {
|
|
|
+ return ResponseJson.error("参数异常", null);
|
|
|
+ }
|
|
|
return loginService.invitationCode(buyerUserDto);
|
|
|
}
|
|
|
}
|