Merge branch 'main' of https://dd3skj.picp.vip/zhaoxinyu/hmc_gbhd
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
package com.budwk.app.client.auth.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckLogin;
|
||||
import cn.dev33.satoken.stp.StpUtil;
|
||||
import com.budwk.app.base.constant.RedisConstant;
|
||||
import com.budwk.app.base.exception.BaseException;
|
||||
@@ -72,6 +73,9 @@ public class ClientAuthController {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 发送短信验证码
|
||||
*/
|
||||
@At("/send-sms-code/?")
|
||||
@Ok("json")
|
||||
public Object sendSmsCode(String phone) {
|
||||
@@ -83,4 +87,16 @@ public class ClientAuthController {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 退出登录
|
||||
*/
|
||||
@At("/logout")
|
||||
@Ok("json")
|
||||
@SaCheckLogin(type = StpClientUtil.TYPE)
|
||||
public Result logout() {
|
||||
StpClientUtil.STP.logout();
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
+23
@@ -5,6 +5,8 @@ import com.budwk.app.base.page.PageForm;
|
||||
import com.budwk.app.base.page.Pagination;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.client.module.activity.service.ClientActivityService;
|
||||
import com.budwk.app.client.module.activity.vo.ClientActivitySignVO;
|
||||
import com.budwk.app.module.activity.models.Activity;
|
||||
import com.budwk.app.web.commons.auth.satoken.StpClientUtil;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Sqls;
|
||||
@@ -14,6 +16,7 @@ import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.mvc.adaptor.JsonAdaptor;
|
||||
import org.nutz.mvc.annotation.AdaptBy;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.GET;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
|
||||
@IocBean
|
||||
@@ -48,4 +51,24 @@ public class ClientActivityController {
|
||||
return Result.success(pagination);
|
||||
}
|
||||
|
||||
@At("/get/?")
|
||||
@GET
|
||||
@SaCheckLogin(type = StpClientUtil.TYPE)
|
||||
public Result get(Long id) {
|
||||
Activity activity = clientActivityService.fetch(id);
|
||||
clientActivityService.fetchLinks(activity, "items");
|
||||
return Result.success(activity);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 报名
|
||||
*/
|
||||
@At("/sign")
|
||||
@AdaptBy(type = JsonAdaptor.class)
|
||||
@SaCheckLogin(type = StpClientUtil.TYPE)
|
||||
public Result sign(ClientActivitySignVO signVO) {
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
package com.budwk.app.client.module.activity.vo;
|
||||
|
||||
import com.budwk.app.module.activity.models.ActUser;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 报名
|
||||
*/
|
||||
public class ClientActivitySignVO {
|
||||
|
||||
private String activityId;
|
||||
|
||||
private String unitName;
|
||||
|
||||
private String contactName;
|
||||
|
||||
private String contactPhone;
|
||||
|
||||
private List<ActUser> userList;
|
||||
|
||||
}
|
||||
@@ -48,7 +48,7 @@ public class ValidateService {
|
||||
String text = R.captchaNumber(6);
|
||||
String codeFromRedis = redisService.get(RedisConstant.UCENTER_SMSCODE + mobile + ":LOCK");
|
||||
if (Strings.isNotBlank(codeFromRedis)) {
|
||||
throw new BaseException("请1分钟之后再试");
|
||||
// throw new BaseException("请1分钟之后再试");
|
||||
}
|
||||
ThreadUtil.execute(()->{
|
||||
smsSendServer.sendMsg(mobile, "验证码为:"+text);
|
||||
|
||||
@@ -7,6 +7,7 @@ import com.budwk.app.base.exception.BaseException;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.base.result.ResultCode;
|
||||
import com.budwk.app.base.utils.WebUtil;
|
||||
import com.budwk.app.web.commons.auth.satoken.StpClientUtil;
|
||||
import org.nutz.castor.FailToCastObjectException;
|
||||
import org.nutz.dao.DaoException;
|
||||
import org.nutz.ioc.IocException;
|
||||
@@ -66,7 +67,8 @@ public class WkFailProcessor extends ViewProcessor {
|
||||
new ForwardView(errorUri).render(ac.getRequest(), ac.getResponse(), null);
|
||||
}
|
||||
return;
|
||||
} else if (e instanceof NotLoginException) { // 如果是未登录异常
|
||||
} else if (e instanceof NotLoginException) {
|
||||
// 如果是未登录异常
|
||||
if (WebUtil.isAjax(ac.getRequest())) {
|
||||
WebUtil.rendAjaxResp(ac.getRequest(), ac.getResponse(), Result.error(ResultCode.USER_NOT_LOGIN.getCode(), ResultCode.USER_NOT_LOGIN.getMsg()));
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user