diff --git a/src/main/java/com/peteralbus/controller/AdminController.java b/src/main/java/com/peteralbus/controller/AdminController.java index df4ec23..109c4e6 100644 --- a/src/main/java/com/peteralbus/controller/AdminController.java +++ b/src/main/java/com/peteralbus/controller/AdminController.java @@ -1,7 +1,10 @@ package com.peteralbus.controller; import com.peteralbus.entity.Activity; +import com.peteralbus.entity.User; import com.peteralbus.service.ActivityService; +import com.peteralbus.service.MessageService; +import com.peteralbus.service.UserService; import com.peteralbus.util.PrincipalUtil; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; @@ -20,17 +23,37 @@ import java.util.List; @RequestMapping("/admin") public class AdminController { + @Autowired + MessageService messageService; @Autowired ActivityService activityService; + @Autowired + UserService userService; + private ModelAndView basicModelAndView() + { + ModelAndView modelAndView=PrincipalUtil.getBasicModelAndView(); + modelAndView.addObject("messageCount",messageService.getNewMessageCount()); + modelAndView.addObject("newMessageList",messageService.getNewMessage()); + return modelAndView; + } @RequestMapping("/activities") public ModelAndView activities() { - ModelAndView modelAndView=PrincipalUtil.getBasicModelAndView(); + ModelAndView modelAndView=this.basicModelAndView(); List activityList=activityService.adminActivityList(); modelAndView.addObject("activityList",activityList); modelAndView.setViewName("/jsp/admin/activities.jsp"); return modelAndView; } + @RequestMapping("/users") + public ModelAndView users() + { + ModelAndView modelAndView=this.basicModelAndView(); + List userList=userService.getUserList(); + modelAndView.addObject("userList",userList); + modelAndView.setViewName("/jsp/admin/users.jsp"); + return modelAndView; + } @ResponseBody @RequestMapping("/restoreActivity") public String restoreActivity(Long activityId) @@ -41,4 +64,16 @@ public class AdminController } return "error"; } + @ResponseBody + @RequestMapping("/resetPassword") + public String resetPassword(Long userId) + { + User user=userService.queryById(userId); + user.setPassword("123456"); + if(userService.updateUserPassword(user)>0) + { + return "success"; + } + return "error"; + } } diff --git a/src/main/java/com/peteralbus/controller/PageController.java b/src/main/java/com/peteralbus/controller/PageController.java index 17cc19b..37a8747 100644 --- a/src/main/java/com/peteralbus/controller/PageController.java +++ b/src/main/java/com/peteralbus/controller/PageController.java @@ -1,9 +1,11 @@ package com.peteralbus.controller; import com.peteralbus.entity.User; +import com.peteralbus.service.MessageService; import com.peteralbus.util.PrincipalUtil; import org.apache.shiro.SecurityUtils; import org.apache.shiro.subject.Subject; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; @@ -17,16 +19,39 @@ import org.springframework.web.servlet.ModelAndView; @Controller public class PageController { + @Autowired + MessageService messageService; /** * Home page model and view. * * @return the model and view */ + private ModelAndView basicModelAndView() + { + ModelAndView modelAndView=PrincipalUtil.getBasicModelAndView(); + modelAndView.addObject("messageCount",messageService.getNewMessageCount()); + modelAndView.addObject("newMessageList",messageService.getNewMessage()); + return modelAndView; + } @RequestMapping("/index") public ModelAndView homePage() { - ModelAndView modelAndView= PrincipalUtil.getBasicModelAndView(); + ModelAndView modelAndView=this.basicModelAndView(); modelAndView.setViewName("/jsp/home.jsp"); return modelAndView; } + @RequestMapping("/messageList") + public ModelAndView messageList() + { + ModelAndView modelAndView=this.basicModelAndView(); + modelAndView.setViewName("/jsp/message/messageList.jsp"); + return modelAndView; + } + @RequestMapping("/message") + public ModelAndView message(Long messageId) + { + ModelAndView modelAndView=this.basicModelAndView(); + modelAndView.setViewName("/jsp/message/message.jsp"); + return modelAndView; + } } diff --git a/src/main/java/com/peteralbus/controller/StudentController.java b/src/main/java/com/peteralbus/controller/StudentController.java index 1913fff..a67e19e 100644 --- a/src/main/java/com/peteralbus/controller/StudentController.java +++ b/src/main/java/com/peteralbus/controller/StudentController.java @@ -1,10 +1,7 @@ package com.peteralbus.controller; import com.peteralbus.entity.*; -import com.peteralbus.service.ActivityService; -import com.peteralbus.service.GroupService; -import com.peteralbus.service.ParticipateService; -import com.peteralbus.service.RecordService; +import com.peteralbus.service.*; import com.peteralbus.util.PrincipalUtil; import org.apache.shiro.SecurityUtils; import org.apache.shiro.authz.UnauthorizedException; @@ -26,6 +23,8 @@ import java.util.Map; @RequestMapping("/student") public class StudentController { + @Autowired + MessageService messageService; @Autowired ActivityService activityService; @Autowired @@ -34,10 +33,17 @@ public class StudentController ParticipateService participateService; @Autowired RecordService recordService; + private ModelAndView basicModelAndView() + { + ModelAndView modelAndView=PrincipalUtil.getBasicModelAndView(); + modelAndView.addObject("messageCount",messageService.getNewMessageCount()); + modelAndView.addObject("newMessageList",messageService.getNewMessage()); + return modelAndView; + } @RequestMapping("/activities") public ModelAndView activities() { - ModelAndView modelAndView=PrincipalUtil.getBasicModelAndView(); + ModelAndView modelAndView=this.basicModelAndView(); Subject subject = SecurityUtils.getSubject(); User user=(User)subject.getPrincipal(); List activityList=activityService.getActivityByStudent(user.getUserId()); @@ -50,7 +56,7 @@ public class StudentController @RequestMapping("/applyActivity") public ModelAndView applyActivity(Long activityId) { - ModelAndView modelAndView=PrincipalUtil.getBasicModelAndView(); + ModelAndView modelAndView=this.basicModelAndView(); Subject subject = SecurityUtils.getSubject(); User user=(User)subject.getPrincipal(); Activity activity= activityService.getActivityById(activityId); @@ -68,7 +74,7 @@ public class StudentController @RequestMapping("/manageActivity") public ModelAndView manageActivity(Long activityId) { - ModelAndView modelAndView=PrincipalUtil.getBasicModelAndView(); + ModelAndView modelAndView=this.basicModelAndView(); Subject subject = SecurityUtils.getSubject(); User user=(User)subject.getPrincipal(); Activity activity= activityService.getActivityById(activityId); diff --git a/src/main/java/com/peteralbus/controller/TeacherController.java b/src/main/java/com/peteralbus/controller/TeacherController.java index 7c6b401..8e898ce 100644 --- a/src/main/java/com/peteralbus/controller/TeacherController.java +++ b/src/main/java/com/peteralbus/controller/TeacherController.java @@ -38,11 +38,20 @@ public class TeacherController ScoreGroupService scoreGroupService; @Autowired ScoreStuService scoreStuService; + @Autowired + MessageService messageService; + private ModelAndView basicModelAndView() + { + ModelAndView modelAndView=PrincipalUtil.getBasicModelAndView(); + modelAndView.addObject("messageCount",messageService.getNewMessageCount()); + modelAndView.addObject("newMessageList",messageService.getNewMessage()); + return modelAndView; + } @RequiresRoles(value={"teacher"}, logical= Logical.OR) @RequestMapping("/activities") public ModelAndView activities() { - ModelAndView modelAndView= PrincipalUtil.getBasicModelAndView(); + ModelAndView modelAndView=this.basicModelAndView(); Subject subject = SecurityUtils.getSubject(); User user=(User)subject.getPrincipal(); List activityList=activityService.getActivityByTeacher(user.getUserId()); @@ -56,7 +65,7 @@ public class TeacherController @RequestMapping("/activityDetail") public ModelAndView activityDetail(Long activityId) { - ModelAndView modelAndView= PrincipalUtil.getBasicModelAndView(); + ModelAndView modelAndView=this.basicModelAndView(); Activity activity=activityService.getActivityById(activityId); modelAndView.addObject("activity",activity); modelAndView.setViewName("/jsp/teacher/activityDetail.jsp"); @@ -65,7 +74,7 @@ public class TeacherController @RequestMapping("/modifyActivity") public ModelAndView modifyActivity(Long activityId) { - ModelAndView modelAndView=PrincipalUtil.getBasicModelAndView(); + ModelAndView modelAndView=this.basicModelAndView(); Subject subject = SecurityUtils.getSubject(); User user=(User)subject.getPrincipal(); if(!activityService.checkIsManage(user.getUserId(), activityId)) @@ -84,7 +93,7 @@ public class TeacherController @RequestMapping("/manageGroup") public ModelAndView manageGroup(Long groupId) { - ModelAndView modelAndView=PrincipalUtil.getBasicModelAndView(); + ModelAndView modelAndView=this.basicModelAndView(); Subject subject = SecurityUtils.getSubject(); User user=(User)subject.getPrincipal(); Group group=groupService.getById(groupId); diff --git a/src/main/java/com/peteralbus/dao/MessageDao.java b/src/main/java/com/peteralbus/dao/MessageDao.java new file mode 100644 index 0000000..f1a2780 --- /dev/null +++ b/src/main/java/com/peteralbus/dao/MessageDao.java @@ -0,0 +1,14 @@ +package com.peteralbus.dao; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.peteralbus.entity.Message; +import org.apache.ibatis.annotations.Mapper; + +/** + * The interface Message dao. + * @author peteralbus + */ +@Mapper +public interface MessageDao extends BaseMapper +{ +} diff --git a/src/main/java/com/peteralbus/entity/Message.java b/src/main/java/com/peteralbus/entity/Message.java new file mode 100644 index 0000000..31eb0fd --- /dev/null +++ b/src/main/java/com/peteralbus/entity/Message.java @@ -0,0 +1,152 @@ +package com.peteralbus.entity; + +import com.baomidou.mybatisplus.annotation.*; +import com.fasterxml.jackson.annotation.JsonFormat; +import org.springframework.format.annotation.DateTimeFormat; + +import java.io.Serializable; +import java.time.LocalDateTime; + +/** + * The type Message. + * @author peteralbus + */ +public class Message implements Serializable +{ + @TableId(type= IdType.ASSIGN_ID) + private Long messageId; + private String messageTitle; + private Long messageReceiver; + private String messageSender; + private String messageContent; + private Boolean isRead; + @Version + private Integer version; + @TableField(fill = FieldFill.INSERT) + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private LocalDateTime gmtCreate; + @TableField(fill = FieldFill.INSERT_UPDATE) + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private LocalDateTime gmtModified; + @TableLogic + private Integer isDelete; + + public Long getMessageId() + { + return messageId; + } + + public void setMessageId(Long messageId) + { + this.messageId = messageId; + } + + public String getMessageTitle() + { + return messageTitle; + } + + public void setMessageTitle(String messageTitle) + { + this.messageTitle = messageTitle; + } + + public Long getMessageReceiver() + { + return messageReceiver; + } + + public void setMessageReceiver(Long messageReceiver) + { + this.messageReceiver = messageReceiver; + } + + public String getMessageSender() + { + return messageSender; + } + + public void setMessageSender(String messageSender) + { + this.messageSender = messageSender; + } + + public String getMessageContent() + { + return messageContent; + } + + public void setMessageContent(String messageContent) + { + this.messageContent = messageContent; + } + + public Boolean getRead() + { + return isRead; + } + + public void setRead(Boolean read) + { + isRead = read; + } + + public Integer getVersion() + { + return version; + } + + public void setVersion(Integer version) + { + this.version = version; + } + + public LocalDateTime getGmtCreate() + { + return gmtCreate; + } + + public void setGmtCreate(LocalDateTime gmtCreate) + { + this.gmtCreate = gmtCreate; + } + + public LocalDateTime getGmtModified() + { + return gmtModified; + } + + public void setGmtModified(LocalDateTime gmtModified) + { + this.gmtModified = gmtModified; + } + + public Integer getIsDelete() + { + return isDelete; + } + + public void setIsDelete(Integer isDelete) + { + this.isDelete = isDelete; + } + + @Override + public String toString() + { + return "Message{" + + "messageId=" + messageId + + ", messageTitle='" + messageTitle + '\'' + + ", messageReceiver=" + messageReceiver + + ", messageSender='" + messageSender + '\'' + + ", messageContent='" + messageContent + '\'' + + ", isRead=" + isRead + + ", version=" + version + + ", gmtCreate=" + gmtCreate + + ", gmtModified=" + gmtModified + + ", isDelete=" + isDelete + + '}'; + } +} diff --git a/src/main/java/com/peteralbus/service/MessageService.java b/src/main/java/com/peteralbus/service/MessageService.java new file mode 100644 index 0000000..52205a7 --- /dev/null +++ b/src/main/java/com/peteralbus/service/MessageService.java @@ -0,0 +1,58 @@ +package com.peteralbus.service; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.peteralbus.dao.MessageDao; +import com.peteralbus.entity.Message; +import com.peteralbus.entity.User; +import org.apache.shiro.SecurityUtils; +import org.apache.shiro.subject.Subject; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * The type Message service. + * @author peteralbus + */ +@Service +public class MessageService +{ + @Autowired + MessageDao messageDao; + public List getMessage() + { + Subject subject = SecurityUtils.getSubject(); + User user=(User)subject.getPrincipal(); + QueryWrapper queryWrapper=new QueryWrapper<>(); + queryWrapper.eq("message_receiver",user.getUserId()); + return messageDao.selectList(queryWrapper); + } + public List getNewMessage() + { + Subject subject = SecurityUtils.getSubject(); + User user=(User)subject.getPrincipal(); + QueryWrapper queryWrapper=new QueryWrapper<>(); + queryWrapper.eq("message_receiver",user.getUserId()); + queryWrapper.eq("is_read",false); + return messageDao.selectList(queryWrapper); + } + public Long getNewMessageCount() + { + Subject subject = SecurityUtils.getSubject(); + User user=(User)subject.getPrincipal(); + QueryWrapper queryWrapper=new QueryWrapper<>(); + queryWrapper.eq("message_receiver",user.getUserId()); + return messageDao.selectCount(queryWrapper); + } + public int sendMessage(Long targetId,String sender,String title,String content) + { + Message message=new Message(); + message.setMessageSender(sender); + message.setMessageReceiver(targetId); + message.setMessageTitle(title); + message.setMessageContent(content); + message.setRead(false); + return messageDao.insert(message); + } +} diff --git a/src/main/java/com/peteralbus/service/UserService.java b/src/main/java/com/peteralbus/service/UserService.java index 81f80d8..9f36425 100644 --- a/src/main/java/com/peteralbus/service/UserService.java +++ b/src/main/java/com/peteralbus/service/UserService.java @@ -79,4 +79,14 @@ public class UserService queryWrapper.eq("user_class",2); return userDao.selectList(queryWrapper); } + + public List getUserList() + { + return userDao.selectList(null); + } + + public User queryById(Long userId) + { + return userDao.selectById(userId); + } } diff --git a/src/main/java/com/peteralbus/util/PrincipalUtil.java b/src/main/java/com/peteralbus/util/PrincipalUtil.java index 09d8c07..5674d82 100644 --- a/src/main/java/com/peteralbus/util/PrincipalUtil.java +++ b/src/main/java/com/peteralbus/util/PrincipalUtil.java @@ -1,13 +1,22 @@ package com.peteralbus.util; +import com.peteralbus.entity.Message; import com.peteralbus.entity.User; +import com.peteralbus.service.MessageService; import org.apache.shiro.SecurityUtils; import org.apache.shiro.subject.Subject; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; import org.springframework.web.servlet.ModelAndView; +import javax.annotation.PostConstruct; +import java.util.List; + /** * The type Principal util. + * @author peteralbus */ +@Component public class PrincipalUtil { /** diff --git a/src/main/webapp/jsp/admin/activities.jsp b/src/main/webapp/jsp/admin/activities.jsp index 0ca213b..7829b38 100644 --- a/src/main/webapp/jsp/admin/activities.jsp +++ b/src/main/webapp/jsp/admin/activities.jsp @@ -11,7 +11,7 @@ - 主页 + 社会实践活动管理 @@ -133,6 +133,13 @@ this.user.realName='${realName}' this.user.username='${username}' this.user.avatarSrc='${avatarSrc}' + + this.$notify.info({ + title: '有新消息:${newMessageList.get(0).getMessageTitle()}', + message: '${newMessageList.get(0).getMessageContent()}', + offset: 100, + }) + }, methods: { goBack(){ diff --git a/src/main/webapp/jsp/admin/users.jsp b/src/main/webapp/jsp/admin/users.jsp new file mode 100644 index 0000000..d42c5c1 --- /dev/null +++ b/src/main/webapp/jsp/admin/users.jsp @@ -0,0 +1,199 @@ +<%-- + Created by IntelliJ IDEA. + User: peteralbus + Date: 2021/12/21 + Time: 20:04 + To change this template use File | Settings | File Templates. +--%> +<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %> +<%@ taglib prefix="shiro" uri="http://shiro.apache.org/tags" %> +<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> + + + + 用户管理 + + + + + + + + + + + + +
+
+ <%@ include file="/jsp/header.html" %> +
+
+
+ + + <%@ include file="/jsp/aside.html" %> + + + +
+
+ + +
+
+ + + + + + + + + + + + + + + + + + +
+
+
+
+
+
+ <%@ include file="/jsp/foot.html" %> +
+
+ + + \ No newline at end of file diff --git a/src/main/webapp/jsp/aside.html b/src/main/webapp/jsp/aside.html index 9927911..1227f4e 100644 --- a/src/main/webapp/jsp/aside.html +++ b/src/main/webapp/jsp/aside.html @@ -27,6 +27,12 @@ + + + + + + diff --git a/src/main/webapp/jsp/header.html b/src/main/webapp/jsp/header.html index 2efbf3f..877b7a3 100644 --- a/src/main/webapp/jsp/header.html +++ b/src/main/webapp/jsp/header.html @@ -9,7 +9,13 @@ 欢迎学生:{{user.realName}}! 欢迎老师:{{user.realName}}! 欢迎管理员:{{user.realName}}! - 登出 + + + + +   + 登出 + diff --git a/src/main/webapp/jsp/home.jsp b/src/main/webapp/jsp/home.jsp index 287b0e4..12099a9 100644 --- a/src/main/webapp/jsp/home.jsp +++ b/src/main/webapp/jsp/home.jsp @@ -6,6 +6,7 @@ --%> <%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %> <%@ taglib prefix="shiro" uri="http://shiro.apache.org/tags" %> +<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> @@ -66,6 +67,13 @@ this.user.realName='${realName}' this.user.username='${username}' this.user.avatarSrc='${avatarSrc}' + + this.$notify.info({ + title: '有新消息:${newMessageList.get(0).getMessageTitle()}', + message: '${newMessageList.get(0).getMessageContent()}', + offset: 100, + }) + }, methods: { goBack(){ diff --git a/src/main/webapp/jsp/message/message.jsp b/src/main/webapp/jsp/message/message.jsp new file mode 100644 index 0000000..8f61687 --- /dev/null +++ b/src/main/webapp/jsp/message/message.jsp @@ -0,0 +1,16 @@ +<%-- + Created by IntelliJ IDEA. + User: peteralbus + Date: 2021/12/21 + Time: 21:39 + To change this template use File | Settings | File Templates. +--%> +<%@ page contentType="text/html;charset=UTF-8" language="java" %> + + + Title + + + + + diff --git a/src/main/webapp/jsp/message/messageList.jsp b/src/main/webapp/jsp/message/messageList.jsp new file mode 100644 index 0000000..8f17ca8 --- /dev/null +++ b/src/main/webapp/jsp/message/messageList.jsp @@ -0,0 +1,16 @@ +<%-- + Created by IntelliJ IDEA. + User: peteralbus + Date: 2021/12/21 + Time: 21:18 + To change this template use File | Settings | File Templates. +--%> +<%@ page contentType="text/html;charset=UTF-8" language="java" %> + + + Title + + + + + diff --git a/src/main/webapp/jsp/student/activities.jsp b/src/main/webapp/jsp/student/activities.jsp index 302df48..bb568f8 100644 --- a/src/main/webapp/jsp/student/activities.jsp +++ b/src/main/webapp/jsp/student/activities.jsp @@ -175,6 +175,13 @@ this.user.realName='${realName}' this.user.username='${username}' this.user.avatarSrc='${avatarSrc}' + + this.$notify.info({ + title: '有新消息:${newMessageList.get(0).getMessageTitle()}', + message: '${newMessageList.get(0).getMessageContent()}', + offset: 100, + }) + let teachers teachers=[] diff --git a/src/main/webapp/jsp/student/activityResult.jsp b/src/main/webapp/jsp/student/activityResult.jsp index 74b0993..eb7d7f0 100644 --- a/src/main/webapp/jsp/student/activityResult.jsp +++ b/src/main/webapp/jsp/student/activityResult.jsp @@ -235,6 +235,13 @@ this.user.username='${username}' this.user.avatarSrc='${avatarSrc}' this.user.userId='${userId}' + + this.$notify.info({ + title: '有新消息:${newMessageList.get(0).getMessageTitle()}', + message: '${newMessageList.get(0).getMessageContent()}', + offset: 100, + }) + }, methods: { goBack(){ diff --git a/src/main/webapp/jsp/student/applyActivity.jsp b/src/main/webapp/jsp/student/applyActivity.jsp index 8d88075..24d3e92 100644 --- a/src/main/webapp/jsp/student/applyActivity.jsp +++ b/src/main/webapp/jsp/student/applyActivity.jsp @@ -195,6 +195,13 @@ this.user.realName='${realName}' this.user.username='${username}' this.user.avatarSrc='${avatarSrc}' + + this.$notify.info({ + title: '有新消息:${newMessageList.get(0).getMessageTitle()}', + message: '${newMessageList.get(0).getMessageContent()}', + offset: 100, + }) + }, methods: { goBack(){ diff --git a/src/main/webapp/jsp/student/manageActivity.jsp b/src/main/webapp/jsp/student/manageActivity.jsp index a50ef28..f5e0336 100644 --- a/src/main/webapp/jsp/student/manageActivity.jsp +++ b/src/main/webapp/jsp/student/manageActivity.jsp @@ -220,6 +220,13 @@ this.user.username='${username}' this.user.avatarSrc='${avatarSrc}' this.user.userId='${userId}' + + this.$notify.info({ + title: '有新消息:${newMessageList.get(0).getMessageTitle()}', + message: '${newMessageList.get(0).getMessageContent()}', + offset: 100, + }) + }, methods: { goBack(){ diff --git a/src/main/webapp/jsp/student/waitGroup.jsp b/src/main/webapp/jsp/student/waitGroup.jsp index 5079b04..7dea682 100644 --- a/src/main/webapp/jsp/student/waitGroup.jsp +++ b/src/main/webapp/jsp/student/waitGroup.jsp @@ -189,6 +189,13 @@ this.user.username='${username}' this.user.avatarSrc='${avatarSrc}' this.user.userId='${userId}' + + this.$notify.info({ + title: '有新消息:${newMessageList.get(0).getMessageTitle()}', + message: '${newMessageList.get(0).getMessageContent()}', + offset: 100, + }) + }, methods: { goBack(){ diff --git a/src/main/webapp/jsp/teacher/activity.jsp b/src/main/webapp/jsp/teacher/activity.jsp index 1429037..33e1984 100644 --- a/src/main/webapp/jsp/teacher/activity.jsp +++ b/src/main/webapp/jsp/teacher/activity.jsp @@ -172,6 +172,13 @@ this.user.realName='${realName}' this.user.username='${username}' this.user.avatarSrc='${avatarSrc}' + + this.$notify.info({ + title: '有新消息:${newMessageList.get(0).getMessageTitle()}', + message: '${newMessageList.get(0).getMessageContent()}', + offset: 100, + }) + let teachers teachers=[] diff --git a/src/main/webapp/jsp/teacher/activityDetail.jsp b/src/main/webapp/jsp/teacher/activityDetail.jsp index 7d08789..4eb617d 100644 --- a/src/main/webapp/jsp/teacher/activityDetail.jsp +++ b/src/main/webapp/jsp/teacher/activityDetail.jsp @@ -136,6 +136,13 @@ this.user.realName='${realName}' this.user.username='${username}' this.user.avatarSrc='${avatarSrc}' + + this.$notify.info({ + title: '有新消息:${newMessageList.get(0).getMessageTitle()}', + message: '${newMessageList.get(0).getMessageContent()}', + offset: 100, + }) + }, methods: { goBack(){ diff --git a/src/main/webapp/jsp/teacher/manageGroup.jsp b/src/main/webapp/jsp/teacher/manageGroup.jsp index d049935..5c9f761 100644 --- a/src/main/webapp/jsp/teacher/manageGroup.jsp +++ b/src/main/webapp/jsp/teacher/manageGroup.jsp @@ -251,6 +251,13 @@ this.user.username='${username}' this.user.avatarSrc='${avatarSrc}' this.user.userId='${userId}' + + this.$notify.info({ + title: '有新消息:${newMessageList.get(0).getMessageTitle()}', + message: '${newMessageList.get(0).getMessageContent()}', + offset: 100, + }) + }, methods: { goBack(){ diff --git a/src/main/webapp/jsp/teacher/modifyActivity.jsp b/src/main/webapp/jsp/teacher/modifyActivity.jsp index 9399150..a157bf4 100644 --- a/src/main/webapp/jsp/teacher/modifyActivity.jsp +++ b/src/main/webapp/jsp/teacher/modifyActivity.jsp @@ -214,6 +214,13 @@ this.user.realName='${realName}' this.user.username='${username}' this.user.avatarSrc='${avatarSrc}' + + this.$notify.info({ + title: '有新消息:${newMessageList.get(0).getMessageTitle()}', + message: '${newMessageList.get(0).getMessageContent()}', + offset: 100, + }) + }, computed:{ teacherListResult:function (){