Browse Source

1.修改错误码

yuanliang 2 years ago
parent
commit
33666a0d06

+ 8 - 3
cooleshow-user/user-tenant/src/main/java/com/yonge/cooleshow/tenant/controller/open/OpenTenantController.java

@@ -11,7 +11,12 @@ import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.validation.annotation.Validated;
-import org.springframework.web.bind.annotation.*;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
 
 @Validated
 @RestController
@@ -48,12 +53,12 @@ public class OpenTenantController {
                                                   @RequestParam("code") String code) {
         // 校验验证码
         boolean validCode = smsCodeService.verifyValidCode(phone, code, "LOGIN");
-        if(!validCode){
+        if (!validCode) {
             throw new BizException("验证码错误");
         }
         TenantStaff tenantStaff = tenantStaffService.getByPhone(phone);
         if (tenantStaff == null) {
-            throw new BizException("请先申请机构入驻");
+            return HttpResponseResult.failed(5002, null, "请先申请机构入驻");
         }
         tenantStaff.setWxOpenid(openId);
         tenantStaffService.updateById(tenantStaff);