Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
御承扬
Campus
提交
bd2fa6dc
C
Campus
项目概览
御承扬
/
Campus
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
C
Campus
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
bd2fa6dc
编写于
1月 28, 2021
作者:
7
7wc98#14
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
commit
上级
e3e7a334
变更
15
展开全部
隐藏空白更改
内联
并排
Showing
15 changed file
with
912 addition
and
597 deletion
+912
-597
src/main/java/com/pyc/campus/controller/AdminController.java
src/main/java/com/pyc/campus/controller/AdminController.java
+134
-0
src/main/java/com/pyc/campus/controller/ChatController.java
src/main/java/com/pyc/campus/controller/ChatController.java
+23
-0
src/main/java/com/pyc/campus/controller/FeedbackController.java
...in/java/com/pyc/campus/controller/FeedbackController.java
+63
-0
src/main/java/com/pyc/campus/controller/FriendListController.java
.../java/com/pyc/campus/controller/FriendListController.java
+157
-0
src/main/java/com/pyc/campus/controller/GradeController.java
src/main/java/com/pyc/campus/controller/GradeController.java
+164
-0
src/main/java/com/pyc/campus/controller/NewsController.java
src/main/java/com/pyc/campus/controller/NewsController.java
+77
-0
src/main/java/com/pyc/campus/controller/QuestionController.java
...in/java/com/pyc/campus/controller/QuestionController.java
+90
-0
src/main/java/com/pyc/campus/controller/StudentController.java
...ain/java/com/pyc/campus/controller/StudentController.java
+158
-0
src/main/java/com/pyc/campus/controller/WebController.java
src/main/java/com/pyc/campus/controller/WebController.java
+32
-591
src/main/java/com/pyc/campus/dao/SaveUserPasswordEncodeRepository.java
.../com/pyc/campus/dao/SaveUserPasswordEncodeRepository.java
+7
-0
src/main/resources/templates/page/AddFriend.html
src/main/resources/templates/page/AddFriend.html
+1
-1
src/main/resources/templates/page/Login.html
src/main/resources/templates/page/Login.html
+3
-2
src/main/resources/templates/page/MyFriend.html
src/main/resources/templates/page/MyFriend.html
+1
-1
src/main/resources/templates/page/UserCenter.html
src/main/resources/templates/page/UserCenter.html
+1
-1
src/main/resources/templates/page/VerifyFriend.html
src/main/resources/templates/page/VerifyFriend.html
+1
-1
未找到文件。
src/main/java/com/pyc/campus/controller/AdminController.java
0 → 100644
浏览文件 @
bd2fa6dc
package
com.pyc.campus.controller
;
import
com.pyc.campus.dao.GradeRepository
;
import
com.pyc.campus.dao.QuestionRepository
;
import
com.pyc.campus.dao.StudentRepository
;
import
com.pyc.campus.dao.SysUserRepository
;
import
com.pyc.campus.domain.Grade
;
import
com.pyc.campus.domain.Msg
;
import
com.pyc.campus.domain.Question
;
import
com.pyc.campus.domain.Student
;
import
org.springframework.data.repository.query.Param
;
import
org.springframework.security.core.context.SecurityContextImpl
;
import
org.springframework.security.core.userdetails.UserDetails
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.ui.Model
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
javax.servlet.http.HttpSession
;
import
java.util.List
;
/**
* @author 御承扬
* @product IntelliJ IDEA
* @project campus
* @file AdminController
* @pack com.pyc.campus.controller
* @date 2021/1/27
* @time 12:01
* @E-mail 2923616405@qq.com
**/
@Controller
public
class
AdminController
{
final
StudentRepository
studentRepository
;
final
GradeRepository
gradeRepository
;
final
QuestionRepository
questionRepository
;
final
SysUserRepository
sysUserRepository
;
public
AdminController
(
StudentRepository
studentRepository
,
GradeRepository
gradeRepository
,
SysUserRepository
sysUserRepository
,
QuestionRepository
questionRepository
){
this
.
studentRepository
=
studentRepository
;
this
.
gradeRepository
=
gradeRepository
;
this
.
sysUserRepository
=
sysUserRepository
;
this
.
questionRepository
=
questionRepository
;
}
@RequestMapping
(
"/admin"
)
public
String
admin
(
Model
model
,
HttpSession
session
){
SecurityContextImpl
securityContext
=
(
SecurityContextImpl
)
session
.
getAttribute
(
"SPRING_SECURITY_CONTEXT"
);
String
currentStudentId
=
((
UserDetails
)
securityContext
.
getAuthentication
().
getPrincipal
()).
getUsername
();
Student
s
=
studentRepository
.
findNameByStudentID
(
currentStudentId
);
model
.
addAttribute
(
"curUse"
,
s
);
return
"page/AdminPage"
;
}
@RequestMapping
(
"/delStuByStuId"
)
public
String
delStuByStuId
(
Model
model
,
HttpSession
session
,
@RequestParam
(
value
=
"studentId"
,
required
=
false
)
String
stuId
){
studentRepository
.
delByStudentID
(
stuId
);
sysUserRepository
.
delByUsername
(
stuId
);
List
<
Student
>
students
=
studentRepository
.
findAll
();
model
.
addAttribute
(
"students"
,
students
);
return
"page/ManageUser"
;
}
@RequestMapping
(
"/manageUser"
)
public
String
findUserExceptCurUser
(
Model
model
,
HttpSession
session
){
List
<
Student
>
students
=
studentRepository
.
findAll
();
model
.
addAttribute
(
"students"
,
students
);
return
"page/ManageUser"
;
}
@RequestMapping
(
"/findUserByStudentIDLike"
)
public
String
findUserByStudentIDLike
(
Model
model
,
HttpSession
session
,
@RequestParam
(
value
=
"ClassPrefix"
,
required
=
false
)
String
classPrefix
){
List
<
Student
>
students
=
studentRepository
.
query01
(
classPrefix
+
'%'
);
model
.
addAttribute
(
"students"
,
students
);
return
"page/ManageUser"
;
}
@RequestMapping
(
"/publishQuestion"
)
public
String
publishQuestion
(
Model
model
,
HttpSession
session
,
@Param
(
"mail"
)
String
mail
,
@RequestParam
(
value
=
"PublisherName"
,
required
=
false
)
String
publisher
,
@RequestParam
(
value
=
"QuestionType"
,
required
=
false
)
String
type
,
@Param
(
"content"
)
String
content
,
@Param
(
"reward"
)
String
reward
){
try
{
Question
question
=
new
Question
();
question
.
setPublisher
(
publisher
);
question
.
setMail
(
mail
);
question
.
setType
(
type
);
question
.
setContent
(
content
);
question
.
setReward
(
reward
);
questionRepository
.
save
(
question
);
Msg
msg
=
new
Msg
(
"提示"
,
"发布成功!"
,
""
);
model
.
addAttribute
(
"msg"
,
msg
);
return
"page/PublishQuestion"
;
}
catch
(
Exception
e
){
System
.
out
.
println
(
e
.
getMessage
());
Msg
msg
=
new
Msg
(
"提示"
,
"发生了一些错误,请重新尝试!"
,
""
);
model
.
addAttribute
(
"msg"
,
msg
);
return
"page/PublishQuestion"
;
}
}
@RequestMapping
(
"/saveGrade"
)
public
String
saveGrade
(
Model
model
,
HttpSession
session
,
@Param
(
"term"
)
String
term
,
@Param
(
"CourseCode"
)
String
courseCode
,
@Param
(
"CourseName"
)
String
courseName
,
@Param
(
"credit"
)
int
credit
,
@Param
(
"GPA"
)
String
GPA
,
@Param
(
"LearnHour"
)
String
LearnHour
,
@RequestParam
(
value
=
"StudentGrade"
,
required
=
false
)
String
studentGrade
,
@RequestParam
(
value
=
"studentName"
,
required
=
false
)
String
name
,
@Param
(
"studentID"
)
String
studentID
)
{
System
.
out
.
println
(
name
);
float
gpa
=
Float
.
parseFloat
(
GPA
);
int
learnHour
=
Integer
.
parseInt
(
LearnHour
);
int
grade
=
Integer
.
parseInt
(
studentGrade
);
Grade
g
=
new
Grade
();
g
.
setTerm
(
term
);
g
.
setCourseCode
(
courseCode
);
g
.
setCourseName
(
courseName
);
g
.
setCredit
(
credit
);
g
.
setGpa
(
gpa
);
g
.
setLearnHour
(
learnHour
);
g
.
setGrade
(
grade
);
g
.
setName
(
name
);
g
.
setStudentID
(
studentID
);
gradeRepository
.
save
(
g
);
Msg
msg
=
new
Msg
(
"提示"
,
"导入成功"
,
""
);
model
.
addAttribute
(
"msg"
,
msg
);
return
"page/ImportGrade"
;
}
}
src/main/java/com/pyc/campus/controller/ChatController.java
浏览文件 @
bd2fa6dc
...
...
@@ -7,19 +7,42 @@
package
com.pyc.campus.controller
;
import
com.pyc.campus.dao.StudentRepository
;
import
com.pyc.campus.domain.PublishMessage
;
import
com.pyc.campus.domain.ResponseMessage
;
import
com.pyc.campus.domain.Student
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.messaging.handler.annotation.DestinationVariable
;
import
org.springframework.messaging.handler.annotation.MessageMapping
;
import
org.springframework.messaging.handler.annotation.SendTo
;
import
org.springframework.messaging.simp.SimpMessagingTemplate
;
import
org.springframework.security.core.context.SecurityContextImpl
;
import
org.springframework.security.core.userdetails.UserDetails
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.ui.Model
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
javax.servlet.http.HttpSession
;
import
java.security.Principal
;
@Controller
public
class
ChatController
{
final
StudentRepository
studentRepository
;
public
ChatController
(
StudentRepository
studentRepository
){
this
.
studentRepository
=
studentRepository
;
}
@RequestMapping
(
"/publicChatRoom"
)
public
String
publicChatRoom
(
Model
model
,
HttpSession
session
){
SecurityContextImpl
securityContext
=
(
SecurityContextImpl
)
session
.
getAttribute
(
"SPRING_SECURITY_CONTEXT"
);
String
currentStudentId
=
((
UserDetails
)
securityContext
.
getAuthentication
().
getPrincipal
()).
getUsername
();
Student
s
=
studentRepository
.
findNameByStudentID
(
currentStudentId
);
model
.
addAttribute
(
"curUse"
,
s
);
return
"PublicChatRoom"
;
}
@MessageMapping
(
"/publicChatRoom"
)
@SendTo
(
"/publicChat/getResponse"
)
public
ResponseMessage
say
(
PublishMessage
message
)
throws
Exception
{
...
...
src/main/java/com/pyc/campus/controller/FeedbackController.java
0 → 100644
浏览文件 @
bd2fa6dc
package
com.pyc.campus.controller
;
import
com.pyc.campus.config.MailConfig
;
import
com.pyc.campus.domain.Msg
;
import
org.springframework.data.repository.query.Param
;
import
org.springframework.mail.SimpleMailMessage
;
import
org.springframework.mail.javamail.JavaMailSender
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.ui.Model
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
javax.servlet.http.HttpSession
;
/**
* @author 御承扬
* @product IntelliJ IDEA
* @project campus
* @file FeedbackController
* @pack com.pyc.campus.controller
* @date 2021/1/27
* @time 12:09
* @E-mail 2923616405@qq.com
**/
@Controller
public
class
FeedbackController
{
@RequestMapping
(
"/toHelp"
)
public
String
toHelp
(){
return
"page/Help"
;
}
@RequestMapping
(
"/feedback"
)
public
String
feedback
(
Model
model
,
@Param
(
"mail"
)
String
mail
,
@Param
(
"name"
)
String
name
,
@Param
(
"title"
)
String
title
,
@Param
(
"content"
)
String
content
){
try
{
MailConfig
mailConfig
=
new
MailConfig
();
JavaMailSender
sender
=
mailConfig
.
getMailSender
();
SimpleMailMessage
mailMessage
=
new
SimpleMailMessage
();
mailMessage
.
setFrom
(
"15014366986@163.com"
);
mailMessage
.
setTo
(
"2923616405@qq.com"
);
mailMessage
.
setSubject
(
"用户反馈"
);
String
text
=
"反馈用户:"
+
name
+
",邮箱:"
+
mail
+
",问题标题:"
+
title
+
",问题内容:"
+
content
;
mailMessage
.
setText
(
text
);
sender
.
send
(
mailMessage
);
Msg
msg
=
new
Msg
(
"提示"
,
"反馈成功,请等待管理员回复"
,
""
);
model
.
addAttribute
(
"msg"
,
msg
);
return
"page/FeedBack"
;
}
catch
(
Exception
e
){
Msg
msg
=
new
Msg
(
"提示"
,
"发生错误,请重新尝试,谢谢"
,
""
);
model
.
addAttribute
(
"msg"
,
msg
);
System
.
out
.
println
(
e
.
getMessage
());
return
"page/FeedBack"
;
}
}
@RequestMapping
(
"/toFeedBack"
)
public
String
toFeedBack
(
Model
model
,
HttpSession
session
){
Msg
msg
=
new
Msg
(
""
,
""
,
""
);
model
.
addAttribute
(
"msg"
,
msg
);
return
"page/FeedBack"
;
}
}
src/main/java/com/pyc/campus/controller/FriendListController.java
0 → 100644
浏览文件 @
bd2fa6dc
package
com.pyc.campus.controller
;
import
com.pyc.campus.dao.FriendListRepository
;
import
com.pyc.campus.dao.StudentRepository
;
import
com.pyc.campus.domain.FriendList
;
import
com.pyc.campus.domain.Msg
;
import
com.pyc.campus.domain.Student
;
import
org.springframework.data.repository.query.Param
;
import
org.springframework.security.core.context.SecurityContextImpl
;
import
org.springframework.security.core.userdetails.UserDetails
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.ui.Model
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
javax.servlet.http.HttpSession
;
import
java.util.List
;
/**
* @author 御承扬
* @product IntelliJ IDEA
* @project campus
* @file FrindListController
* @pack com.pyc.campus.controller
* @date 2021/1/27
* @time 11:44
* @E-mail 2923616405@qq.com
**/
@Controller
public
class
FriendListController
{
final
FriendListRepository
friendListRepository
;
final
StudentRepository
studentRepository
;
public
FriendListController
(
FriendListRepository
friendListRepository
,
StudentRepository
studentRepository
){
this
.
friendListRepository
=
friendListRepository
;
this
.
studentRepository
=
studentRepository
;
}
@RequestMapping
(
"/toMyFriend"
)
public
String
toMyFriend
(
Model
model
,
HttpSession
session
){
SecurityContextImpl
securityContext
=
(
SecurityContextImpl
)
session
.
getAttribute
(
"SPRING_SECURITY_CONTEXT"
);
String
currentStudentId
=
((
UserDetails
)
securityContext
.
getAuthentication
().
getPrincipal
()).
getUsername
();
Student
s
=
studentRepository
.
findNameByStudentID
(
currentStudentId
);
List
<
FriendList
>
tempFl
=
friendListRepository
.
toNameIsFalseByFromName
(
currentStudentId
);
List
<
FriendList
>
Fl
=
friendListRepository
.
findMyFriendsByFromName
(
currentStudentId
);
List
<
FriendList
>
Fl1
=
friendListRepository
.
findMyFriendsByToName
(
currentStudentId
);
model
.
addAttribute
(
"tempFl"
,
tempFl
);
model
.
addAttribute
(
"Fl"
,
Fl
);
model
.
addAttribute
(
"Fl1"
,
Fl1
);
return
"page/MyFriend"
;
}
@RequestMapping
(
"/toAddFriend"
)
public
String
toAddFriend
(
Model
model
,
HttpSession
session
)
{
Msg
msg
=
new
Msg
(
"注意"
,
"添加好友时请输入对方的学号,而不是姓名!"
,
""
);
model
.
addAttribute
(
"msg"
,
msg
);
return
"page/AddFriend"
;
}
@RequestMapping
(
"/addFriend"
)
public
String
addFriend
(
Model
model
,
HttpSession
session
,
@Param
(
"fromName"
)
String
fromName
,
@Param
(
"toName"
)
String
toName
){
Student
stu
=
studentRepository
.
findAllByStudentID
(
toName
);
if
(
stu
==
null
)
{
Msg
msg
=
new
Msg
(
"错误"
,
"你所添加的用户不存在,请检查输入是否错误"
,
""
);
model
.
addAttribute
(
"msg"
,
msg
);
return
"page/AddFriend"
;
}
FriendList
fl
=
new
FriendList
(
fromName
,
toName
);
friendListRepository
.
save
(
fl
);
Msg
msg
=
new
Msg
(
"OK"
,
"请耐心等待对方通过申请"
,
""
);
model
.
addAttribute
(
"msg"
,
msg
);
return
"page/AddFriend"
;
}
@RequestMapping
(
"/toVerifyFriend"
)
public
String
toVerifyFriend
(
Model
model
,
HttpSession
session
)
{
SecurityContextImpl
securityContext
=
(
SecurityContextImpl
)
session
.
getAttribute
(
"SPRING_SECURITY_CONTEXT"
);
String
currentStudentId
=
((
UserDetails
)
securityContext
.
getAuthentication
().
getPrincipal
()).
getUsername
();
Student
s
=
studentRepository
.
findNameByStudentID
(
currentStudentId
);
List
<
FriendList
>
fl
=
friendListRepository
.
toNameIsFalseByToName
(
currentStudentId
);
int
len
=
fl
.
size
();
Msg
msg
=
new
Msg
(
"待验证好友申请数量:"
,
"一共"
+
len
+
"个"
,
""
);
model
.
addAttribute
(
"msg"
,
msg
);
model
.
addAttribute
(
"fl"
,
fl
);
return
"page/VerifyFriend"
;
}
@RequestMapping
(
"/verifyFriend"
)
public
String
verifyFried
(
Model
model
,
HttpSession
session
,
@Param
(
"fromName"
)
String
fromName
){
SecurityContextImpl
securityContext
=
(
SecurityContextImpl
)
session
.
getAttribute
(
"SPRING_SECURITY_CONTEXT"
);
String
currentStudentId
=
((
UserDetails
)
securityContext
.
getAuthentication
().
getPrincipal
()).
getUsername
();
Student
s
=
studentRepository
.
findNameByStudentID
(
currentStudentId
);
int
result
=
friendListRepository
.
setStatus
(
fromName
,
currentStudentId
);
List
<
FriendList
>
fl
=
friendListRepository
.
toNameIsFalseByToName
(
currentStudentId
);
int
len
=
fl
.
size
();
if
(
result
!=
0
){
Msg
msg
=
new
Msg
(
"待验证好友申请数量:"
,
"一共"
+
len
+
"个"
,
""
);
model
.
addAttribute
(
"msg"
,
msg
);
model
.
addAttribute
(
"fl"
,
fl
);
return
"page/VerifyFriend"
;
}
Msg
msg
=
new
Msg
(
"错误:"
,
"请检查输入的学号"
,
""
);
model
.
addAttribute
(
"msg"
,
msg
);
model
.
addAttribute
(
"fl"
,
fl
);
return
"page/VerifyFriend"
;
}
@RequestMapping
(
"/toPrivateChat"
)
public
String
toPrivateChat
(
Model
model
,
HttpSession
session
,
@Param
(
"toName"
)
String
toName
){
SecurityContextImpl
securityContext
=
(
SecurityContextImpl
)
session
.
getAttribute
(
"SPRING_SECURITY_CONTEXT"
);
String
currentStudentId
=
((
UserDetails
)
securityContext
.
getAuthentication
().
getPrincipal
()).
getUsername
();
Student
toUse
=
studentRepository
.
findNameByStudentID
(
toName
);
model
.
addAttribute
(
"curUser"
,
toUse
);
boolean
s
;
FriendList
s1
=
friendListRepository
.
getStatus
(
currentStudentId
,
toName
);
FriendList
s2
=
friendListRepository
.
getStatus
(
toName
,
currentStudentId
);
if
(
s1
!=
null
)
s
=
s1
.
getStatus
();
else
if
(
s2
!=
null
)
s
=
s2
.
getStatus
();
else
s
=
false
;
model
.
addAttribute
(
"friendStatus"
,
s
);
if
(
s
)
{
boolean
stu
=
studentRepository
.
getOnlineStatus
(
toName
).
isOnlineStatus
();
model
.
addAttribute
(
"onlineStatus"
,
stu
);
if
(
stu
)
{
Msg
msg
=
new
Msg
(
"提示:"
,
"对方在线,当前只提供临时聊天,不保存聊天记录,见谅"
,
""
);
model
.
addAttribute
(
"fromName"
,
currentStudentId
);
model
.
addAttribute
(
"toName"
,
toName
);
model
.
addAttribute
(
"msg"
,
msg
);
return
"page/PrivateChat"
;
}
Msg
msg
=
new
Msg
(
"提示:"
,
"对方不在线,你所发送的消息,可能无法被及时回复"
,
""
);
model
.
addAttribute
(
"fromName"
,
currentStudentId
);
model
.
addAttribute
(
"toName"
,
toName
);
model
.
addAttribute
(
"msg"
,
msg
);
return
"page/PrivateChat"
;
}
Msg
msg
=
new
Msg
(
"提示:"
,
"对方不是你的好友,无法进行私聊"
,
""
);
model
.
addAttribute
(
"fromName"
,
currentStudentId
);
model
.
addAttribute
(
"toName"
,
toName
);
model
.
addAttribute
(
"msg"
,
msg
);
return
"page/PrivateChat"
;
}
}
src/main/java/com/pyc/campus/controller/GradeController.java
0 → 100644
浏览文件 @
bd2fa6dc
package
com.pyc.campus.controller
;
import
com.pyc.campus.dao.GradeRepository
;
import
com.pyc.campus.dao.StudentRepository
;
import
com.pyc.campus.domain.Grade
;
import
com.pyc.campus.domain.Msg
;
import
com.pyc.campus.domain.Student
;
import
org.springframework.data.repository.query.Param
;
import
org.springframework.security.core.context.SecurityContextImpl
;
import
org.springframework.security.core.userdetails.UserDetails
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.ui.Model
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
javax.servlet.http.HttpSession
;
import
java.util.List
;
/**
* @author 御承扬
* @product IntelliJ IDEA
* @project campus
* @file GradeController
* @pack com.pyc.campus.controller
* @date 2021/1/27
* @time 11:46
* @E-mail 2923616405@qq.com
**/
@Controller
public
class
GradeController
{
final
GradeRepository
gradeRepository
;
final
StudentRepository
studentRepository
;
public
GradeController
(
GradeRepository
gradeRepository
,
StudentRepository
studentRepository
){
this
.
gradeRepository
=
gradeRepository
;
this
.
studentRepository
=
studentRepository
;
}
@RequestMapping
(
"/desc"
)
public
String
desc
(
Model
model
,
HttpSession
session
){
SecurityContextImpl
securityContext
=
(
SecurityContextImpl
)
session
.
getAttribute
(
"SPRING_SECURITY_CONTEXT"
);
String
currentStudentId
=
((
UserDetails
)
securityContext
.
getAuthentication
().
getPrincipal
()).
getUsername
();
if
(
gradeRepository
.
findAllByStudentID
(
currentStudentId
)!=
null
){
try
{
List
<
Grade
>
gradeListDesc
=
gradeRepository
.
findAllByStudentIDOrderByGradeDesc
(
currentStudentId
);
model
.
addAttribute
(
"gradeItems"
,
gradeListDesc
);
int
minGrade
=
gradeRepository
.
findMinGrade
(
currentStudentId
);
model
.
addAttribute
(
"minGrade"
,
minGrade
);
int
maxGrade
=
gradeRepository
.
findMaxGrade
(
currentStudentId
);
int
sumCredit
=
gradeRepository
.
findSumCredit
(
currentStudentId
);
float
avgGPA
=
gradeRepository
.
findAvgGPA
(
currentStudentId
);
model
.
addAttribute
(
"maxGrade"
,
maxGrade
);
model
.
addAttribute
(
"sumCredit"
,
sumCredit
);
model
.
addAttribute
(
"avgGPA"
,
avgGPA
);
}
catch
(
Exception
e
)
{
System
.
out
.
println
(
e
.
getMessage
());
model
.
addAttribute
(
"minGrade"
,
"未查到你的课程成绩,亲您联系科任老师!"
);
model
.
addAttribute
(
"maxGrade"
,
"未查到你的课程成绩,亲您联系科任老师!"
);
model
.
addAttribute
(
"sumCredit"
,
"未查到你的课程成绩,亲您联系科任老师!"
);
model
.
addAttribute
(
"avgGPA"
,
"未查到你的课程成绩,亲您联系科任老师!"
);
model
.
addAttribute
(
"gradeItems"
,
null
);
}
}
else
{
model
.
addAttribute
(
"minGrade"
,
"未查到你的课程成绩,亲您联系科任老师!"
);
model
.
addAttribute
(
"maxGrade"
,
"未查到你的课程成绩,亲您联系科任老师!"
);
model
.
addAttribute
(
"sumCredit"
,
"未查到你的课程成绩,亲您联系科任老师!"
);
model
.
addAttribute
(
"avgGPA"
,
"未查到你的课程成绩,亲您联系科任老师!"
);
model
.
addAttribute
(
"gradeItems"
,
null
);
}
return
"page/QueryGrade"
;
}
@RequestMapping
(
"/asc"
)
public
String
asc
(
Model
model
,
HttpSession
session
){
SecurityContextImpl
securityContext
=
(
SecurityContextImpl
)
session
.
getAttribute
(
"SPRING_SECURITY_CONTEXT"
);
String
currentStudentId
=
((
UserDetails
)
securityContext
.
getAuthentication
().
getPrincipal
()).
getUsername
();
if
(
gradeRepository
.
findAllByStudentID
(
currentStudentId
)!=
null
){
try
{
List
<
Grade
>
gradeListAsc
=
gradeRepository
.
findAllByStudentIDOrderByGradeAsc
(
currentStudentId
);
int
minGrade
=
gradeRepository
.
findMinGrade
(
currentStudentId
);
int
maxGrade
=
gradeRepository
.
findMaxGrade
(
currentStudentId
);
int
sumCredit
=
gradeRepository
.
findSumCredit
(
currentStudentId
);
float
avgGPA
=
gradeRepository
.
findAvgGPA
(
currentStudentId
);
model
.
addAttribute
(
"minGrade"
,
minGrade
);
model
.
addAttribute
(
"maxGrade"
,
maxGrade
);
model
.
addAttribute
(
"sumCredit"
,
sumCredit
);
model
.
addAttribute
(
"avgGPA"
,
avgGPA
);
model
.
addAttribute
(
"gradeItems"
,
gradeListAsc
);
}
catch
(
Exception
e
)
{
System
.
out
.
println
(
e
.
getMessage
());
model
.
addAttribute
(
"minGrade"
,
"未查到你的课程成绩,亲您联系科任老师!"
);
model
.
addAttribute
(
"maxGrade"
,
"未查到你的课程成绩,亲您联系科任老师!"
);
model
.
addAttribute
(
"sumCredit"
,
"未查到你的课程成绩,亲您联系科任老师!"
);
model
.
addAttribute
(
"avgGPA"
,
"未查到你的课程成绩,亲您联系科任老师!"
);
model
.
addAttribute
(
"gradeItems"
,
null
);
}
}
else
{
model
.
addAttribute
(
"minGrade"
,
"未查到你的课程成绩,亲您联系科任老师!"
);
model
.
addAttribute
(
"maxGrade"
,
"未查到你的课程成绩,亲您联系科任老师!"
);
model
.
addAttribute
(
"sumCredit"
,
"未查到你的课程成绩,亲您联系科任老师!"
);
model
.
addAttribute
(
"avgGPA"
,
"未查到你的课程成绩,亲您联系科任老师!"
);
model
.
addAttribute
(
"gradeItems"
,
null
);
}
return
"page/QueryGrade"
;
}
@RequestMapping
(
"/toQueryGrade"
)
public
String
toQueryGrade
(
Model
model
,
HttpSession
session
){
SecurityContextImpl
securityContext
=
(
SecurityContextImpl
)
session
.
getAttribute
(
"SPRING_SECURITY_CONTEXT"
);
String
currentStudentId
=
((
UserDetails
)
securityContext
.
getAuthentication
().
getPrincipal
()).
getUsername
();
if
(
gradeRepository
.
findAllByStudentID
(
currentStudentId
)!=
null
){
try
{
List
<
Grade
>
gradeList
=
gradeRepository
.
findAllByStudentID
(
currentStudentId
);
int
minGrade
=
gradeRepository
.
findMinGrade
(
currentStudentId
);
int
maxGrade
=
gradeRepository
.
findMaxGrade
(
currentStudentId
);
int
sumCredit
=
gradeRepository
.
findSumCredit
(
currentStudentId
);
float
avgGPA
=
gradeRepository
.
findAvgGPA
(
currentStudentId
);
model
.
addAttribute
(
"minGrade"
,
minGrade
);
model
.
addAttribute
(
"maxGrade"
,
maxGrade
);
model
.
addAttribute
(
"sumCredit"
,
sumCredit
);
model
.
addAttribute
(
"avgGPA"
,
avgGPA
);
model
.
addAttribute
(
"gradeItems"
,
gradeList
);
}
catch
(
Exception
e
){
System
.
out
.
println
(
e
.
getMessage
());
model
.
addAttribute
(
"minGrade"
,
"未查到你的课程成绩,亲您联系科任老师!"
);
model
.
addAttribute
(
"maxGrade"
,
"未查到你的课程成绩,亲您联系科任老师!"
);
model
.
addAttribute
(
"sumCredit"
,
"未查到你的课程成绩,亲您联系科任老师!"
);
model
.
addAttribute
(
"avgGPA"
,
"未查到你的课程成绩,亲您联系科任老师!"
);
model
.
addAttribute
(
"gradeItems"
,
null
);
}
}
else
{
model
.
addAttribute
(
"minGrade"
,
"未查到你的课程成绩,亲您联系科任老师!"
);
model
.
addAttribute
(
"maxGrade"
,
"未查到你的课程成绩,亲您联系科任老师!"
);
model
.
addAttribute
(
"sumCredit"
,
"未查到你的课程成绩,亲您联系科任老师!"
);
model
.
addAttribute
(
"avgGPA"
,
"未查到你的课程成绩,亲您联系科任老师!"
);
model
.
addAttribute
(
"gradeItems"
,
null
);
}
return
"page/QueryGrade"
;
}
@RequestMapping
(
"/queryByTerm"
)
public
String
queryByTerm
(
Model
model
,
HttpSession
session
,
@Param
(
"term"
)
String
term
){
SecurityContextImpl
securityContext
=
(
SecurityContextImpl
)
session
.
getAttribute
(
"SPRING_SECURITY_CONTEXT"
);
String
currentStudentId
=
((
UserDetails
)
securityContext
.
getAuthentication
().
getPrincipal
()).
getUsername
();
List
<
Grade
>
gradeLists
=
gradeRepository
.
findAllByTermAndStudentID
(
term
,
currentStudentId
);
model
.
addAttribute
(
"gradeItems"
,
gradeLists
);
return
"page/QueryGrade"
;
}
@RequestMapping
(
"/toImportGrade"
)
public
String
toImportGrade
(
Model
model
,
HttpSession
session
){
SecurityContextImpl
securityContext
=
(
SecurityContextImpl
)
session
.
getAttribute
(
"SPRING_SECURITY_CONTEXT"
);
String
currentStudentId
=
((
UserDetails
)
securityContext
.
getAuthentication
().
getPrincipal
()).
getUsername
();
Student
s
=
studentRepository
.
findNameByStudentID
(
currentStudentId
);
model
.
addAttribute
(
"curUse"
,
s
);
Msg
msg
=
new
Msg
(
""
,
""
,
""
);
model
.
addAttribute
(
"msg"
,
msg
);
return
"page/ImportGrade"
;
}
}
src/main/java/com/pyc/campus/controller/NewsController.java
0 → 100644
浏览文件 @
bd2fa6dc
package
com.pyc.campus.controller
;
import
com.pyc.campus.dao.NewsRepository
;
import
com.pyc.campus.dao.StudentRepository
;
import
com.pyc.campus.domain.News
;
import
com.pyc.campus.domain.Student
;
import
org.springframework.data.repository.query.Param
;
import
org.springframework.security.core.context.SecurityContextImpl
;
import
org.springframework.security.core.userdetails.UserDetails
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.ui.Model
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
javax.servlet.http.HttpSession
;
import
java.util.List
;
/**
* @author 御承扬
* @product IntelliJ IDEA
* @project campus
* @file NewsController
* @pack com.pyc.campus.controller
* @date 2021/1/27
* @time 12:11
* @E-mail 2923616405@qq.com
**/
@Controller
public
class
NewsController
{
final
NewsRepository
newsRepository
;
final
StudentRepository
studentRepository
;
public
NewsController
(
NewsRepository
newsRepository
,
StudentRepository
studentRepository
){
this
.
newsRepository
=
newsRepository
;
this
.
studentRepository
=
studentRepository
;
}
@RequestMapping
(
"/news"
)
public
String
news
(
Model
model
,
HttpSession
session
)
{
List
<
News
>
news
=
newsRepository
.
findAll
();
model
.
addAttribute
(
"news"
,
news
);
return
"page/BrowseNews"
;
}
@RequestMapping
(
"/publishNews"
)
public
String
publishNews
(
Model
model
,
HttpSession
session
){
SecurityContextImpl
securityContext
=
(
SecurityContextImpl
)
session
.
getAttribute
(
"SPRING_SECURITY_CONTEXT"
);
String
currentStudentId
=
((
UserDetails
)
securityContext
.
getAuthentication
().
getPrincipal
()).
getUsername
();
Student
s
=
studentRepository
.
findNameByStudentID
(
currentStudentId
);
model
.
addAttribute
(
"curUse"
,
s
);
return
"page/PublishNews"
;
}
@RequestMapping
(
"/saveNews"
)
public
String
saveNews
(
Model
model
,
HttpSession
session
,
@Param
(
"title"
)
String
title
,
@Param
(
"content"
)
String
content
){
SecurityContextImpl
securityContext
=
(
SecurityContextImpl
)
session
.
getAttribute
(
"SPRING_SECURITY_CONTEXT"
);
String
currentStudentId
=
((
UserDetails
)
securityContext
.
getAuthentication
().
getPrincipal
()).
getUsername
();
Student
s
=
studentRepository
.
findNameByStudentID
(
currentStudentId
);
model
.
addAttribute
(
"curUse"
,
s
);
long
i
=
0
;
List
<
News
>
list
=
newsRepository
.
findAll
();
for
(
News
l:
list
){
if
(
l
!=
null
)
{
i
++;
}
}
long
nextId
=
i
+
1
;
News
news
=
new
News
(
nextId
,
title
,
content
);
newsRepository
.
save
(
news
);
return
"/page/PublishNews"
;
}
}
src/main/java/com/pyc/campus/controller/QuestionController.java
0 → 100644
浏览文件 @
bd2fa6dc
package
com.pyc.campus.controller
;
import
com.pyc.campus.config.MailConfig
;
import
com.pyc.campus.dao.QuestionRepository
;
import
com.pyc.campus.domain.Msg
;
import
com.pyc.campus.domain.Question
;
import
org.springframework.data.repository.query.Param
;
import
org.springframework.mail.SimpleMailMessage
;
import
org.springframework.mail.javamail.JavaMailSender
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.ui.Model
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
javax.servlet.http.HttpSession
;
import
java.util.List
;
/**
* @author 御承扬
* @product IntelliJ IDEA
* @project campus
* @file QuestionController
* @pack com.pyc.campus.controller
* @date 2021/1/27
* @time 12:04
* @E-mail 2923616405@qq.com
**/
@Controller
public
class
QuestionController
{
final
QuestionRepository
questionRepository
;
public
QuestionController
(
QuestionRepository
questionRepository
){
this
.
questionRepository
=
questionRepository
;
}
@RequestMapping
(
"/toBrowserQuestion"
)
public
String
toBrowserQuestion
(
Model
model
,
HttpSession
session
){
List
<
Question
>
questions
=
questionRepository
.
findAll
();
model
.
addAttribute
(
"questions"
,
questions
);
return
"page/BrowserQuestion"
;
}
@RequestMapping
(
"/queryByQuestionType"
)
public
String
queryByQuestionType
(
Model
model
,
HttpSession
session
,
@RequestParam
(
value
=
"TypeOfQuestion"
,
required
=
false
)
String
type
){
List
<
Question
>
questions
=
questionRepository
.
findAllByType
(
type
);
model
.
addAttribute
(
"questions"
,
questions
);
return
"page/BrowserQuestion"
;
}
@RequestMapping
(
"/toUpQuestion"
)
public
String
toUpQuestion
(
Model
model
,
HttpSession
session
){
Msg
msg
=
new
Msg
(
""
,
""
,
""
);
model
.
addAttribute
(
"msg"
,
msg
);
return
"page/UpQuestion"
;
}
@RequestMapping
(
"/upQuestion"
)
public
String
upQuestion
(
Model
model
,
HttpSession
session
,
@Param
(
"mail"
)
String
mail
,
@Param
(
"name"
)
String
name
,
@Param
(
"title"
)
String
title
,
@Param
(
"content"
)
String
content
,
@Param
(
"reward"
)
String
reward
){
try
{
MailConfig
mailConfig
=
new
MailConfig
();
JavaMailSender
sender
=
mailConfig
.
getMailSender
();
SimpleMailMessage
mailMessage
=
new
SimpleMailMessage
();
mailMessage
.
setFrom
(
"15014366986@163.com"
);
mailMessage
.
setTo
(
"2923616405@qq.com"
);
mailMessage
.
setSubject
(
"问题悬赏申请"
);
String
text
=
"发布者:"
+
name
+
",发布者邮箱:"
+
mail
+
",问题标题:"
+
title
+
",问题内容:"
+
content
+
",悬赏:"
+
reward
;
mailMessage
.
setText
(
text
);
sender
.
send
(
mailMessage
);
Msg
msg
=
new
Msg
(
"提示"
,
"申请成功,请等待管理员审核通过"
,
""
);
model
.
addAttribute
(
"msg"
,
msg
);
return
"page/UpQuestion"
;
}
catch
(
Exception
e
){
Msg
msg
=
new
Msg
(
"提示"
,
"发生错误,请重新尝试,谢谢"
,
""
);
model
.
addAttribute
(
"msg"
,
msg
);
System
.
out
.
println
(
e
.
getMessage
());
return
"page/UpQuestion"
;
}
}
@RequestMapping
(
"/toPublishQuestion"
)
public
String
toPublishQuestion
(
Model
model
,
HttpSession
session
){
Msg
msg
=
new
Msg
(
""
,
""
,
""
);
model
.
addAttribute
(
"msg"
,
msg
);
return
"page/PublishQuestion"
;
}
}
src/main/java/com/pyc/campus/controller/StudentController.java
0 → 100644
浏览文件 @
bd2fa6dc
package
com.pyc.campus.controller
;
import
com.pyc.campus.dao.StudentRepository
;
import
com.pyc.campus.domain.Msg
;
import
com.pyc.campus.domain.Student
;
import
org.springframework.data.repository.query.Param
;
import
org.springframework.security.core.context.SecurityContextImpl
;
import
org.springframework.security.core.userdetails.UserDetails
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.ui.Model
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
javax.servlet.http.HttpSession
;
import
java.util.List
;
/**
* @author 御承扬
* @product IntelliJ IDEA
* @project campus
* @file StudentController
* @pack com.pyc.campus.controller
* @date 2021/1/27
* @time 11:40
* @E-mail 2923616405@qq.com
**/
@Controller
public
class
StudentController
{
final
StudentRepository
studentRepository
;
public
StudentController
(
StudentRepository
studentRepository
){
this
.
studentRepository
=
studentRepository
;
}
@RequestMapping
(
"/userCenter"
)
public
String
userCenter
(
Model
model
,
HttpSession
session
){
SecurityContextImpl
securityContext
=
(
SecurityContextImpl
)
session
.
getAttribute
(
"SPRING_SECURITY_CONTEXT"
);
String
currentStudentId
=
((
UserDetails
)
securityContext
.
getAuthentication
().
getPrincipal
()).
getUsername
();
Student
s
=
studentRepository
.
findNameByStudentID
(
currentStudentId
);
Msg
msg
=
new
Msg
(
""
,
""
,
""
);
model
.
addAttribute
(
"msg"
,
msg
);
model
.
addAttribute
(
"curUse"
,
s
);
return
"page/UserCenter"
;
}
@RequestMapping
(
"/saveOnlineStatus"
)
public
String
saveOnlineStatus
(
Model
model
,
HttpSession
session
,
@Param
(
"onlineStatus"
)
Boolean
onlineStatus
)
{
SecurityContextImpl
securityContext
=
(
SecurityContextImpl
)
session
.
getAttribute
(
"SPRING_SECURITY_CONTEXT"
);
String
currentStudentId
=
((
UserDetails
)
securityContext
.
getAuthentication
().
getPrincipal
()).
getUsername
();
Student
s
=
studentRepository
.
findNameByStudentID
(
currentStudentId
);
studentRepository
.
setOnlineStatus
(
onlineStatus
,
currentStudentId
);
Msg
msg
=
new
Msg
(
""
,
""
,
""
);
model
.
addAttribute
(
"msg"
,
msg
);
return
"page/UserCenter"
;
}
@RequestMapping
(
"/toBrowseFriendInfo"
)
public
String
toBrowseFriendInfo
(
Model
model
,
HttpSession
session
,
@Param
(
"toName"
)
String
toName
){
Student
stu
=
studentRepository
.
findNameByStudentID
(
toName
);
Msg
msg
=
new
Msg
(
""
,
""
,
""
);
model
.
addAttribute
(
"msg"
,
msg
);
model
.
addAttribute
(
"stu"
,
stu
);
return
"page/BrowseFriendInfo"
;
}
@RequestMapping
(
"/toChangePWD"
)
public
String
toChangePWD
(
Model
model
,
HttpSession
session
){
SecurityContextImpl
securityContext
=
(
SecurityContextImpl
)
session
.
getAttribute
(
"SPRING_SECURITY_CONTEXT"
);
String
currentStudentId
=
((
UserDetails
)
securityContext
.
getAuthentication
().
getPrincipal
()).
getUsername
();
Student
s
=
studentRepository
.
findNameByStudentID
(
currentStudentId
);
model
.
addAttribute
(
"curUser"
,
s
);
Msg
msg
=
new
Msg
(
""
,
""
,
""
);
model
.
addAttribute
(
"msg"
,
msg
);
return
"page/ChangePWD"
;
}
@RequestMapping
(
"/updateUserInfo"
)
public
String
updateUserInfo
(
Model
model
,
HttpSession
session
){
SecurityContextImpl
securityContext
=
(
SecurityContextImpl
)
session
.
getAttribute
(
"SPRING_SECURITY_CONTEXT"
);
String
currentStudentId
=
((
UserDetails
)
securityContext
.
getAuthentication
().
getPrincipal
()).
getUsername
();
Student
s
=
studentRepository
.
findNameByStudentID
(
currentStudentId
);
model
.
addAttribute
(
"curUse"
,
s
);
Msg
msg
=
new
Msg
(
"提示!"
,
"学号作为用户标识ID,不允许更改"
,
""
);
model
.
addAttribute
(
"msg"
,
msg
);
return
"page/UpdateUserInfo"
;
}
@RequestMapping
(
"/updateUInfo"
)
public
String
updateUInfo
(
Model
model
,
HttpSession
session
,
@Param
(
"username"
)
String
username
,
@Param
(
"weChat"
)
String
weChat
,
@RequestParam
(
value
=
"TencentQQ"
,
required
=
false
)
String
qq
){
SecurityContextImpl
securityContext
=
(
SecurityContextImpl
)
session
.
getAttribute
(
"SPRING_SECURITY_CONTEXT"
);
String
currentStudentId
=
((
UserDetails
)
securityContext
.
getAuthentication
().
getPrincipal
()).
getUsername
();
System
.
out
.
println
(
"QQ:"
+
qq
);
int
result
=
studentRepository
.
update
(
username
,
weChat
,
qq
,
currentStudentId
);
if
(
result
==
0
){
Msg
msg
=
new
Msg
(
"提示"
,
"对不起,是我们的错,信息没有成功更新,请再试几次,或者连续网站管理员"
,
""
);
model
.
addAttribute
(
"msg"
,
msg
);
return
"page/UpdateUserInfo"
;
}
Msg
msg
=
new
Msg
(
"提示"
,
"信息更新成功!"
,
""
);
Student
s
=
studentRepository
.
findNameByStudentID
(
currentStudentId
);
model
.
addAttribute
(
"curUse"
,
s
);
model
.
addAttribute
(
"msg"
,
msg
);
return
"page/UserCenter"
;
}
@RequestMapping
(
"/saveFrozenInTrue"
)
public
String
saveFrozenInTrue
(
Model
model
,
HttpSession
session
,
@RequestParam
(
value
=
"studentId"
,
required
=
false
)
String
studentID
){
int
t
=
studentRepository
.
saveFrozen
(
true
,
studentID
);
if
(
t
!=
0
){
System
.
out
.
println
(
"更新成功!"
);
}
else
{
System
.
out
.
println
(
"更新失败!"
);
}
List
<
Student
>
students
=
studentRepository
.
findAll
();
model
.
addAttribute
(
"students"
,
students
);
return
"page/ManageUser"
;
}
@RequestMapping
(
"/saveFrozenInFalse"
)
public
String
saveFrozenInFalse
(
Model
model
,
HttpSession
session
,
@RequestParam
(
value
=
"studentId"
,
required
=
false
)
String
studentID
){
int
t
=
studentRepository
.
saveFrozen
(
false
,
studentID
);
if
(
t
!=
0
){
System
.
out
.
println
(
"更新成功!"
);
}
else
{
System
.
out
.
println
(
"更新失败!"
);
}
List
<
Student
>
students
=
studentRepository
.
findAll
();
model
.
addAttribute
(
"students"
,
students
);
return
"page/ManageUser"
;
}
}
src/main/java/com/pyc/campus/controller/WebController.java
浏览文件 @
bd2fa6dc
此差异已折叠。
点击以展开。
src/main/java/com/pyc/campus/dao/SaveUserPasswordEncodeRepository.java
浏览文件 @
bd2fa6dc
...
...
@@ -2,6 +2,9 @@ package com.pyc.campus.dao;
import
com.pyc.campus.domain.SaveUserPasswordEncode
;
import
org.springframework.data.jpa.repository.JpaRepository
;
import
org.springframework.data.jpa.repository.Modifying
;
import
org.springframework.data.jpa.repository.Query
;
import
org.springframework.transaction.annotation.Transactional
;
/**
* @author 御承扬
...
...
@@ -15,4 +18,8 @@ import org.springframework.data.jpa.repository.JpaRepository;
**/
public
interface
SaveUserPasswordEncodeRepository
extends
JpaRepository
<
SaveUserPasswordEncode
,
Long
>
{
SaveUserPasswordEncode
findAllByStuID
(
String
stuID
);
@Modifying
@Transactional
@Query
(
"update SaveUserPasswordEncode sp set sp.encodePassword=?1 where sp.stuID=?2"
)
int
updateEncodePasswordByStuID
(
String
encodePassword
,
String
stuID
);
}
src/main/resources/templates/page/AddFriend.html
浏览文件 @
bd2fa6dc
...
...
@@ -134,7 +134,7 @@
<li><a
href=
"/userCenter"
>
信息查看
</a>
</li>
<li><a
href=
"/updateUserInfo"
target=
"_blank"
>
更新信息
</a></li>
<li><a
href=
"/sign"
target=
"_blank"
>
注册
</a></li>
<li><a
href=
"/toChangePWD"
target=
"_blank"
>
修改密码
</a></li>
<li><a
href=
"/toChangePWD"
>
修改密码
</a></li>
<li><a
href=
"/toQueryGrade"
target=
"_blank"
>
查看课程成绩
</a>
</li>
<li><a
href=
"/toUpQuestion"
target=
"_blank"
>
申请问题悬赏
</a>
</li>
<li><a
href=
"/toBrowserQuestion"
target=
"_blank"
>
浏览悬赏问题
</a>
</li>
...
...
src/main/resources/templates/page/Login.html
浏览文件 @
bd2fa6dc
...
...
@@ -21,10 +21,11 @@
<body>
<div
style=
"margin: 5% 25%"
>
<p
th:if=
"${param.error}"
class=
"bg-danger"
>
账号处于冻结状态或用户名未注册
</p>
<div
class=
"starter-template"
>
<
!--<
div class="starter-template">
<h1 th:text="${msg.title}"></h1>
<p class="bg-primary" th:text="${msg.content}"></p>
</div>
</div>-->
<h1>
登陆
</h1>
<form
class=
"form-horizontal"
name=
"form"
id=
"form"
method=
"post"
th:action=
"@{/login}"
action=
"/login"
onsubmit=
"return checkPWD(form.password,form.checkPassword)"
>
<div
class=
"input-group input-group-lg"
>
...
...
src/main/resources/templates/page/MyFriend.html
浏览文件 @
bd2fa6dc
...
...
@@ -138,7 +138,7 @@
<li><a
href=
"/userCenter"
>
信息查看
</a>
</li>
<li><a
href=
"/updateUserInfo"
target=
"_blank"
>
更新信息
</a></li>
<li><a
href=
"/sign"
target=
"_blank"
>
注册
</a></li>
<li><a
href=
"/toChangePWD"
target=
"_blank"
>
修改密码
</a></li>
<li><a
href=
"/toChangePWD"
>
修改密码
</a></li>
<li><a
href=
"/toQueryGrade"
target=
"_blank"
>
查看课程成绩
</a>
</li>
<li><a
href=
"/toUpQuestion"
target=
"_blank"
>
申请问题悬赏
</a>
</li>
<li><a
href=
"/toBrowserQuestion"
target=
"_blank"
>
浏览悬赏问题
</a>
</li>
...
...
src/main/resources/templates/page/UserCenter.html
浏览文件 @
bd2fa6dc
...
...
@@ -134,7 +134,7 @@
<li
class=
"active"
><a
href=
"#"
>
信息查看
</a>
</li>
<li><a
href=
"/updateUserInfo"
target=
"_blank"
>
更新信息
</a></li>
<li><a
href=
"/sign"
target=
"_blank"
>
注册
</a></li>
<li><a
href=
"/toChangePWD"
target=
"_blank"
>
修改密码
</a></li>
<li><a
href=
"/toChangePWD"
>
修改密码
</a></li>
<li><a
href=
"/toQueryGrade"
target=
"_blank"
>
查看课程成绩
</a>
</li>
<li><a
href=
"/toUpQuestion"
target=
"_blank"
>
申请问题悬赏
</a>
</li>
<li><a
href=
"/toBrowserQuestion"
target=
"_blank"
>
浏览悬赏问题
</a>
</li>
...
...
src/main/resources/templates/page/VerifyFriend.html
浏览文件 @
bd2fa6dc
...
...
@@ -136,7 +136,7 @@
<li><a
href=
"/userCenter"
>
信息查看
</a>
</li>
<li><a
href=
"/updateUserInfo"
target=
"_blank"
>
更新信息
</a></li>
<li><a
href=
"/sign"
target=
"_blank"
>
注册
</a></li>
<li><a
href=
"/toChangePWD"
target=
"_blank"
>
修改密码
</a></li>
<li><a
href=
"/toChangePWD"
>
修改密码
</a></li>
<li><a
href=
"/toQueryGrade"
target=
"_blank"
>
查看课程成绩
</a>
</li>
<li><a
href=
"/toUpQuestion"
target=
"_blank"
>
申请问题悬赏
</a>
</li>
<li><a
href=
"/toBrowserQuestion"
target=
"_blank"
>
浏览悬赏问题
</a>
</li>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录