| | |
| | | import com.ruoyi.framework.security.RegisterBody; |
| | | import com.ruoyi.framework.security.service.SysRegisterService; |
| | | import com.ruoyi.framework.web.controller.BaseController; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.project.system.service.ISysConfigService; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | |
| | | private ISysConfigService configService; |
| | | |
| | | @PostMapping("/register") |
| | | public R<?> register(@RequestBody RegisterBody user) { |
| | | public AjaxResult register(@RequestBody RegisterBody user) { |
| | | if (!("true".equals(configService.selectConfigByKey("sys.account.registerUser")))) { |
| | | return R.fail("当前系统没有开启注册功能!"); |
| | | return error("当前系统没有开启注册功能!"); |
| | | } |
| | | String msg = registerService.register(user); |
| | | return StringUtils.isEmpty(msg) ? R.ok() : R.fail(msg); |
| | | return StringUtils.isEmpty(msg) ? success() : error(msg); |
| | | } |
| | | } |