diff --git a/backend/application.yaml b/backend/application.yaml deleted file mode 100644 index 1a845b5..0000000 --- a/backend/application.yaml +++ /dev/null @@ -1,158 +0,0 @@ -nutz: - application: - name: budwk-v5-mini-plus - mvc: - ignore: ^(.+[.])(jsp|png|gif|jpg|js|css|jspx|jpeg|html|mp3|mp4|ico|svg|vue)$ - exclusions: /favicon/*,/assets/*,/druid/*,/upload/* -server: - port: 9090 - host: 0.0.0.0 - -jetty: - contextPath: / - threadpool: - idleTimeout: 60000 - minThreads: 10 - maxThreads: 200 - gzip: - enable: true - page: - 403: /error/403.html - 404: /error/404.html - 500: /error/500.html - #结合ftp使用,或用nginx代理ftp路径 - #staticPath: E:/project/NutzWk/upload - #开发模式静态资源 - staticPathLocal: E:/project/company/hmc_gbhd/src/main/resources/static - -security: - tokenName: token - timeout: 36000 - # 是否允许同一账号并发登录 (为true时允许一起登录, 为false时新登录挤掉旧登录) - # 允许同一账号并发登录,则系统参数 SessionOnlyOne 有效,亦可踢人下线并多了弹框提示功能 - isConcurrent: true - # 在多人登录同一账号时,是否共用一个token (为true时所有登录共用一个token, 为false时每次登录新建一个token) - isShare: true - -redis: - host: 192.168.21.207 - port: 6379 - timeout: 2000 - max_redir: 10 - database: 10 - maxTotal: 150 - pool: - maxTotal: 150 - maxIdle: 50 - minIdle: 10 - #password: test123 - mode: - normal - #cluster - #nodes=192.168.6.31:6377,192.168.6.31:6378,192.168.6.28:6377,192.168.6.28:6378,192.168.6.34:6377,192.168.6.34:6378 - -jdbc: - url: jdbc:mysql://192.168.21.207:3306/hmc_gbhd?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true - username: root - password: root - validationQuery: select 1 - maxActive: 150 - testWhileIdle: true - connectionProperties: druid.stat.slowSqlMillis=2000 - defaultAutoCommit: true - - -xsssql: - ignore: - urls: /platform/cms/content/article/addDo,/platform/sys/app/conf/addDo,/platform/sys/app/conf/editDo - -beetl: - RESOURCE: - #本地路径,开发时设置本地路径,便于调试 - rootLocal: E:/project/company/hmc_gbhd/src/main/resources/views/ - root: views/ - DELIMITER_STATEMENT_START: '' - FT: - #用法: ${"wizzer",escape} - escape: com.budwk.app.web.commons.ext.beetl.HtmlEscapeFormat - #用法: ${10241024,filesize} - filesize: com.budwk.app.web.commons.ext.beetl.FileSizeFormat - #用法: ${"",html2txt="100"} 截取100字符 - html2txt: com.budwk.app.web.commons.ext.beetl.Html2TxtFormat - #用法: ${"",strlen="100"} 截取100字符 - strlen: com.budwk.app.web.commons.ext.beetl.StrlenFormat - -#============================================================== -#Configure Main Scheduler Properties -#============================================================== -#quartz延迟启动秒数 -quartz: - startupDelay: 10 - scheduler: - instanceName: defaultScheduler - instanceId: AUTO - #============================================================== - #Skip Check Update - #update:true - #not update:false - #============================================================== - skipUpdateCheck: true - #============================================================== - #Configure JobStore isClustered=启用集群模式 - #============================================================== - jobStore: - class: org.quartz.impl.jdbcjobstore.JobStoreTX - driverDelegateClass: org.quartz.impl.jdbcjobstore.StdJDBCDelegate - #driverDelegateClass: org.quartz.impl.jdbcjobstore.PostgreSQLDelegate - #driverDelegateClass: org.quartz.impl.jdbcjobstore.oracle.OracleDelegate - #Other delegates can see: http://www.quartz-scheduler.org/documentation/quartz-2.x/tutorials/tutorial-lesson-09.html - dataSource: myDS - tablePrefix: SYS_QRTZ_ - isClustered: false - clusterCheckinInterval: 20000 - maxMisfiresToHandleAtATime: 120 - misfireThreshold: 120000 - txIsolationLevelSerializable: false - - #============================================================== - #Configure ThreadPool - #============================================================== - threadPool: - class: org.quartz.simpl.SimpleThreadPool - threadCount: 2 - threadPriority: 5 - threadsInheritContextClassLoaderOfInitializingThread: true - - #============================================================================ - # Configure Plugins - #============================================================================ - plugin: - triggHistory: - class: org.quartz.plugins.history.LoggingJobHistoryPlugin - shutdownhook: - class: org.quartz.plugins.management.ShutdownHookPlugin - cleanShutdown: true - #============================================================================ - # NutDao dataSource - #============================================================================ - dataSource: - myDS: - connectionProvider: - class: com.budwk.app.task.conn.NutConnectionProvider - - -sms: - enabled: false - #腾讯云短信配置 - tencent: - secret-id: 1 - secret-key: 2 - appid: 1 #应用ID - sign: '萌发开源' #短信签名 - tpl: - #验证码模板ID - code: 1 - #短信通知模板ID - msg: 2 - diff --git a/backend/src/main/java/com/budwk/app/client/auth/controller/ClientAuthController.java b/backend/src/main/java/com/budwk/app/client/auth/controller/ClientAuthController.java index 333250f..68c861b 100644 --- a/backend/src/main/java/com/budwk/app/client/auth/controller/ClientAuthController.java +++ b/backend/src/main/java/com/budwk/app/client/auth/controller/ClientAuthController.java @@ -85,7 +85,7 @@ public class ClientAuthController { @ApiOperation(value = "短信登录", nickname = "/sms-login", httpMethod = "POST") public Object doSmsLogin(ClientLoginBody loginBody, HttpServletRequest req) { try { - String token = clientAuthService.doSmsLogin(loginBody); + String token = clientAuthService.doLogin(loginBody); return Result.success().addData(token); } catch (Exception e) { log.error(e.getMessage(), e); diff --git a/backend/src/main/java/com/budwk/app/client/auth/models/Client_user.java b/backend/src/main/java/com/budwk/app/client/auth/models/Client_user.java index 89417fb..89b3545 100644 --- a/backend/src/main/java/com/budwk/app/client/auth/models/Client_user.java +++ b/backend/src/main/java/com/budwk/app/client/auth/models/Client_user.java @@ -48,6 +48,16 @@ public class Client_user extends BaseModel implements Serializable { @Comment("单位ID") private String unitId; + @Column + @ColDefine(type = ColType.VARCHAR, width = 255) + @Comment("密码") + private String password; + + @Column + @ColDefine(type = ColType.VARCHAR, width = 255) + @Comment("盐") + private String salt; + @Column @ColDefine(type = ColType.VARCHAR, width = 255) @Comment("openId") diff --git a/backend/src/main/java/com/budwk/app/client/auth/service/ClientAuthService.java b/backend/src/main/java/com/budwk/app/client/auth/service/ClientAuthService.java index 551a5be..67ac60a 100644 --- a/backend/src/main/java/com/budwk/app/client/auth/service/ClientAuthService.java +++ b/backend/src/main/java/com/budwk/app/client/auth/service/ClientAuthService.java @@ -10,7 +10,7 @@ public interface ClientAuthService { * @param loginBody 登录信息 * @return token */ - String doSmsLogin(ClientLoginBody loginBody); + String doLogin(ClientLoginBody loginBody); /** * 注册 diff --git a/backend/src/main/java/com/budwk/app/client/auth/service/ClientAuthServiceImpl.java b/backend/src/main/java/com/budwk/app/client/auth/service/ClientAuthServiceImpl.java index 2cb8a49..c12d31f 100644 --- a/backend/src/main/java/com/budwk/app/client/auth/service/ClientAuthServiceImpl.java +++ b/backend/src/main/java/com/budwk/app/client/auth/service/ClientAuthServiceImpl.java @@ -1,7 +1,9 @@ package com.budwk.app.client.auth.service; import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.util.StrUtil; import com.budwk.app.base.exception.BaseException; +import com.budwk.app.base.utils.PwdUtil; import com.budwk.app.client.auth.vo.ClientLoginBody; import com.budwk.app.client.auth.models.Client_user; import com.budwk.app.client.auth.vo.ClientRegisterBody; @@ -11,6 +13,9 @@ import org.nutz.dao.Cnd; import org.nutz.dao.Dao; import org.nutz.ioc.loader.annotation.Inject; import org.nutz.ioc.loader.annotation.IocBean; +import org.nutz.lang.Strings; + +import java.util.List; @IocBean public class ClientAuthServiceImpl implements ClientAuthService { @@ -21,23 +26,34 @@ public class ClientAuthServiceImpl implements ClientAuthService { private ValidateService validateService; @Override - public String doSmsLogin(ClientLoginBody loginBody) { + public String doLogin(ClientLoginBody loginBody) { Client_user user = null; int count = dao.count(Client_user.class, Cnd.where(Client_user::getPhone, "=", loginBody.getPhone())); if (count == 0) { -// // 自动注册 -// user = new Client_user(); -// user.setPhone(loginBody.getPhone()); -// user.setUserName("用户" + loginBody.getPhone()); -// dao.insert(user); throw new BaseException("手机号码不存在"); } - validateService.checkSMSCode(loginBody.getPhone(), loginBody.getSmsCode()); user = dao.fetch(Client_user.class, Cnd.where(Client_user::getPhone, "=", loginBody.getPhone())); + if (user == null) { - throw new BaseException("用户登录失败"); + throw new BaseException("用户不存在"); } + + if (StrUtil.isBlank(loginBody.getLoginMethod()) || !List.of("sms", "password").contains(loginBody.getLoginMethod())) { + throw new BaseException("登录方式不正确"); + } + + if (loginBody.getLoginMethod().equals("sms")) { + validateService.checkSMSCode(loginBody.getPhone(), loginBody.getSmsCode()); + } + + if (loginBody.getLoginMethod().equals("password")) { + String hashedPassword = PwdUtil.getPassword(loginBody.getPassword(), user.getSalt()); + if (!Strings.sNull(hashedPassword).equalsIgnoreCase(user.getPassword())) { + throw new BaseException("密码不正确"); + } + } + StpClientUtil.STP.login(user.getId()); StpClientUtil.STP.checkLogin(); return StpClientUtil.STP.getTokenValue(); diff --git a/backend/src/main/java/com/budwk/app/client/auth/vo/ClientLoginBody.java b/backend/src/main/java/com/budwk/app/client/auth/vo/ClientLoginBody.java index f192016..41b39a3 100644 --- a/backend/src/main/java/com/budwk/app/client/auth/vo/ClientLoginBody.java +++ b/backend/src/main/java/com/budwk/app/client/auth/vo/ClientLoginBody.java @@ -9,4 +9,8 @@ public class ClientLoginBody { private String smsCode; + private String password; + + private String loginMethod; + } diff --git a/backend/src/main/java/com/budwk/app/client/module/activity/vo/ClientActivitySignVO.java b/backend/src/main/java/com/budwk/app/client/module/activity/vo/ClientActivitySignVO.java index 5846284..d0a0bc2 100644 --- a/backend/src/main/java/com/budwk/app/client/module/activity/vo/ClientActivitySignVO.java +++ b/backend/src/main/java/com/budwk/app/client/module/activity/vo/ClientActivitySignVO.java @@ -14,6 +14,8 @@ public class ClientActivitySignVO { private Long activityId; private Long itemId; + private String unitId; + private String unitName; private String contactName; diff --git a/backend/src/main/java/com/budwk/app/module/activity/controller/ActUserController.java b/backend/src/main/java/com/budwk/app/module/activity/controller/ActUserController.java index b014f12..d36886b 100644 --- a/backend/src/main/java/com/budwk/app/module/activity/controller/ActUserController.java +++ b/backend/src/main/java/com/budwk/app/module/activity/controller/ActUserController.java @@ -105,6 +105,7 @@ public class ActUserController { user.setId(actUser.getId()); } user.setUserId(user.getUserId()); + user.setUnitId(vo.getUnitId()); user.setSignUpTime(localDateTime); user.setSignUpContacts(vo.getContactName()); user.setSignUpMobile(vo.getContactPhone()); @@ -115,6 +116,7 @@ public class ActUserController { } else { for (ActUser user : doSignUserList) { user.setUserId(user.getUserId()); + user.setUnitId(vo.getUnitId()); user.setSignUpTime(localDateTime); user.setSignUpContacts(vo.getContactName()); user.setSignUpMobile(vo.getContactPhone()); @@ -134,6 +136,7 @@ public class ActUserController { dao.insert(clientUser); user.setUserId(clientUser.getId()); + user.setUnitId(vo.getUnitId()); user.setSignUpTime(localDateTime); user.setSignUpContacts(vo.getContactName()); user.setSignUpMobile(vo.getContactPhone()); @@ -171,8 +174,8 @@ public class ActUserController { @At @SaCheckPermission("activity.user") - public Result findSignUserInfo(String userId){ - return Result.success(dao.fetch(ActUser.class, Cnd.where(ActUser::getUserId, "=", userId))); + public Result findSignUserInfo(String id){ + return Result.success(dao.fetch(ActUser.class, Cnd.where(ActUser::getId, "=", id))); } @@ -182,7 +185,7 @@ public class ActUserController { @At @SaCheckPermission("activity.user") public Result getActivityList(String year){ - List activityList = dao.query(Activity.class, Cnd.where("YEAR(startTime)", "=", year).and(Activity::getDelFlag, "=", false)); + List activityList = dao.query(Activity.class, Cnd.NEW().andEX("YEAR(startTime)", "=", year).and(Activity::getDelFlag, "=", false)); return Result.success(activityList); } diff --git a/backend/src/main/java/com/budwk/app/module/activity/controller/ActWonderfulMomentController.java b/backend/src/main/java/com/budwk/app/module/activity/controller/ActWonderfulMomentController.java new file mode 100644 index 0000000..41ee653 --- /dev/null +++ b/backend/src/main/java/com/budwk/app/module/activity/controller/ActWonderfulMomentController.java @@ -0,0 +1,123 @@ +package com.budwk.app.module.activity.controller; + +import cn.dev33.satoken.annotation.SaCheckLogin; +import cn.dev33.satoken.annotation.SaCheckPermission; +import cn.hutool.core.date.DateTime; +import cn.hutool.core.date.DateUtil; +import cn.hutool.core.util.StrUtil; +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.module.activity.models.ActWonderfulMoment; +import com.budwk.app.module.activity.models.Activity; +import com.budwk.app.module.activity.service.ActWonderfulMomentService; +import com.budwk.app.web.commons.auth.satoken.StpClientUtil; +import lombok.extern.slf4j.Slf4j; +import org.nutz.aop.interceptor.ioc.TransAop; +import org.nutz.dao.Cnd; +import org.nutz.dao.sql.Sql; +import org.nutz.ioc.aop.Aop; +import org.nutz.ioc.loader.annotation.Inject; +import org.nutz.ioc.loader.annotation.IocBean; +import org.nutz.lang.Lang; +import org.nutz.lang.util.NutMap; +import org.nutz.mvc.annotation.At; +import org.nutz.mvc.annotation.Ok; +import org.nutz.mvc.annotation.Param; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +/** + * @ClassName ActWonderfulMomentController + * @Author JyuHsin + * @Date 2025/5/6 15:30 + * @Version 1.0 + * @Description TODO + */ +@Slf4j +@IocBean +@Ok("json:full") +@At("/platform/activity/wonderfulMoment") +public class ActWonderfulMomentController { + + @Inject + private ActWonderfulMomentService wonderfulMomentService; + + @At("") + @SaCheckPermission("activity.wonderfulMoment") + @Ok("beetl:/platform/activity/wonderfulMoment/index.html") + public void index() { + } + + @At + @SaCheckPermission("activity.wonderfulMoment") + public Result pageData(PageForm pageForm, String startTime, String endTime){ + Cnd cnd = Cnd.NEW(); + if (StrUtil.isNotBlank(pageForm.getSearchKeyword())) { + cnd.and("title", "like", "%" + pageForm.getSearchKeyword() + "%"); + } + cnd.andEX("publishTime", ">=", startTime); + cnd.andEX("publishTime", "<=", endTime); + cnd.desc("publishTime"); + Pagination pagination = wonderfulMomentService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), cnd); + return Result.success(pagination); + } + + @At + @Aop(TransAop.READ_COMMITTED) + @SaCheckPermission("activity.wonderfulMoment") + public Result onHandle(@Param("wonderfulMoment") ActWonderfulMoment wonderfulMoment) { + if(wonderfulMoment.getId() == null) { + wonderfulMoment.setPublishTime(DateUtil.now()); + } + wonderfulMomentService.insertOrUpdate(wonderfulMoment); + return Result.success(); + } + + @At + @Aop(TransAop.READ_COMMITTED) + @SaCheckPermission("activity.wonderfulMoment") + public Result onDelete(Long id) { + wonderfulMomentService.delete(id); + return Result.success(); + } + + @At + @SaCheckLogin(type = StpClientUtil.TYPE) + public Result getWonderfulMoment(@Param("id") Long id) { + Cnd cnd = Cnd.where("published", "=", true).andEX("id", "=", id); + cnd.desc("publishTime"); + List momentList = wonderfulMomentService.query(cnd); + List result = new ArrayList<>(); + for (ActWonderfulMoment wonderfulMoment : momentList) { + NutMap nutMap = Lang.obj2map(wonderfulMoment, NutMap.class); + DateTime dateTime = DateUtil.parse(wonderfulMoment.getPublishTime()); + //如果是今天 + if(DateUtil.isSameDay(dateTime, new Date())) { + nutMap.put("time", "今天" + DateUtil.format(dateTime, "HH:mm")); + } else { + nutMap.put("time", DateUtil.betweenDay(dateTime, new Date(), false) + "天前"); + } + result.add(nutMap); + } + return Result.success(result); + } + + @At("/getWonderfulMomentById/?") + @SaCheckLogin(type = StpClientUtil.TYPE) + public Result getWonderfulMomentById(Long id) { + ActWonderfulMoment moment = wonderfulMomentService.fetch(id); + return Result.success(moment); + } + + @At("/handleWonderfulMoment/?") + @SaCheckLogin(type = StpClientUtil.TYPE) + public Result handleWonderfulMoment(Long id) { + ActWonderfulMoment moment = wonderfulMomentService.fetch(id); + moment.setReadCount(moment.getReadCount() + 1); + wonderfulMomentService.update(moment); + return Result.success(); + } +} diff --git a/backend/src/main/java/com/budwk/app/module/activity/controller/ActivityManageController.java b/backend/src/main/java/com/budwk/app/module/activity/controller/ActivityManageController.java index e4aae90..827b7d8 100644 --- a/backend/src/main/java/com/budwk/app/module/activity/controller/ActivityManageController.java +++ b/backend/src/main/java/com/budwk/app/module/activity/controller/ActivityManageController.java @@ -1,5 +1,6 @@ package com.budwk.app.module.activity.controller; +import cn.dev33.satoken.annotation.SaCheckLogin; import cn.dev33.satoken.annotation.SaCheckPermission; import cn.hutool.core.collection.CollUtil; import com.budwk.app.base.page.PageForm; @@ -8,6 +9,7 @@ import com.budwk.app.base.result.Result; import com.budwk.app.module.activity.models.Activity; import com.budwk.app.module.activity.models.ActivityItem; import com.budwk.app.module.activity.service.ActivityManageService; +import com.budwk.app.web.commons.auth.satoken.StpClientUtil; import lombok.extern.slf4j.Slf4j; import org.nutz.aop.interceptor.ioc.TransAop; import org.nutz.dao.Cnd; @@ -163,4 +165,11 @@ public class ActivityManageController { return Result.success(); } + @At + @Aop(TransAop.READ_COMMITTED) + @SaCheckLogin(type = StpClientUtil.TYPE) + public Result getActivity() { + List activityList = activityService.query(Cnd.NEW()); + return Result.success(activityList); + } } diff --git a/backend/src/main/java/com/budwk/app/module/activity/controller/ActivitySignInQueryController.java b/backend/src/main/java/com/budwk/app/module/activity/controller/ActivitySignInQueryController.java index c8bd55f..1740422 100644 --- a/backend/src/main/java/com/budwk/app/module/activity/controller/ActivitySignInQueryController.java +++ b/backend/src/main/java/com/budwk/app/module/activity/controller/ActivitySignInQueryController.java @@ -15,6 +15,7 @@ import com.budwk.app.module.activity.service.ActivitySignInQueryService; import com.budwk.app.module.activity.vo.page.ActSignInUserPageForm; import lombok.extern.slf4j.Slf4j; import org.apache.poi.ss.usermodel.Workbook; +import org.nutz.dao.Chain; import org.nutz.dao.Cnd; import org.nutz.dao.Sqls; import org.nutz.dao.sql.Sql; @@ -87,6 +88,17 @@ public class ActivitySignInQueryController { } + @At + @SaCheckPermission("activity.signInUserQuery") + public Result doGrant(String id, Boolean isGrant) { + if (StrUtil.isBlank(id)) { + return Result.error("参数错误"); + } + activitySignInQueryService.update(Chain.make("isGrant", isGrant), Cnd.where("id", "=", id)); + return Result.success(); + } + + @At @Ok("void") @SaCheckPermission("activity.signInUserQuery") diff --git a/backend/src/main/java/com/budwk/app/module/activity/models/ActUser.java b/backend/src/main/java/com/budwk/app/module/activity/models/ActUser.java index 56a498e..bbf269a 100644 --- a/backend/src/main/java/com/budwk/app/module/activity/models/ActUser.java +++ b/backend/src/main/java/com/budwk/app/module/activity/models/ActUser.java @@ -70,6 +70,11 @@ public class ActUser extends BaseModel { @ColDefine(type = ColType.VARCHAR, width = 30) private String phone; + @Column + @Comment("参加单位Id") + @ColDefine(type = ColType.VARCHAR, width = 32) + private String unitId; + @Column @Comment("参加单位名称") @ColDefine(type = ColType.VARCHAR, width = 100) @@ -95,6 +100,12 @@ public class ActUser extends BaseModel { @ColDefine(type = ColType.BOOLEAN) private Boolean isStay; + @Column + @Comment("是否联系人") + @ColDefine(type = ColType.BOOLEAN) + @Default("0") + private Boolean isContacts; + @Column @Comment("是否签到") @ColDefine(type = ColType.BOOLEAN) @@ -105,4 +116,10 @@ public class ActUser extends BaseModel { @Comment("签到时间") @ColDefine(type = ColType.DATETIME) private LocalDateTime signInTime; + + @Column + @Comment("是否发放物资") + @ColDefine(type = ColType.BOOLEAN) + @Default("0") + private Boolean isGrant; } diff --git a/backend/src/main/java/com/budwk/app/module/activity/models/ActWonderfulMoment.java b/backend/src/main/java/com/budwk/app/module/activity/models/ActWonderfulMoment.java new file mode 100644 index 0000000..e2aa5fb --- /dev/null +++ b/backend/src/main/java/com/budwk/app/module/activity/models/ActWonderfulMoment.java @@ -0,0 +1,56 @@ +package com.budwk.app.module.activity.models; + +import com.budwk.app.base.model.BaseModel; +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.nutz.dao.entity.annotation.*; + +/** + * @ClassName ActWonderfulMoment + * @Author JyuHsin + * @Date 2025/5/6 15:28 + * @Version 1.0 + * @Description TODO + */ +@Data +@Comment("活动项目队伍得分表") +@Table("act_wonderful_moment") +@EqualsAndHashCode(callSuper = true) +@TableMeta("{'mysql-charset':'utf8mb4'}") +public class ActWonderfulMoment extends BaseModel { + + @Id + @Comment("ID") + private Long id; + + @Column + @Comment("标题") + @ColDefine(type = ColType.VARCHAR, width = 100) + private String title; + + @Column + @Comment("发布内容") + @ColDefine(type = ColType.TEXT) + private String content; + + @Column + @Comment("发布时间") + @ColDefine(type = ColType.VARCHAR, width = 30) + private String publishTime; + + @Column + @Comment("封面图") + @ColDefine(type = ColType.VARCHAR, width = 500) + private String cover; + + @Column + @Comment("是否发布") + @ColDefine(type = ColType.BOOLEAN) + private Boolean published; + + @Column + @Comment("阅读次数") + @Default(value = "0") + @ColDefine(type = ColType.INT) + private Integer readCount; +} diff --git a/backend/src/main/java/com/budwk/app/module/activity/service/ActWonderfulMomentService.java b/backend/src/main/java/com/budwk/app/module/activity/service/ActWonderfulMomentService.java new file mode 100644 index 0000000..b95ded8 --- /dev/null +++ b/backend/src/main/java/com/budwk/app/module/activity/service/ActWonderfulMomentService.java @@ -0,0 +1,14 @@ +package com.budwk.app.module.activity.service; + +import com.budwk.app.base.service.BaseService; +import com.budwk.app.module.activity.models.ActWonderfulMoment; + +/** + * @ClassName ActWonderfulMomentService + * @Author JyuHsin + * @Date 2025/5/6 15:30 + * @Version 1.0 + * @Description TODO + */ +public interface ActWonderfulMomentService extends BaseService { +} diff --git a/backend/src/main/java/com/budwk/app/module/activity/service/impl/ActWonderfulMomentServiceImpl.java b/backend/src/main/java/com/budwk/app/module/activity/service/impl/ActWonderfulMomentServiceImpl.java new file mode 100644 index 0000000..c53e062 --- /dev/null +++ b/backend/src/main/java/com/budwk/app/module/activity/service/impl/ActWonderfulMomentServiceImpl.java @@ -0,0 +1,21 @@ +package com.budwk.app.module.activity.service.impl; + +import com.budwk.app.base.service.impl.BaseServiceImpl; +import com.budwk.app.module.activity.models.ActWonderfulMoment; +import com.budwk.app.module.activity.service.ActWonderfulMomentService; +import org.nutz.dao.Dao; +import org.nutz.ioc.loader.annotation.IocBean; + +/** + * @ClassName ActWonderfulMomentServiceImpl + * @Author JyuHsin + * @Date 2025/5/6 15:31 + * @Version 1.0 + * @Description TODO + */ +@IocBean(args = {"refer:dao"}) +public class ActWonderfulMomentServiceImpl extends BaseServiceImpl implements ActWonderfulMomentService { + public ActWonderfulMomentServiceImpl(Dao dao) { + super(dao); + } +} diff --git a/backend/src/main/java/com/budwk/app/web/commons/ext/sms/SmsService.java b/backend/src/main/java/com/budwk/app/web/commons/ext/sms/SmsService.java index 3976ad9..689c054 100644 --- a/backend/src/main/java/com/budwk/app/web/commons/ext/sms/SmsService.java +++ b/backend/src/main/java/com/budwk/app/web/commons/ext/sms/SmsService.java @@ -1,5 +1,6 @@ package com.budwk.app.web.commons.ext.sms; +import cn.hutool.json.JSONUtil; import com.budwk.app.base.exception.BaseException; import com.tencentcloudapi.common.Credential; import com.tencentcloudapi.common.exception.TencentCloudSDKException; @@ -48,20 +49,21 @@ public class SmsService { ClientProfile clientProfile = new ClientProfile(); clientProfile.setHttpProfile(httpProfile); - SmsClient client = new SmsClient(cred, "", clientProfile); + SmsClient client = new SmsClient(cred, "ap-guangzhou", clientProfile); SendSmsRequest req = new SendSmsRequest(); - String[] phoneNumberSet1 = {"+86" + mobile}; - req.setPhoneNumberSet(phoneNumberSet1); - String[] templateParamSet1 = {text, "5"}; - req.setTemplateParamSet(templateParamSet1); - req.setTemplateID(conf.get("sms.tencent.tpl.login_code")); req.setSmsSdkAppid(conf.get("sms.tencent.appid")); req.setSign(conf.get("sms.tencent.sign")); + req.setTemplateID(conf.get("sms.tencent.tpl.login_code")); + String[] phoneNumberSet1 = {"+86" + mobile}; + req.setPhoneNumberSet(phoneNumberSet1); + String[] templateParamSet1 = {text}; + req.setTemplateParamSet(templateParamSet1); SendSmsResponse resp = client.SendSms(req); log.debug(SendSmsResponse.toJsonString(resp)); return true; } catch (TencentCloudSDKException tencentCloudSDKException) { + log.error(String.valueOf(tencentCloudSDKException)); throw new BaseException(tencentCloudSDKException.getMessage()); } } @@ -86,12 +88,12 @@ public class SmsService { ClientProfile clientProfile = new ClientProfile(); clientProfile.setHttpProfile(httpProfile); - SmsClient client = new SmsClient(cred, "", clientProfile); + SmsClient client = new SmsClient(cred, "ap-guangzhou", clientProfile); SendSmsRequest req = new SendSmsRequest(); String[] phoneNumberSet1 = {"+86" + mobile}; req.setPhoneNumberSet(phoneNumberSet1); - String[] templateParamSet1 = {text, "5"}; + String[] templateParamSet1 = {text}; req.setTemplateParamSet(templateParamSet1); req.setTemplateID(conf.get("sms.tencent.tpl.reg_code")); req.setSmsSdkAppid(conf.get("sms.tencent.appid")); @@ -126,7 +128,7 @@ public class SmsService { ClientProfile clientProfile = new ClientProfile(); clientProfile.setHttpProfile(httpProfile); - SmsClient client = new SmsClient(cred, "", clientProfile); + SmsClient client = new SmsClient(cred, "ap-guangzhou", clientProfile); SendSmsRequest req = new SendSmsRequest(); req.setPhoneNumberSet(mobile); diff --git a/backend/src/main/resources/application.yaml b/backend/src/main/resources/application.yaml index b3d8611..6b65baf 100644 --- a/backend/src/main/resources/application.yaml +++ b/backend/src/main/resources/application.yaml @@ -23,7 +23,7 @@ jetty: #结合ftp使用,或用nginx代理ftp路径 #staticPath: E:/project/NutzWk/upload #开发模式静态资源 - staticPathLocal: E:/projects/hmc_gbhd/src/main/resources/static + staticPathLocal: G:/project/hmc_gbhd/src/main/resources/static security: tokenName: token @@ -69,7 +69,7 @@ xsssql: beetl: RESOURCE: #本地路径,开发时设置本地路径,便于调试 - rootLocal: E:/projects/hmc_gbhd/src/main/resources/views/ + rootLocal: G:/projects/hmc_gbhd/src/main/resources/views/ root: views/ DELIMITER_STATEMENT_START: '' @@ -147,11 +147,11 @@ swagger: description: 趣味运动会系统 sms: - enabled: false + enabled: true #腾讯云短信配置 tencent: - secret-id: 1301383032 - secret-key: AKIDMZWDepjNnxqSotiHZeU6SYOyIMAj24rO + secret-id: AKID3vYx5xYu0pVwDIAm9F4ey74mEPJwJQGp + secret-key: LPDl5AyV4NQM3TdW9VaOvCE0VkjSu5zc appid: 1400934413 #应用ID sign: '武汉地大三思科技' #短信签名 tpl: diff --git a/backend/src/main/resources/static/components/plugins/imageUpload/index.vue b/backend/src/main/resources/static/components/plugins/imageUpload/index.vue index 343e919..006143a 100644 --- a/backend/src/main/resources/static/components/plugins/imageUpload/index.vue +++ b/backend/src/main/resources/static/components/plugins/imageUpload/index.vue @@ -12,10 +12,22 @@ :on-exceed="handleExceed" :file-list="fileList" > - + +
+ + + + + + + + + +
- + @@ -124,4 +136,4 @@ module.exports = { \ No newline at end of file + diff --git a/backend/src/main/resources/views/platform/activity/manage/addOrUpdate.js b/backend/src/main/resources/views/platform/activity/manage/addOrUpdate.js index 5e27579..6d4ff33 100644 --- a/backend/src/main/resources/views/platform/activity/manage/addOrUpdate.js +++ b/backend/src/main/resources/views/platform/activity/manage/addOrUpdate.js @@ -78,6 +78,9 @@ const addOrUpdate = { {{form.files}} + + + diff --git a/frontend/src/pages/login/index.vue b/frontend/src/pages/login/index.vue index b20beb9..3419d54 100644 --- a/frontend/src/pages/login/index.vue +++ b/frontend/src/pages/login/index.vue @@ -62,16 +62,16 @@ - + + + + + + + 立即登录 @@ -127,17 +139,14 @@ import {useUserStore} from "@/store"; const request = useRequest() const userStore = useUserStore() -const activeMethod = ref('phone') const loginForm = reactive({ phone: '', - smsCode: '' + smsCode: '', + password: '', + loginMethod: 'sms' }) -const setActiveMethod = (method) => { - activeMethod.value = method -} - // 倒计时相关 const countdown = ref(0) const timer = ref(null) @@ -265,10 +274,14 @@ async function handleLogin() { Toast('请输入手机号码'); return } - if (!loginForm.smsCode) { + if (!loginForm.smsCode && loginForm.loginMethod === 'sms') { Toast('请输入验证码'); return } + if (!loginForm.password && loginForm.loginMethod === 'password') { + Toast('请输入密码'); + return + } try { userStore.smsLogin(loginForm).then(() => { @@ -318,7 +331,7 @@ async function handleLogin() { } } -function navigateToRegister(){ +function navigateToRegister() { uni.redirectTo({ url: '/pages/login/register' }) diff --git a/frontend/src/pages/login/register.vue b/frontend/src/pages/login/register.vue index caf88c3..ae0c8a4 100644 --- a/frontend/src/pages/login/register.vue +++ b/frontend/src/pages/login/register.vue @@ -1,8 +1,57 @@