main
parent
741a6fb734
commit
04e6dd3e26
|
|
@ -48,11 +48,20 @@ public class TokenService
|
|||
public Map<String, Object> createToken(LoginUser loginUser)
|
||||
{
|
||||
String token = IdUtils.fastUUID();
|
||||
Long userId = loginUser.getSysUser().getUserId();
|
||||
String userName = loginUser.getSysUser().getUserName();
|
||||
Long userId = 0L;
|
||||
String userName = null;
|
||||
if (loginUser.getSysUser()== null){
|
||||
userId = loginUser.getUserid();
|
||||
userName = loginUser.getUsername();
|
||||
}else{
|
||||
userId = loginUser.getSysUser().getUserId();
|
||||
userName = loginUser.getSysUser().getUserName();
|
||||
}
|
||||
//
|
||||
// String userName = loginUser.getSysUser().getUserName();
|
||||
loginUser.setToken(token);
|
||||
loginUser.setUserid(userId);
|
||||
loginUser.setUsername(userName);
|
||||
// loginUser.setUsername(userName);
|
||||
loginUser.setIpaddr(IpUtils.getIpAddr());
|
||||
refreshToken(loginUser);
|
||||
|
||||
|
|
|
|||
|
|
@ -42,6 +42,10 @@
|
|||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-actuator</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-openfeign</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- Swagger UI -->
|
||||
<dependency>
|
||||
|
|
|
|||
|
|
@ -1,26 +1,101 @@
|
|||
package com.ruoyi.app.controller;
|
||||
|
||||
|
||||
import com.ruoyi.app.domain.AppRegister;
|
||||
import com.ruoyi.app.domain.AppUser;
|
||||
import com.ruoyi.app.form.LoginForm;
|
||||
import com.ruoyi.app.form.RegisterForm;
|
||||
import com.ruoyi.app.service.IAppRegisterService;
|
||||
import com.ruoyi.app.service.IAppUserService;
|
||||
import com.ruoyi.common.core.domain.R;
|
||||
import com.ruoyi.common.core.utils.ip.IpUtils;
|
||||
import com.ruoyi.common.core.utils.uuid.IdUtils;
|
||||
import com.ruoyi.common.redis.service.RedisService;
|
||||
import com.ruoyi.common.security.service.TokenService;
|
||||
import com.ruoyi.system.api.model.LoginUser;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.util.Assert;
|
||||
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.RestController;
|
||||
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/api/app")
|
||||
@RequestMapping("/app")
|
||||
@Api(
|
||||
tags = "APP-登录接口"
|
||||
)
|
||||
public class AppLoginController {
|
||||
|
||||
@Autowired
|
||||
private IAppUserService appUserService;
|
||||
|
||||
@Autowired
|
||||
private IAppRegisterService appRegisterService;
|
||||
|
||||
@Autowired
|
||||
private RedisService redisService;
|
||||
|
||||
@Autowired
|
||||
private TokenService tokenService;
|
||||
|
||||
@PostMapping("/register")
|
||||
@ApiOperation(value = "注册" , notes = "注册")
|
||||
public R<?> register(@RequestBody RegisterForm registerForm) {
|
||||
AppUser appUser = appUserService.selectAppUserByPhone(registerForm.getPhoneNumber());
|
||||
Assert.notNull(registerForm.getSchoolId(), "学校id不能为空");
|
||||
Assert.isNull(appUser, "手机号已注册");
|
||||
AppRegister appRegister = setAppRegister(registerForm);
|
||||
appRegister.setInvitationCode(registerForm.getInvitationCode());
|
||||
int i = appRegisterService.insertAppRegister(appRegister);
|
||||
redisService.deleteObject(registerForm.getPhoneNumber());
|
||||
Assert.isTrue(i > 0, "注册失败");
|
||||
return R.ok(null,"注册成功,请等待审核结果!");
|
||||
}
|
||||
|
||||
@PostMapping("/login")
|
||||
@ApiOperation(value = "登录" , notes = "登录")
|
||||
public R<?> login(@RequestBody LoginForm loginForm) {
|
||||
AppUser appUser = appUserService.selectAppUserByPhone(loginForm.getPhoneNumber());
|
||||
Assert.notNull(appUser, "手机号未注册");
|
||||
Object cacheObject = redisService.getCacheObject(loginForm.getPhoneNumber());
|
||||
if (cacheObject != null) {
|
||||
String code = (String) cacheObject;
|
||||
Assert.isTrue(code.equals(loginForm.getCode()), "验证码错误");
|
||||
}
|
||||
String token = IdUtils.fastUUID();
|
||||
LoginUser loginUser = new LoginUser();
|
||||
loginUser.setUsername(appUser.getUsername());
|
||||
Long userId = appUser.getId();
|
||||
String userName = loginUser.getUsername();
|
||||
loginUser.setToken(token);
|
||||
loginUser.setUserid(userId);
|
||||
loginUser.setUsername(userName);
|
||||
loginUser.setIpaddr(IpUtils.getIpAddr());
|
||||
loginUser.setExpireTime(43200L);
|
||||
return R.ok(tokenService.createToken(loginUser));
|
||||
}
|
||||
|
||||
private static AppRegister setAppRegister(RegisterForm registerForm) {
|
||||
AppRegister appRegister = new AppRegister();
|
||||
appRegister.setPhone(registerForm.getPhoneNumber());
|
||||
appRegister.setUsername(registerForm.getUsername());
|
||||
appRegister.setProve(registerForm.getProve());
|
||||
appRegister.setAvatarUrl(registerForm.getAvatarUrl());
|
||||
appRegister.setSex(registerForm.getSex());
|
||||
appRegister.setAddress(registerForm.getAddress());
|
||||
appRegister.setSchoolId(registerForm.getSchoolId());
|
||||
appRegister.setEmail(registerForm.getEmail());
|
||||
appRegister.setInvitationCode(registerForm.getInvitationCode());
|
||||
appRegister.setStatus(0);
|
||||
return appRegister;
|
||||
}
|
||||
|
||||
|
||||
// @PostMapping("/register")
|
||||
// @ApiOperation(value = "注册" , notes = "注册")
|
||||
// public void register(RegisterForm registerForm) {
|
||||
//
|
||||
//
|
||||
// }
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,110 @@
|
|||
package com.ruoyi.app.controller;
|
||||
|
||||
import java.util.List;
|
||||
import java.io.IOException;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.ruoyi.app.domain.vo.AppRegisterVo;
|
||||
import io.swagger.annotations.Api;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.ruoyi.common.log.annotation.Log;
|
||||
import com.ruoyi.common.log.enums.BusinessType;
|
||||
import com.ruoyi.common.security.annotation.RequiresPermissions;
|
||||
import com.ruoyi.app.domain.AppRegister;
|
||||
import com.ruoyi.app.service.IAppRegisterService;
|
||||
import com.ruoyi.common.core.web.controller.BaseController;
|
||||
import com.ruoyi.common.core.web.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.common.core.web.page.TableDataInfo;
|
||||
import springfox.documentation.annotations.ApiIgnore;
|
||||
|
||||
/**
|
||||
* 注册审核Controller
|
||||
*
|
||||
* @author wyh
|
||||
* @date 2024-04-23
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/register")
|
||||
@ApiIgnore
|
||||
public class AppRegisterController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IAppRegisterService appRegisterService;
|
||||
|
||||
/**
|
||||
* 查询注册审核列表
|
||||
*/
|
||||
@RequiresPermissions("app:register:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(AppRegister appRegister)
|
||||
{
|
||||
startPage();
|
||||
List<AppRegisterVo> list = appRegisterService.selectAppRegisterList(appRegister);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
// /**
|
||||
// * 导出注册审核列表
|
||||
// */
|
||||
// @RequiresPermissions("app:register:export")
|
||||
// @Log(title = "注册审核", businessType = BusinessType.EXPORT)
|
||||
// @PostMapping("/export")
|
||||
// public void export(HttpServletResponse response, AppRegister appRegister)
|
||||
// {
|
||||
// List<AppRegister> list = appRegisterService.selectAppRegisterList(appRegister);
|
||||
// ExcelUtil<AppRegister> util = new ExcelUtil<AppRegister>(AppRegister.class);
|
||||
// util.exportExcel(response, list, "注册审核数据");
|
||||
// }
|
||||
|
||||
/**
|
||||
* 获取注册审核详细信息
|
||||
*/
|
||||
@RequiresPermissions("app:register:query")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return success(appRegisterService.selectAppRegisterById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增注册审核
|
||||
*/
|
||||
@RequiresPermissions("app:register:add")
|
||||
@Log(title = "注册审核", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody AppRegister appRegister)
|
||||
{
|
||||
return toAjax(appRegisterService.insertAppRegister(appRegister));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改注册审核
|
||||
*/
|
||||
@RequiresPermissions("app:register:edit")
|
||||
@Log(title = "注册审核", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody AppRegister appRegister)
|
||||
{
|
||||
return toAjax(appRegisterService.updateAppRegister(appRegister));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除注册审核
|
||||
*/
|
||||
@RequiresPermissions("app:register:remove")
|
||||
@Log(title = "注册审核", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(appRegisterService.deleteAppRegisterByIds(ids));
|
||||
}
|
||||
}
|
||||
|
|
@ -25,7 +25,7 @@ import com.ruoyi.common.core.web.page.TableDataInfo;
|
|||
* @date 2024-04-18
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/api/school")
|
||||
@RequestMapping("/school")
|
||||
@Api(tags = "学校配置" , description = "学校配置")
|
||||
public class AppSchoolController extends BaseController
|
||||
{
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ public class PhoneCodeController {
|
|||
|
||||
@GetMapping(value = "/send")
|
||||
@ApiOperation(value = "发送短信验证码", notes = "发送短信验证码", httpMethod = "GET")
|
||||
public AjaxResult sendCode(@RequestParam("phoneNum") String phoneNum){
|
||||
public AjaxResult sendCode(@RequestParam("phoneNumber") String phoneNum){
|
||||
|
||||
String send = sendNoteUtil.sendNoteMessgae(phoneNum);
|
||||
|
||||
|
|
@ -43,7 +43,7 @@ public class PhoneCodeController {
|
|||
@GetMapping(value ="/check")
|
||||
|
||||
@ApiOperation(value = "验证验证码", notes = "验证验证码", httpMethod = "GET")
|
||||
public AjaxResult check(@RequestParam("phoneNum") String phoneNumber, @RequestParam("code") String code) {
|
||||
public AjaxResult check(@RequestParam("phoneNumber") String phoneNumber, @RequestParam("code") String code) {
|
||||
String verificationResults = sendNoteUtil.check(phoneNumber, code);
|
||||
if (StringUtils.isNotBlank(verificationResults)) {
|
||||
if (verificationResults.equals("OK")) {
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@ import com.ruoyi.common.core.web.controller.BaseController;
|
|||
import com.ruoyi.common.core.web.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.common.core.web.page.TableDataInfo;
|
||||
import springfox.documentation.annotations.ApiIgnore;
|
||||
|
||||
/**
|
||||
* 技能标签Controller
|
||||
|
|
@ -30,6 +31,7 @@ import com.ruoyi.common.core.web.page.TableDataInfo;
|
|||
*/
|
||||
@RestController
|
||||
@RequestMapping("/skill")
|
||||
@ApiIgnore
|
||||
public class UserSkillController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
|
|
|
|||
|
|
@ -0,0 +1,181 @@
|
|||
package com.ruoyi.app.domain;
|
||||
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.core.annotation.Excel;
|
||||
import com.ruoyi.common.core.web.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 注册审核对象 app_register
|
||||
*
|
||||
* @author wyh
|
||||
* @date 2024-04-23
|
||||
*/
|
||||
public class AppRegister extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 审核id */
|
||||
private Long id;
|
||||
|
||||
/** 手机号 */
|
||||
@Excel(name = "手机号")
|
||||
private String phone;
|
||||
|
||||
/** 用户名 */
|
||||
@Excel(name = "用户名")
|
||||
private String username;
|
||||
|
||||
/** 学校证明 */
|
||||
@Excel(name = "学校证明")
|
||||
private String prove;
|
||||
|
||||
/** 头像 */
|
||||
@Excel(name = "头像")
|
||||
private String avatarUrl;
|
||||
|
||||
/** 性别:0-男,1-女 */
|
||||
@Excel(name = "性别:0-男,1-女")
|
||||
private Integer sex;
|
||||
|
||||
/** 地址 */
|
||||
@Excel(name = "地址")
|
||||
private String address;
|
||||
|
||||
/** 学校id */
|
||||
@Excel(name = "学校id")
|
||||
private Long schoolId;
|
||||
|
||||
/** 邮箱 */
|
||||
@Excel(name = "邮箱")
|
||||
private String email;
|
||||
|
||||
/** 邀请码 */
|
||||
@Excel(name = "邀请码")
|
||||
private String invitationCode;
|
||||
/** 审核状态 */
|
||||
@Excel(name = "审核状态")
|
||||
private Integer status;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
public void setPhone(String phone)
|
||||
{
|
||||
this.phone = phone;
|
||||
}
|
||||
|
||||
public String getPhone()
|
||||
{
|
||||
return phone;
|
||||
}
|
||||
public void setUsername(String username)
|
||||
{
|
||||
this.username = username;
|
||||
}
|
||||
|
||||
public String getUsername()
|
||||
{
|
||||
return username;
|
||||
}
|
||||
public void setProve(String prove)
|
||||
{
|
||||
this.prove = prove;
|
||||
}
|
||||
|
||||
public String getProve()
|
||||
{
|
||||
return prove;
|
||||
}
|
||||
public void setAvatarUrl(String avatarUrl)
|
||||
{
|
||||
this.avatarUrl = avatarUrl;
|
||||
}
|
||||
|
||||
public String getAvatarUrl()
|
||||
{
|
||||
return avatarUrl;
|
||||
}
|
||||
public void setSex(Integer sex)
|
||||
{
|
||||
this.sex = sex;
|
||||
}
|
||||
|
||||
public Integer getSex()
|
||||
{
|
||||
return sex;
|
||||
}
|
||||
public void setAddress(String address)
|
||||
{
|
||||
this.address = address;
|
||||
}
|
||||
|
||||
public String getAddress()
|
||||
{
|
||||
return address;
|
||||
}
|
||||
public void setSchoolId(Long schoolId)
|
||||
{
|
||||
this.schoolId = schoolId;
|
||||
}
|
||||
|
||||
public Long getSchoolId()
|
||||
{
|
||||
return schoolId;
|
||||
}
|
||||
public void setEmail(String email)
|
||||
{
|
||||
this.email = email;
|
||||
}
|
||||
|
||||
public String getEmail()
|
||||
{
|
||||
return email;
|
||||
}
|
||||
|
||||
public String getInvitationCode() {
|
||||
return invitationCode;
|
||||
}
|
||||
|
||||
public void setInvitationCode(String invitationCode) {
|
||||
this.invitationCode = invitationCode;
|
||||
}
|
||||
|
||||
public void setStatus(Integer status)
|
||||
{
|
||||
this.status = status;
|
||||
}
|
||||
public Integer getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("phone", getPhone())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("remark", getRemark())
|
||||
.append("username", getUsername())
|
||||
.append("prove", getProve())
|
||||
.append("avatarUrl", getAvatarUrl())
|
||||
.append("sex", getSex())
|
||||
.append("address", getAddress())
|
||||
.append("schoolId", getSchoolId())
|
||||
.append("email", getEmail())
|
||||
.append("invitationCode", getInvitationCode()).append("status", getStatus())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
package com.ruoyi.app.domain.vo;
|
||||
|
||||
import com.ruoyi.common.core.annotation.Excel;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class AppRegisterVo {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 审核id */
|
||||
private Long id;
|
||||
|
||||
/** 手机号 */
|
||||
private String phone;
|
||||
|
||||
/** 用户名 */
|
||||
private String username;
|
||||
|
||||
/** 学校证明 */
|
||||
private String prove;
|
||||
|
||||
/** 头像 */
|
||||
private String avatarUrl;
|
||||
|
||||
/** 性别:0-男,1-女 */
|
||||
private Integer sex;
|
||||
|
||||
/** 地址 */
|
||||
private String address;
|
||||
|
||||
/** 学校id */
|
||||
private Long schoolId;
|
||||
private String schoolName;
|
||||
|
||||
/** 邮箱 */
|
||||
private String email;
|
||||
}
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
package com.ruoyi.app.form;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
@ApiModel(value = "登录表单")
|
||||
public class LoginForm {
|
||||
@ApiModelProperty(value = "手机号")
|
||||
private String phoneNumber;
|
||||
@ApiModelProperty(value = "验证码")
|
||||
private String code;
|
||||
}
|
||||
|
|
@ -0,0 +1,37 @@
|
|||
package com.ruoyi.app.form;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
@ApiModel("注册表单")
|
||||
public class RegisterForm {
|
||||
|
||||
@ApiModelProperty("邀请码")
|
||||
private String invitationCode;
|
||||
|
||||
@ApiModelProperty("手机号")
|
||||
private String phoneNumber;
|
||||
|
||||
@ApiModelProperty("头像")
|
||||
private String avatarUrl;
|
||||
|
||||
@ApiModelProperty("用户名")
|
||||
private String username;
|
||||
|
||||
@ApiModelProperty("性别:0-男,1-女")
|
||||
private Integer sex;
|
||||
|
||||
@ApiModelProperty("地址")
|
||||
private String address;
|
||||
|
||||
@ApiModelProperty("学校id")
|
||||
private Long schoolId;
|
||||
|
||||
@ApiModelProperty("邮箱")
|
||||
private String email;
|
||||
|
||||
@ApiModelProperty("学校证明")
|
||||
private String prove;
|
||||
}
|
||||
|
|
@ -0,0 +1,61 @@
|
|||
package com.ruoyi.app.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.app.domain.AppRegister;
|
||||
|
||||
/**
|
||||
* 注册审核Mapper接口
|
||||
*
|
||||
* @author wyh
|
||||
* @date 2024-04-23
|
||||
*/
|
||||
public interface AppRegisterMapper
|
||||
{
|
||||
/**
|
||||
* 查询注册审核
|
||||
*
|
||||
* @param id 注册审核主键
|
||||
* @return 注册审核
|
||||
*/
|
||||
public AppRegister selectAppRegisterById(Long id);
|
||||
|
||||
/**
|
||||
* 查询注册审核列表
|
||||
*
|
||||
* @param appRegister 注册审核
|
||||
* @return 注册审核集合
|
||||
*/
|
||||
public List<AppRegister> selectAppRegisterList(AppRegister appRegister);
|
||||
|
||||
/**
|
||||
* 新增注册审核
|
||||
*
|
||||
* @param appRegister 注册审核
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertAppRegister(AppRegister appRegister);
|
||||
|
||||
/**
|
||||
* 修改注册审核
|
||||
*
|
||||
* @param appRegister 注册审核
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateAppRegister(AppRegister appRegister);
|
||||
|
||||
/**
|
||||
* 删除注册审核
|
||||
*
|
||||
* @param id 注册审核主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteAppRegisterById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除注册审核
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteAppRegisterByIds(Long[] ids);
|
||||
}
|
||||
|
|
@ -3,6 +3,7 @@ package com.ruoyi.app.mapper;
|
|||
import java.util.List;
|
||||
import com.ruoyi.app.domain.AppUser;
|
||||
import com.ruoyi.app.domain.vo.AppUserVo;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* app用户Mapper接口
|
||||
|
|
@ -59,4 +60,6 @@ public interface AppUserMapper
|
|||
* @return 结果
|
||||
*/
|
||||
public int deleteAppUserByIds(Long[] ids);
|
||||
|
||||
AppUser selectAppUserByPhone(@Param("phoneNumber") String phoneNumber);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
package com.ruoyi.app.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.ruoyi.app.domain.AppUser;
|
||||
import com.ruoyi.app.domain.UserSkill;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -0,0 +1,62 @@
|
|||
package com.ruoyi.app.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.app.domain.AppRegister;
|
||||
import com.ruoyi.app.domain.vo.AppRegisterVo;
|
||||
|
||||
/**
|
||||
* 注册审核Service接口
|
||||
*
|
||||
* @author wyh
|
||||
* @date 2024-04-23
|
||||
*/
|
||||
public interface IAppRegisterService
|
||||
{
|
||||
/**
|
||||
* 查询注册审核
|
||||
*
|
||||
* @param id 注册审核主键
|
||||
* @return 注册审核
|
||||
*/
|
||||
public AppRegister selectAppRegisterById(Long id);
|
||||
|
||||
/**
|
||||
* 查询注册审核列表
|
||||
*
|
||||
* @param appRegister 注册审核
|
||||
* @return 注册审核集合
|
||||
*/
|
||||
public List<AppRegisterVo> selectAppRegisterList(AppRegister appRegister);
|
||||
|
||||
/**
|
||||
* 新增注册审核
|
||||
*
|
||||
* @param appRegister 注册审核
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertAppRegister(AppRegister appRegister);
|
||||
|
||||
/**
|
||||
* 修改注册审核
|
||||
*
|
||||
* @param appRegister 注册审核
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateAppRegister(AppRegister appRegister);
|
||||
|
||||
/**
|
||||
* 批量删除注册审核
|
||||
*
|
||||
* @param ids 需要删除的注册审核主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteAppRegisterByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除注册审核信息
|
||||
*
|
||||
* @param id 注册审核主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteAppRegisterById(Long id);
|
||||
}
|
||||
|
|
@ -59,4 +59,6 @@ public interface IAppUserService
|
|||
* @return 结果
|
||||
*/
|
||||
public int deleteAppUserById(Long id);
|
||||
|
||||
AppUser selectAppUserByPhone(String phoneNumber);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,116 @@
|
|||
package com.ruoyi.app.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import com.ruoyi.app.domain.AppSchool;
|
||||
import com.ruoyi.app.domain.vo.AppRegisterVo;
|
||||
import com.ruoyi.app.mapper.AppSchoolMapper;
|
||||
import com.ruoyi.common.core.utils.DateUtils;
|
||||
import com.ruoyi.common.core.utils.bean.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.app.mapper.AppRegisterMapper;
|
||||
import com.ruoyi.app.domain.AppRegister;
|
||||
import com.ruoyi.app.service.IAppRegisterService;
|
||||
|
||||
/**
|
||||
* 注册审核Service业务层处理
|
||||
*
|
||||
* @author wyh
|
||||
* @date 2024-04-23
|
||||
*/
|
||||
@Service
|
||||
public class AppRegisterServiceImpl implements IAppRegisterService
|
||||
{
|
||||
@Autowired
|
||||
private AppRegisterMapper appRegisterMapper;
|
||||
|
||||
@Autowired
|
||||
private AppSchoolMapper appSchoolMapper;
|
||||
|
||||
/**
|
||||
* 查询注册审核
|
||||
*
|
||||
* @param id 注册审核主键
|
||||
* @return 注册审核
|
||||
*/
|
||||
@Override
|
||||
public AppRegister selectAppRegisterById(Long id)
|
||||
{
|
||||
return appRegisterMapper.selectAppRegisterById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询注册审核列表
|
||||
*
|
||||
* @param appRegister 注册审核
|
||||
* @return 注册审核
|
||||
*/
|
||||
@Override
|
||||
public List<AppRegisterVo> selectAppRegisterList(AppRegister appRegister)
|
||||
{
|
||||
List<AppRegister> appRegisters = appRegisterMapper.selectAppRegisterList(appRegister);
|
||||
List<AppRegisterVo> collect = appRegisters.stream().map(register -> {
|
||||
AppRegisterVo appRegisterVo = new AppRegisterVo();
|
||||
BeanUtils.copyBeanProp(appRegisterVo, register);
|
||||
AppSchool appSchool = appSchoolMapper.selectAppSchoolById(register.getSchoolId());
|
||||
if (appSchool != null) {
|
||||
appRegisterVo.setSchoolName(appSchool.getName());
|
||||
}
|
||||
return appRegisterVo;
|
||||
|
||||
}).collect(Collectors.toList());
|
||||
return collect;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增注册审核
|
||||
*
|
||||
* @param appRegister 注册审核
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertAppRegister(AppRegister appRegister)
|
||||
{
|
||||
appRegister.setCreateTime(DateUtils.getNowDate());
|
||||
return appRegisterMapper.insertAppRegister(appRegister);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改注册审核
|
||||
*
|
||||
* @param appRegister 注册审核
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateAppRegister(AppRegister appRegister)
|
||||
{
|
||||
appRegister.setUpdateTime(DateUtils.getNowDate());
|
||||
return appRegisterMapper.updateAppRegister(appRegister);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除注册审核
|
||||
*
|
||||
* @param ids 需要删除的注册审核主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteAppRegisterByIds(Long[] ids)
|
||||
{
|
||||
return appRegisterMapper.deleteAppRegisterByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除注册审核信息
|
||||
*
|
||||
* @param id 注册审核主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteAppRegisterById(Long id)
|
||||
{
|
||||
return appRegisterMapper.deleteAppRegisterById(id);
|
||||
}
|
||||
}
|
||||
|
|
@ -122,4 +122,9 @@ public class AppUserServiceImpl implements IAppUserService
|
|||
userSkillMapper.deleteUserSkillByUserId(id);
|
||||
return appUserMapper.deleteAppUserById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AppUser selectAppUserByPhone(String phoneNumber) {
|
||||
return appUserMapper.selectAppUserByPhone(phoneNumber);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,120 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.ruoyi.app.mapper.AppRegisterMapper">
|
||||
|
||||
<resultMap type="AppRegister" id="AppRegisterResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="phone" column="phone" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="updateBy" column="updateBy" />
|
||||
<result property="remark" column="remark" />
|
||||
<result property="username" column="username" />
|
||||
<result property="prove" column="prove" />
|
||||
<result property="avatarUrl" column="avatar_url" />
|
||||
<result property="sex" column="sex" />
|
||||
<result property="address" column="address" />
|
||||
<result property="schoolId" column="school_id" />
|
||||
<result property="email" column="email" />
|
||||
<result property="invitationCode" column="invitation_code" />
|
||||
<result property="status" column="status" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectAppRegisterVo">
|
||||
select id, phone, create_time, update_time, create_by, updateBy, remark, username, prove, avatar_url, sex, address, school_id, email ,invitation_code ,status from app_register
|
||||
</sql>
|
||||
|
||||
<select id="selectAppRegisterList" parameterType="AppRegister" resultMap="AppRegisterResult">
|
||||
<include refid="selectAppRegisterVo"/>
|
||||
<where>
|
||||
<if test="phone != null and phone != ''"> and phone = #{phone}</if>
|
||||
<if test="updateBy != null and updateBy != ''"> and updateBy = #{updateBy}</if>
|
||||
<if test="username != null and username != ''"> and username like concat('%', #{username}, '%')</if>
|
||||
<if test="prove != null and prove != ''"> and prove = #{prove}</if>
|
||||
<if test="avatarUrl != null and avatarUrl != ''"> and avatar_url = #{avatarUrl}</if>
|
||||
<if test="sex != null "> and sex = #{sex}</if>
|
||||
<if test="address != null and address != ''"> and address = #{address}</if>
|
||||
<if test="schoolId != null "> and school_id = #{schoolId}</if>
|
||||
<if test="email != null and email != ''"> and email = #{email}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectAppRegisterById" parameterType="Long" resultMap="AppRegisterResult">
|
||||
<include refid="selectAppRegisterVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertAppRegister" parameterType="AppRegister" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into app_register
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="phone != null">phone,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="updateBy != null">updateBy,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
<if test="username != null">username,</if>
|
||||
<if test="prove != null">prove,</if>
|
||||
<if test="avatarUrl != null">avatar_url,</if>
|
||||
<if test="sex != null">sex,</if>
|
||||
<if test="address != null">address,</if>
|
||||
<if test="schoolId != null">school_id,</if>
|
||||
<if test="email != null">email,</if>
|
||||
<if test="invitationCode != null">invitation_code,</if>
|
||||
<if test="status != null">status,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="phone != null">#{phone},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
<if test="username != null">#{username},</if>
|
||||
<if test="prove != null">#{prove},</if>
|
||||
<if test="avatarUrl != null">#{avatarUrl},</if>
|
||||
<if test="sex != null">#{sex},</if>
|
||||
<if test="address != null">#{address},</if>
|
||||
<if test="schoolId != null">#{schoolId},</if>
|
||||
<if test="email != null">#{email},</if>
|
||||
<if test="invitationCode != null">#{invitationCode},</if>
|
||||
<if test="status != null">#{status},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateAppRegister" parameterType="AppRegister">
|
||||
update app_register
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="phone != null">phone = #{phone},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="updateBy != null">updateBy = #{updateBy},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="username != null">username = #{username},</if>
|
||||
<if test="prove != null">prove = #{prove},</if>
|
||||
<if test="avatarUrl != null">avatar_url = #{avatarUrl},</if>
|
||||
<if test="sex != null">sex = #{sex},</if>
|
||||
<if test="address != null">address = #{address},</if>
|
||||
<if test="schoolId != null">school_id = #{schoolId},</if>
|
||||
<if test="email != null">email = #{email},</if>
|
||||
<if test="invitationCode != null">invitation_code = #{invitationCode},</if>
|
||||
<if test="status != null">status = #{status},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteAppRegisterById" parameterType="Long">
|
||||
delete from app_register where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteAppRegisterByIds" parameterType="String">
|
||||
delete from app_register where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
|
|
@ -244,4 +244,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<select id="selectAppUserByPhone" resultType="com.ruoyi.app.domain.AppUser">
|
||||
<include refid="selectAppUserVo"/> where phone = #{phoneNumber}
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
@ -163,7 +163,7 @@ public class GenController extends BaseController
|
|||
/**
|
||||
* 生成代码(自定义路径)
|
||||
*/
|
||||
@RequiresPermissions("tool:gen:code")
|
||||
// @RequiresPermissions("tool:gen:code")
|
||||
@Log(title = "代码生成", businessType = BusinessType.GENCODE)
|
||||
@GetMapping("/genCode/{tableName}")
|
||||
public AjaxResult genCode(@PathVariable("tableName") String tableName)
|
||||
|
|
@ -175,7 +175,7 @@ public class GenController extends BaseController
|
|||
/**
|
||||
* 同步数据库
|
||||
*/
|
||||
@RequiresPermissions("tool:gen:edit")
|
||||
// @RequiresPermissions("tool:gen:edit")
|
||||
@Log(title = "代码生成", businessType = BusinessType.UPDATE)
|
||||
@GetMapping("/synchDb/{tableName}")
|
||||
public AjaxResult synchDb(@PathVariable("tableName") String tableName)
|
||||
|
|
@ -187,7 +187,7 @@ public class GenController extends BaseController
|
|||
/**
|
||||
* 批量生成代码
|
||||
*/
|
||||
@RequiresPermissions("tool:gen:code")
|
||||
// @RequiresPermissions("tool:gen:code")
|
||||
@Log(title = "代码生成", businessType = BusinessType.GENCODE)
|
||||
@GetMapping("/batchGenCode")
|
||||
public void batchGenCode(HttpServletResponse response, String tables) throws IOException
|
||||
|
|
|
|||
|
|
@ -0,0 +1,44 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
// 查询注册审核列表
|
||||
export function listRegister(query) {
|
||||
return request({
|
||||
url: '/app/register/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询注册审核详细
|
||||
export function getRegister(id) {
|
||||
return request({
|
||||
url: '/app/register/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增注册审核
|
||||
export function addRegister(data) {
|
||||
return request({
|
||||
url: '/app/register',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改注册审核
|
||||
export function updateRegister(data) {
|
||||
return request({
|
||||
url: '/app/register',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除注册审核
|
||||
export function delRegister(id) {
|
||||
return request({
|
||||
url: '/app/register/' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
|
@ -0,0 +1,353 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="手机号" prop="phone">
|
||||
<el-input
|
||||
v-model="queryParams.phone"
|
||||
placeholder="请输入手机号"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="更新人" prop="updateBy">
|
||||
<el-input
|
||||
v-model="queryParams.updateBy"
|
||||
placeholder="请输入更新人"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="用户名" prop="username">
|
||||
<el-input
|
||||
v-model="queryParams.username"
|
||||
placeholder="请输入用户名"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="学校证明" prop="prove">
|
||||
<el-input
|
||||
v-model="queryParams.prove"
|
||||
placeholder="请输入学校证明"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="头像" prop="avatarUrl">
|
||||
<el-input
|
||||
v-model="queryParams.avatarUrl"
|
||||
placeholder="请输入头像"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="地址" prop="address">
|
||||
<el-input
|
||||
v-model="queryParams.address"
|
||||
placeholder="请输入地址"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="学校id" prop="schoolId">
|
||||
<el-input
|
||||
v-model="queryParams.schoolId"
|
||||
placeholder="请输入学校id"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="邮箱" prop="email">
|
||||
<el-input
|
||||
v-model="queryParams.email"
|
||||
placeholder="请输入邮箱"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
@click="handleAdd"
|
||||
v-hasPermi="['app:register:add']"
|
||||
>新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
icon="el-icon-edit"
|
||||
size="mini"
|
||||
:disabled="single"
|
||||
@click="handleUpdate"
|
||||
v-hasPermi="['app:register:edit']"
|
||||
>修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
plain
|
||||
icon="el-icon-delete"
|
||||
size="mini"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete"
|
||||
v-hasPermi="['app:register:remove']"
|
||||
>删除</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="el-icon-download"
|
||||
size="mini"
|
||||
@click="handleExport"
|
||||
v-hasPermi="['app:register:export']"
|
||||
>导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="registerList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="审核id" align="center" prop="id" />
|
||||
<el-table-column label="手机号" align="center" prop="phone" />
|
||||
<el-table-column label="用户名" align="center" prop="username" />
|
||||
<el-table-column label="学校证明" align="center" prop="prove" />
|
||||
<el-table-column label="头像" align="center" prop="avatarUrl" />
|
||||
<el-table-column label="性别" align="center" prop="sex">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.sex == 0 ? '男' : scope.row.sex == 1 ? '女' : '' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="地址" align="center" prop="address" />
|
||||
<el-table-column label="学校" align="center" prop="schoolId" />
|
||||
<el-table-column label="邮箱" align="center" prop="email" />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['app:register:edit']"
|
||||
>修改</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['app:register:remove']"
|
||||
>删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<!-- 添加或修改注册审核对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="手机号" prop="phone">
|
||||
<el-input v-model="form.phone" placeholder="请输入手机号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" placeholder="请输入备注" />
|
||||
</el-form-item>
|
||||
<el-form-item label="用户名" prop="username">
|
||||
<el-input v-model="form.username" placeholder="请输入用户名" />
|
||||
</el-form-item>
|
||||
<el-form-item label="学校证明" prop="prove">
|
||||
<el-input v-model="form.prove" placeholder="请输入学校证明" />
|
||||
</el-form-item>
|
||||
<el-form-item label="头像" prop="avatarUrl">
|
||||
<el-input v-model="form.avatarUrl" placeholder="请输入头像" />
|
||||
</el-form-item>
|
||||
<el-form-item label="地址" prop="address">
|
||||
<el-input v-model="form.address" placeholder="请输入地址" />
|
||||
</el-form-item>
|
||||
<el-form-item label="学校id" prop="schoolId">
|
||||
<el-input v-model="form.schoolId" placeholder="请输入学校id" />
|
||||
</el-form-item>
|
||||
<el-form-item label="邮箱" prop="email">
|
||||
<el-input v-model="form.email" placeholder="请输入邮箱" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listRegister, getRegister, delRegister, addRegister, updateRegister } from "@/api/app/register";
|
||||
|
||||
export default {
|
||||
name: "Register",
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 注册审核表格数据
|
||||
registerList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
phone: null,
|
||||
updateBy: null,
|
||||
username: null,
|
||||
prove: null,
|
||||
avatarUrl: null,
|
||||
sex: null,
|
||||
address: null,
|
||||
schoolId: null,
|
||||
email: null
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
/** 查询注册审核列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listRegister(this.queryParams).then(response => {
|
||||
this.registerList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
id: null,
|
||||
phone: null,
|
||||
createTime: null,
|
||||
updateTime: null,
|
||||
createBy: null,
|
||||
updateBy: null,
|
||||
remark: null,
|
||||
username: null,
|
||||
prove: null,
|
||||
avatarUrl: null,
|
||||
sex: null,
|
||||
address: null,
|
||||
schoolId: null,
|
||||
email: null
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.id)
|
||||
this.single = selection.length!==1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.open = true;
|
||||
this.title = "添加注册审核";
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset();
|
||||
const id = row.id || this.ids
|
||||
getRegister(id).then(response => {
|
||||
this.form = response.data;
|
||||
this.open = true;
|
||||
this.title = "修改注册审核";
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
if (this.form.id != null) {
|
||||
updateRegister(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
} else {
|
||||
addRegister(this.form).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const ids = row.id || this.ids;
|
||||
this.$modal.confirm('是否确认删除注册审核编号为"' + ids + '"的数据项?').then(function() {
|
||||
return delRegister(ids);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {});
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('app/register/export', {
|
||||
...this.queryParams
|
||||
}, `register_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
Loading…
Reference in New Issue