Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
spring-microservice-exam
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
汪想
spring-microservice-exam
Commits
01554785
Commit
01554785
authored
Feb 23, 2020
by
tangyi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化
parent
73d78bb8
Hide whitespace changes
Inline
Side-by-side
Showing
27 changed files
with
262 additions
and
272 deletions
+262
-272
README.md
README.md
+2
-1
SwaggerConfig.java
...n/java/com/github/tangyi/common/config/SwaggerConfig.java
+2
-2
gateway-service.yml
config-service/src/main/resources/config/gateway-service.yml
+0
-1
logback.xml
config-service/src/main/resources/logback.xml
+5
-5
docker-compose.env
docs/deploy/docker-compose.env
+2
-2
microservice_auth.sql
docs/deploy/mysql/init/microservice_auth.sql
+0
-1
microservice_gateway.sql
docs/deploy/mysql/init/microservice_gateway.sql
+1
-2
microservice_user.sql
docs/deploy/mysql/init/microservice_user.sql
+0
-0
microservice-exam-user.sql
docs/deploy/mysql/update/microservice-exam-user.sql
+0
-13
index.vue
...rvice-exam-ui/src/components/Subjects/Judgement/index.vue
+138
-140
permission.js
frontend/spring-microservice-exam-ui/src/permission.js
+2
-1
examRecord.vue
...spring-microservice-exam-ui/src/views/exam/examRecord.vue
+2
-5
markExam.vue
...d/spring-microservice-exam-ui/src/views/exam/markExam.vue
+2
-2
menu.vue
frontend/spring-microservice-exam-ui/src/views/sys/menu.vue
+1
-1
index.vue
...vice-exam-web/src/components/Subjects/Judgement/index.vue
+42
-42
permission.js
frontend/spring-microservice-exam-web/src/permission.js
+5
-3
getters.js
frontend/spring-microservice-exam-web/src/store/getters.js
+2
-1
PreviewConfigLoader.java
...thub/tangyi/gateway/cache/loader/PreviewConfigLoader.java
+2
-2
GatewayExceptionHandler.java
...ithub/tangyi/gateway/handler/GatewayExceptionHandler.java
+2
-2
logback.xml
gateway-service/src/main/resources/logback.xml
+7
-7
logback.xml
...ervice-parent/auth-service/src/main/resources/logback.xml
+7
-7
logback.xml
...ervice-parent/exam-service/src/main/resources/logback.xml
+7
-7
logback.xml
...service-parent/msc-service/src/main/resources/logback.xml
+7
-7
DashboardController.java
...om/github/tangyi/user/controller/DashboardController.java
+9
-3
UserService.java
...main/java/com/github/tangyi/user/service/UserService.java
+1
-1
logback.xml
...ervice-parent/user-service/src/main/resources/logback.xml
+7
-7
logback.xml
monitor-service/src/main/resources/logback.xml
+7
-7
No files found.
README.md
View file @
01554785
...
...
@@ -23,7 +23,8 @@
| 单位ID | 账号 | 密码 | 角色 |
| --------- | -------- | -------- | -------- |
| gitee | admin | 123456 | 管理员 |
| gitee | admin |
****
**
| 管理员 |
| gitee | preview | 123456 | 预览权限|
| gitee | student | 123456 | 学生 |
| gitee | teacher | 123456 | 老师 |
...
...
common/common-config/src/main/java/com/github/tangyi/common/config/SwaggerConfig.java
View file @
01554785
...
...
@@ -80,11 +80,11 @@ public class SwaggerConfig implements WebMvcConfigurer {
private
ApiInfo
apiInfo
()
{
return
new
ApiInfoBuilder
()
.
title
(
"
Swagger API
"
)
.
title
(
"
硕果云
"
)
.
description
(
"https://gitee.com/wells2333/spring-microservice-exam"
)
.
termsOfServiceUrl
(
"https://gitee.com/wells2333/spring-microservice-exam"
)
.
contact
(
new
Contact
(
"tangyi"
,
"https://gitee.com/wells2333/spring-microservice-exam"
,
"1633736729@qq.com"
))
.
version
(
"3.
4
.0"
)
.
version
(
"3.
6
.0"
)
.
build
();
}
...
...
config-service/src/main/resources/config/gateway-service.yml
View file @
01554785
...
...
@@ -110,7 +110,6 @@ swagger:
preview
:
ignores
:
-
api/auth
# 授权服务
-
resetPassword
# 重置密码
-
register
-
checkExist
-
updateInfo
...
...
config-service/src/main/resources/logback.xml
View file @
01554785
...
...
@@ -39,21 +39,21 @@
</filter>
</appender>
<!-- 输出到logstash的appender,
ELK_DESTINATION
为logstash的IP和端口,从环境变量注入-->
<!--
<appender name="logstash" class="net.logstash.logback.appender.LogstashTcpSocketAppender">
<destination>${
ELK_DESTINATION
}</destination>
<!-- 输出到logstash的appender,
LOGSTASH_HOST
为logstash的IP和端口,从环境变量注入-->
<!--
<appender name="logstash" class="net.logstash.logback.appender.LogstashTcpSocketAppender">
<destination>${
LOGSTASH_HOST
}</destination>
<encoder charset="UTF-8" class="net.logstash.logback.encoder.LogstashEncoder"/>
</appender>-->
<!-- Level: FATAL 0 ERROR 3 WARN 4 INFO 6 DEBUG 7 -->
<root
level=
"
info
"
>
<root
level=
"
warn
"
>
<appender-ref
ref=
"console"
/>
<appender-ref
ref=
"debug"
/>
<appender-ref
ref=
"error"
/>
<!--<appender-ref ref="logstash"/>-->
</root>
<logger
name=
"com.github.tangyi"
level=
"
debug
"
additivity=
"false"
>
<logger
name=
"com.github.tangyi"
level=
"
info
"
additivity=
"false"
>
<appender-ref
ref=
"console"
/>
<appender-ref
ref=
"debug"
/>
<appender-ref
ref=
"error"
/>
...
...
docs/deploy/docker-compose.env
View file @
01554785
...
...
@@ -78,4 +78,4 @@ CLUSTER_DATA_CENTER_ID=1
TZ=Asia/Shanghai
# elk配置
ELK_DESTINATION=localhost:5044
\ No newline at end of file
LOGSTASH_HOST=localhost:5044
\ No newline at end of file
docs/deploy/mysql/init/microservice_auth.sql
View file @
01554785
SET
NAMES
utf8mb4
;
SET
FOREIGN_KEY_CHECKS
=
0
;
...
...
docs/deploy/mysql/init/microservice_gateway.sql
View file @
01554785
SET
NAMES
utf8mb4
;
SET
FOREIGN_KEY_CHECKS
=
0
;
...
...
@@ -28,7 +27,7 @@ CREATE TABLE `sys_route` (
-- ----------------------------
-- Records of sys_route
-- ----------------------------
INSERT
INTO
`sys_route`
VALUES
(
607150228717572096
,
'msc-service'
,
'消息中心'
,
'[{
\"
name
\"
:
\"
Path
\"
,
\"
args
\"
:{
\"
_genkey_0
\"
:
\"
/api/msc/**
\"
}}]'
,
'[{
\"
name
\"
:
\"
StripPrefix
\"
,
\"
args
\"
:{
\"
_genkey_0
\"
:
\"
2
\"
}},{
\"
name
\"
:
\"
RemoveRequestHeader
\"
,
\"
args
\"
:{
\"
_genkey_0
\"
:
\"
Cookie
\"
,
\"
_genkey_1
\"
:
\"
Set-Cookie
\"
}}]'
,
'lb://msc-service'
,
4
,
0
,
'
'
,
'2020-02-05 11:51:41
'
,
''
,
'2020-02-05 11:51:42'
,
0
,
'EXAM'
);
INSERT
INTO
`sys_route`
VALUES
(
607150228717572096
,
'msc-service'
,
'消息中心'
,
'[{
\"
name
\"
:
\"
Path
\"
,
\"
args
\"
:{
\"
_genkey_0
\"
:
\"
/api/msc/**
\"
}}]'
,
'[{
\"
name
\"
:
\"
StripPrefix
\"
,
\"
args
\"
:{
\"
_genkey_0
\"
:
\"
2
\"
}},{
\"
name
\"
:
\"
RemoveRequestHeader
\"
,
\"
args
\"
:{
\"
_genkey_0
\"
:
\"
Cookie
\"
,
\"
_genkey_1
\"
:
\"
Set-Cookie
\"
}}]'
,
'lb://msc-service'
,
4
,
0
,
'
admin'
,
'2020-02-23 14:42:05
'
,
''
,
'2020-02-05 11:51:42'
,
0
,
'EXAM'
);
INSERT
INTO
`sys_route`
VALUES
(
607150228717572097
,
'user-service'
,
'用户服务'
,
'[{
\"
name
\"
:
\"
Path
\"
,
\"
args
\"
: {
\"
_genkey_0
\"
:
\"
/api/user/**
\"
}}]'
,
'[
\n
{
\n
\"
name
\"
:
\"
StripPrefix
\"
,
\n
\"
args
\"
: {
\n
\"
_genkey_0
\"
:
\"
2
\"\n
}
\n
},
\n
{
\n
\"
name
\"
:
\"
RemoveRequestHeader
\"
,
\n
\"
args
\"
: {
\n
\"
_genkey_0
\"
:
\"
Cookie
\"
,
\n
\"
_genkey_1
\"
:
\"
Set-Cookie
\"\n
}
\n
}
\n
]'
,
'lb://user-service'
,
2
,
0
,
'admin'
,
'2020-02-04 14:15:08'
,
''
,
'2019-08-03 09:58:35'
,
0
,
'EXAM'
);
INSERT
INTO
`sys_route`
VALUES
(
607150228717572098
,
'exam-service'
,
'考试服务'
,
'[{
\"
name
\"
:
\"
Path
\"
,
\"
args
\"
:{
\"
_genkey_0
\"
:
\"
/api/exam/**
\"
}}]'
,
'[{
\"
name
\"
:
\"
StripPrefix
\"
,
\"
args
\"
:{
\"
_genkey_0
\"
:
\"
2
\"
}},{
\"
name
\"
:
\"
RemoveRequestHeader
\"
,
\"
args
\"
:{
\"
_genkey_0
\"
:
\"
Cookie
\"
,
\"
_genkey_1
\"
:
\"
Set-Cookie
\"
}}]'
,
'lb://exam-service'
,
3
,
0
,
'admin'
,
'2020-02-05 11:52:19'
,
''
,
'2020-02-05 11:52:19'
,
0
,
'EXAM'
);
INSERT
INTO
`sys_route`
VALUES
(
607150228717572099
,
'auth-service'
,
'认证授权服务'
,
'[{
\"
name
\"
:
\"
Path
\"
,
\"
args
\"
:{
\"
_genkey_0
\"
:
\"
/api/auth/**
\"
}}]'
,
'[
\n
{
\n
\"
name
\"
:
\"
StripPrefix
\"
,
\n
\"
args
\"
: {
\n
\"
_genkey_0
\"
:
\"
2
\"\n
}
\n
},
\n
{
\n
\"
name
\"
:
\"
RemoveRequestHeader
\"
,
\n
\"
args
\"
: {
\n
\"
_genkey_0
\"
:
\"
Cookie
\"
,
\n
\"
_genkey_1
\"
:
\"
Set-Cookie
\"\n
}
\n
}
\n
]'
,
'lb://auth-service'
,
1
,
0
,
'admin'
,
'2020-02-04 14:17:04'
,
''
,
'2020-02-04 14:17:05'
,
0
,
'EXAM'
);
...
...
docs/deploy/mysql/init/microservice_user.sql
View file @
01554785
This source diff could not be displayed because it is too large. You can
view the blob
instead.
docs/deploy/mysql/update/microservice-exam-user.sql
deleted
100644 → 0
View file @
73d78bb8
-- ----------------------------
-- 2019年6月21日14:32:59
-- ----------------------------
ALTER
TABLE
`microservice-user`
.
`sys_attachment`
ADD
COLUMN
`previewUrl`
varchar
(
255
)
NULL
COMMENT
'预览地址'
AFTER
`busi_type`
;
-- ----------------------------
-- 2019年10月17日21:52:01
-- ----------------------------
ALTER
TABLE
`dev_microservice_exam`
.
`exam_examination_subject`
MODIFY
COLUMN
`examination_id`
bigint
(
20
)
NULL
COMMENT
'考试ID'
AFTER
`id`
,
ADD
COLUMN
`category_id`
bigint
(
20
)
NULL
COMMENT
'分类'
AFTER
`examination_id`
;
\ No newline at end of file
frontend/spring-microservice-exam-ui/src/components/Subjects/Judgement/index.vue
View file @
01554785
...
...
@@ -50,144 +50,29 @@
</
template
>
<
script
>
import
Tinymce
from
'@/components/Tinymce'
import
{
isNotEmpty
}
from
'@/utils/util'
import
Tinymce
from
'@/components/Tinymce'
import
{
isNotEmpty
,
message
}
from
'@/utils/util'
export
default
{
name
:
'Judgement'
,
components
:
{
Tinymce
},
props
:
{
subject
:
{
type
:
Object
,
default
:
function
()
{
return
{
id
:
''
,
examinationId
:
undefined
,
categoryId
:
undefined
,
subjectName
:
''
,
type
:
0
,
choicesType
:
0
,
options
:
[
{
subjectChoicesId
:
''
,
optionName
:
'正确'
,
optionContent
:
'正确'
},
{
subjectChoicesId
:
''
,
optionName
:
'错误'
,
optionContent
:
'错误'
}
],
answer
:
{
subjectId
:
''
,
answer
:
''
,
answerType
:
''
,
score
:
''
},
score
:
5
,
analysis
:
''
,
level
:
2
,
editType
:
0
// 0: 输入框,1:富文本
}
}
},
choices
:
{
type
:
String
,
default
:
''
}
},
data
()
{
return
{
subjectInfo
:
this
.
subject
,
choicesContent
:
this
.
choices
,
labelPosition
:
'right'
,
// 表单校验规则
subjectRules
:
{
subjectName
:
[{
required
:
true
,
message
:
'请输入题目名称'
,
trigger
:
'change'
}],
score
:
[{
required
:
true
,
message
:
'请输入题目分值'
,
trigger
:
'change'
}],
answer
:
[{
required
:
true
,
message
:
'请输入答案'
,
trigger
:
'change'
}]
},
tinymce
:
{
type
:
1
,
// 类型 0:题目名称,1:选项
dialogTinymceVisible
:
false
,
tempValue
:
''
,
currentEdit
:
-
1
},
// 编辑对象
tinymceEdit
:
{
subjectName
:
-
1
,
answer
:
4
,
analysis
:
5
},
options
:
[]
}
},
watch
:
{
// 监听富文本编辑器的输入
choicesContent
:
{
handler
:
function
(
choicesContent
)
{
if
(
isNotEmpty
(
this
.
$refs
.
choicesEditor
))
{
if
(
this
.
editType
===
1
&&
this
.
$refs
.
choicesEditor
.
getHasClick
())
{
this
.
saveTinymceContent
(
choicesContent
)
}
}
},
immediate
:
true
}
},
methods
:
{
initDefaultOptions
()
{
this
.
options
=
[
{
subjectChoicesId
:
''
,
optionName
:
'正确'
,
optionContent
:
'正确'
},
{
subjectChoicesId
:
''
,
optionName
:
'错误'
,
optionContent
:
'错误'
}
]
},
setSubjectInfo
(
subject
)
{
this
.
subjectInfo
=
subject
this
.
initDefaultOptions
()
},
getSubjectInfo
()
{
return
this
.
subjectInfo
},
// 绑定富文本的内容
updateTinymceContent
(
content
,
currentEdit
,
type
)
{
// 重置富文本
this
.
choicesContent
=
''
// 绑定当前编辑的对象
this
.
tinymce
.
currentEdit
=
currentEdit
this
.
tinymce
.
type
=
type
this
.
$refs
.
choicesEditor
.
setContent
(
content
||
''
)
this
.
editType
=
0
this
.
$refs
.
choicesEditor
.
setHashClick
(
false
)
},
saveTinymceContent
(
content
)
{
switch
(
this
.
tinymce
.
currentEdit
)
{
case
this
.
tinymceEdit
.
subjectName
:
this
.
subjectInfo
.
subjectName
=
content
break
case
this
.
tinymceEdit
.
answer
:
this
.
subjectInfo
.
answer
.
answer
=
content
break
case
this
.
tinymceEdit
.
analysis
:
this
.
subjectInfo
.
analysis
=
content
break
}
},
// 表单校验
validate
()
{
let
valid
=
false
this
.
$refs
[
'dataSubjectForm'
].
validate
((
validate
)
=>
{
valid
=
validate
})
return
valid
},
clearValidate
()
{
this
.
$refs
[
'dataSubjectForm'
].
clearValidate
()
},
resetTempSubject
(
score
)
{
this
.
subjectInfo
=
{
export
default
{
name
:
'Judgement'
,
components
:
{
Tinymce
},
props
:
{
subject
:
{
type
:
Object
,
default
:
function
()
{
return
{
id
:
''
,
examinationId
:
undefined
,
categoryId
:
undefined
,
subjectName
:
''
,
type
:
0
,
choicesType
:
0
,
options
:
[
{
subjectChoicesId
:
''
,
optionName
:
'正确'
,
optionContent
:
'正确'
},
{
subjectChoicesId
:
''
,
optionName
:
'错误'
,
optionContent
:
'错误'
}
],
answer
:
{
subjectId
:
''
,
answer
:
''
,
...
...
@@ -196,21 +81,134 @@
},
score
:
5
,
analysis
:
''
,
level
:
2
level
:
2
,
editType
:
0
// 0: 输入框,1:富文本
}
// 默认分数
if
(
isNotEmpty
(
score
))
{
this
.
subjectInfo
.
score
=
score
}
},
choices
:
{
type
:
String
,
default
:
''
}
},
data
()
{
return
{
subjectInfo
:
this
.
subject
,
choicesContent
:
this
.
choices
,
labelPosition
:
'right'
,
// 表单校验规则
subjectRules
:
{
subjectName
:
[{
required
:
true
,
message
:
'请输入题目名称'
,
trigger
:
'change'
}],
score
:
[{
required
:
true
,
message
:
'请输入题目分值'
,
trigger
:
'change'
}],
answer
:
[{
required
:
true
,
message
:
'请输入答案'
,
trigger
:
'change'
}]
},
tinymce
:
{
type
:
1
,
// 类型 0:题目名称,1:选项
dialogTinymceVisible
:
false
,
tempValue
:
''
,
currentEdit
:
-
1
},
// 编辑对象
tinymceEdit
:
{
subjectName
:
-
1
,
answer
:
4
,
analysis
:
5
},
options
:
[]
}
},
watch
:
{
// 监听富文本编辑器的输入
choicesContent
:
{
handler
:
function
(
choicesContent
)
{
if
(
isNotEmpty
(
this
.
$refs
.
choicesEditor
))
{
if
(
this
.
editType
===
1
&&
this
.
$refs
.
choicesEditor
.
getHasClick
())
{
this
.
saveTinymceContent
(
choicesContent
)
}
}
this
.
initDefaultOptions
()
},
// 点击事件回调
hasClick
(
hasClick
)
{
this
.
editType
=
1
immediate
:
true
}
},
methods
:
{
initDefaultOptions
()
{
this
.
options
=
[
{
subjectChoicesId
:
''
,
optionName
:
'正确'
,
optionContent
:
'正确'
},
{
subjectChoicesId
:
''
,
optionName
:
'错误'
,
optionContent
:
'错误'
}
]
},
setSubjectInfo
(
subject
)
{
this
.
subjectInfo
=
subject
this
.
initDefaultOptions
()
},
getSubjectInfo
()
{
return
this
.
subjectInfo
},
// 绑定富文本的内容
updateTinymceContent
(
content
,
currentEdit
,
type
)
{
// 重置富文本
this
.
choicesContent
=
''
// 绑定当前编辑的对象
this
.
tinymce
.
currentEdit
=
currentEdit
this
.
tinymce
.
type
=
type
this
.
$refs
.
choicesEditor
.
setContent
(
content
||
''
)
this
.
editType
=
0
this
.
$refs
.
choicesEditor
.
setHashClick
(
false
)
},
saveTinymceContent
(
content
)
{
switch
(
this
.
tinymce
.
currentEdit
)
{
case
this
.
tinymceEdit
.
subjectName
:
this
.
subjectInfo
.
subjectName
=
content
break
case
this
.
tinymceEdit
.
answer
:
this
.
subjectInfo
.
answer
.
answer
=
content
break
case
this
.
tinymceEdit
.
analysis
:
this
.
subjectInfo
.
analysis
=
content
break
}
},
// 表单校验
validate
()
{
let
valid
=
false
this
.
$refs
[
'dataSubjectForm'
].
validate
((
validate
)
=>
{
valid
=
validate
})
return
valid
},
clearValidate
()
{
this
.
$refs
[
'dataSubjectForm'
].
clearValidate
()
},
resetTempSubject
(
score
)
{
this
.
subjectInfo
=
{
id
:
''
,
examinationId
:
undefined
,
categoryId
:
undefined
,
subjectName
:
''
,
type
:
0
,
choicesType
:
0
,
answer
:
{
subjectId
:
''
,
answer
:
''
,
answerType
:
''
,
score
:
''
},
score
:
5
,
analysis
:
''
,
level
:
2
}
// 默认分数
if
(
isNotEmpty
(
score
))
{
this
.
subjectInfo
.
score
=
score
}
this
.
initDefaultOptions
()
},
// 点击事件回调
hasClick
(
hasClick
)
{
this
.
editType
=
1
}
}
}
</
script
>
<
style
lang=
"scss"
scoped
>
...
...
frontend/spring-microservice-exam-ui/src/permission.js
View file @
01554785
...
...
@@ -31,7 +31,8 @@ router.beforeEach((to, from, next) => {
next
({
path
:
'/'
})
NProgress
.
done
()
}
else
{
if
(
store
.
getters
.
userInfo
.
id
===
undefined
)
{
// 判断当前用户是否已拉取完user_info信息
const
userInfo
=
store
.
getters
.
userInfo
if
(
Object
.
keys
(
userInfo
).
length
===
0
)
{
// 判断当前用户是否已拉取完user_info信息
store
.
dispatch
(
'GetUserInfo'
).
then
(
res
=>
{
// 拉取user_info
next
({
...
to
,
replace
:
true
})
// hack方法 确保addRoutes已完成 ,set the replace: true so the navigation will not leave a history record
}).
catch
((
err
)
=>
{
...
...
frontend/spring-microservice-exam-ui/src/views/exam/examRecord.vue
View file @
01554785
...
...
@@ -83,14 +83,11 @@
</template>
<
script
>
import
{
fetchExamRecordList
,
exportObj
,
completeMarking
}
from
'@/api/exam/examRecord'
import
{
getAnswerByRecordId
,
putAnswer
}
from
'@/api/exam/answer'
import
{
getSubjectIds
}
from
'@/api/exam/exam'
import
{
fetchExamRecordList
,
exportObj
}
from
'@/api/exam/examRecord'
import
waves
from
'@/directive/waves'
import
{
mapGetters
}
from
'vuex'
import
{
exportExcel
,
messageFail
,
messageSuccess
,
formatDate
}
from
'@/utils/util'
import
{
exportExcel
}
from
'@/utils/util'
import
SpinnerLoading
from
'@/components/SpinnerLoading'
import
Tinymce
from
'@/components/Tinymce'
export
default
{
name
:
'ExamRecordManagement'
,
...
...
frontend/spring-microservice-exam-ui/src/views/exam/markExam.vue
View file @
01554785
...
...
@@ -192,11 +192,11 @@ export default {
if
(
subjectData
.
length
>
0
)
{
for
(
let
i
=
0
;
i
<
subjectData
.
length
;
i
++
)
{
const
{
subjectId
,
type
}
=
subjectData
[
i
]
this
.
subjectIds
.
push
({
subjectId
,
type
,
index
:
i
+
1
})
this
.
subjectIds
.
push
({
subjectId
,
type
,
index
:
i
+
1
})
}
}
})
}).
catch
(
error
=>
{
}).
catch
(
()
=>
{
messageFail
(
this
,
'加载答题失败'
)
})
},
...
...
frontend/spring-microservice-exam-ui/src/views/sys/menu.vue
View file @
01554785
...
...
@@ -352,7 +352,7 @@ export default {
icon
:
''
,
sort
:
30
,
component
:
undefined
,
type
:
'0'
,
type
:
0
,
path
:
undefined
,
remark
:
undefined
}
...
...
frontend/spring-microservice-exam-web/src/components/Subjects/Judgement/index.vue
View file @
01554785
...
...
@@ -20,53 +20,53 @@
</
template
>
<
script
>
export
default
{
name
:
'Judgement'
,
data
()
{
return
{
exam
:
{
examinationName
:
''
,
totalScore
:
''
},
subjectCount
:
0
,
subjectInfo
:
{
subjectName
:
''
,
score
:
0
},
options
:
[
{
id
:
1
,
optionName
:
'正确'
},
{
id
:
2
,
optionName
:
'错误'
}
],
userAnswer
:
''
,
index
:
''
}
},
methods
:
{
getAnswer
()
{
return
this
.
userAnswer
},
setAnswer
(
answer
)
{
this
.
userAnswer
=
answer
export
default
{
name
:
'Judgement'
,
data
()
{
return
{
exam
:
{
examinationName
:
''
,
totalScore
:
''
},
setSubjectInfo
(
exam
,
subject
,
subjectCount
,
index
)
{
this
.
exam
=
exam
this
.
subjectCount
=
subjectCount
this
.
subjectInfo
=
subject
if
(
subject
.
hasOwnProperty
(
'answer'
))
{
this
.
setAnswer
(
subject
.
answer
.
answer
)
}
this
.
index
=
index
+
'.'
subjectCount
:
0
,
subjectInfo
:
{
subjectName
:
''
,
score
:
0
},
getSubjectInfo
()
{
this
.
subjectInfo
.
options
=
this
.
options
return
this
.
subjectInfo
},
// 选中选项
toggleOption
(
option
)
{
this
.
userAnswer
=
option
.
optionName
options
:
[
{
id
:
1
,
optionName
:
'正确'
},
{
id
:
2
,
optionName
:
'错误'
}
],
userAnswer
:
''
,
index
:
''
}
},
methods
:
{
getAnswer
()
{
return
this
.
userAnswer
},
setAnswer
(
answer
)
{
this
.
userAnswer
=
answer
},
setSubjectInfo
(
exam
,
subject
,
subjectCount
,
index
)
{
this
.
exam
=
exam
this
.
subjectCount
=
subjectCount
this
.
subjectInfo
=
subject
if
(
subject
.
hasOwnProperty
(
'answer'
))
{
this
.
setAnswer
(
subject
.
answer
.
answer
)
}
this
.
index
=
index
+
'.'
},
getSubjectInfo
()
{
this
.
subjectInfo
.
options
=
this
.
options
return
this
.
subjectInfo
},
// 选中选项
toggleOption
(
option
)
{
this
.
userAnswer
=
option
.
optionName
}
}
}
</
script
>
<
style
lang=
"scss"
scoped
>
...
...
frontend/spring-microservice-exam-web/src/permission.js
View file @
01554785
...
...
@@ -15,7 +15,8 @@ router.beforeEach((to, from, next) => {
if
(
to
.
path
===
'/login'
||
to
.
path
===
'/register'
)
{
next
({
path
:
'/'
})
}
else
{
if
(
store
.
getters
.
roles
.
length
===
0
)
{
// 判断当前用户是否已拉取完user_info信息
const
userInfo
=
store
.
getters
.
userInfo
if
(
Object
.
keys
(
userInfo
).
length
===
0
)
{
// 判断当前用户是否已拉取完user_info信息
store
.
dispatch
(
'GetUserInfo'
).
then
(
res
=>
{
// 拉取user_info
next
({
...
to
,
replace
:
true
})
// hack方法 确保addRoutes已完成
}).
catch
((
err
)
=>
{
...
...
@@ -25,9 +26,10 @@ router.beforeEach((to, from, next) => {
})
})
// 获取系统配置信息
if
(
store
.
getters
.
sysConfig
.
fdfsHttpHost
===
undefined
)
{
const
sysConfig
=
store
.
getters
.
sysConfig
if
(
Object
.
keys
(
sysConfig
).
length
===
0
)
{
store
.
dispatch
(
'GetSysConfig'
).
then
(
res
=>
{}).
catch
(()
=>
{
console
.
log
(
'获取
附件
配置失败!'
)
console
.
log
(
'获取
系统
配置失败!'
)
})
}
}
else
{
...
...
frontend/spring-microservice-exam-web/src/store/getters.js
View file @
01554785
...
...
@@ -25,6 +25,7 @@ const getters = {
course
:
state
=>
state
.
course
.
course
,
sysConfig
:
state
=>
state
.
sysConfig
.
sysConfig
,
tenantCode
:
state
=>
state
.
user
.
tenantCode
,
incorrectRecord
:
state
=>
state
.
exam
.
incorrectRecord
incorrectRecord
:
state
=>
state
.
exam
.
incorrectRecord
,
userInfo
:
state
=>
state
.
user
.
userInfo
}
export
default
getters
gateway-service/src/main/java/com/github/tangyi/gateway/cache/loader/PreviewConfigLoader.java
View file @
01554785
...
...
@@ -19,9 +19,9 @@ import java.util.Map;
public
class
PreviewConfigLoader
extends
CacheLoader
<
String
,
Map
<
String
,
String
>>
{
/**
*
2分钟
刷新一次loadingCache
*
30秒
刷新一次loadingCache
*/
public
static
final
int
REFRESH_CACHE_DURATION
=
2
*
30
;
public
static
final
int
REFRESH_CACHE_DURATION
=
30
;
public
static
final
String
PREVIEW_ENABLE
=
"preview_enable"
;
...
...
gateway-service/src/main/java/com/github/tangyi/gateway/handler/GatewayExceptionHandler.java
View file @
01554785
...
...
@@ -79,7 +79,7 @@ public class GatewayExceptionHandler implements ErrorWebExceptionHandler {
*/
@Override
public
Mono
<
Void
>
handle
(
ServerWebExchange
exchange
,
Throwable
ex
)
{
String
msg
=
"
服务器内部错误.
"
;
String
msg
=
"
Internal Server Error
"
;
// 返回给前端用的状态码
int
keyCode
=
ApiMsg
.
KEY_UNKNOWN
;
int
msgCode
=
ApiMsg
.
ERROR
;
...
...
@@ -112,7 +112,7 @@ public class GatewayExceptionHandler implements ErrorWebExceptionHandler {
ResponseBean
<
String
>
responseBean
=
new
ResponseBean
<>(
msg
,
keyCode
,
msgCode
);
// 错误记录
ServerHttpRequest
request
=
exchange
.
getRequest
();
log
.
error
(
"
[全局异常处理]异常请求路径:{}, 异常信息:
{}"
,
request
.
getPath
(),
ex
.
getMessage
());
log
.
error
(
"
GatewayExceptionHandler: {}, error:
{}"
,
request
.
getPath
(),
ex
.
getMessage
());
if
(
exchange
.
getResponse
().
isCommitted
())
return
Mono
.
error
(
ex
);
exceptionHandlerResult
.
set
(
responseBean
);
...
...
gateway-service/src/main/resources/logback.xml
View file @
01554785
...
...
@@ -39,21 +39,21 @@
</filter>
</appender>
<!-- 输出到logstash的appender,
ELK_DESTINATION
为logstash的IP和端口,从环境变量注入-->
<!--
<appender name="logstash" class="net.logstash.logback.appender.LogstashTcpSocketAppender">
<destination>${ELK_DESTINATION
}</destination>
<encoder charset="UTF-8" class="net.logstash.logback.encoder.LogstashEncoder"/>
</appender>-->
<!-- 输出到logstash的appender,
LOGSTASH_HOST
为logstash的IP和端口,从环境变量注入-->
<!--<appender name="logstash" class="net.logstash.logback.appender.LogstashTcpSocketAppender">
<destination>${LOGSTASH_HOST
}</destination>
<encoder charset="UTF-8" class="net.logstash.logback.encoder.LogstashEncoder"/>
</appender>-->
<!-- Level: FATAL 0 ERROR 3 WARN 4 INFO 6 DEBUG 7 -->
<root
level=
"
info
"
>
<root
level=
"
warn
"
>
<appender-ref
ref=
"console"
/>
<appender-ref
ref=
"debug"
/>
<appender-ref
ref=
"error"
/>
<!--<appender-ref ref="logstash"/>-->
</root>
<logger
name=
"com.github.tangyi"
level=
"
debug
"
additivity=
"false"
>
<logger
name=
"com.github.tangyi"
level=
"
info
"
additivity=
"false"
>
<appender-ref
ref=
"console"
/>
<appender-ref
ref=
"debug"
/>
<appender-ref
ref=
"error"
/>
...
...
modules/auth-service-parent/auth-service/src/main/resources/logback.xml
View file @
01554785
...
...
@@ -39,21 +39,21 @@
</filter>
</appender>
<!-- 输出到logstash的appender,
ELK_DESTINATION
为logstash的IP和端口,从环境变量注入-->
<!--
<appender name="logstash" class="net.logstash.logback.appender.LogstashTcpSocketAppender">
<destination>${ELK_DESTINATION
}</destination>
<encoder charset="UTF-8" class="net.logstash.logback.encoder.LogstashEncoder"/>
</appender>-->
<!-- 输出到logstash的appender,
LOGSTASH_HOST
为logstash的IP和端口,从环境变量注入-->
<!--<appender name="logstash" class="net.logstash.logback.appender.LogstashTcpSocketAppender">
<destination>${LOGSTASH_HOST
}</destination>
<encoder charset="UTF-8" class="net.logstash.logback.encoder.LogstashEncoder"/>
</appender>-->
<!-- Level: FATAL 0 ERROR 3 WARN 4 INFO 6 DEBUG 7 -->
<root
level=
"
info
"
>
<root
level=
"
warn
"
>
<appender-ref
ref=
"console"
/>
<appender-ref
ref=
"debug"
/>
<appender-ref
ref=
"error"
/>
<!--<appender-ref ref="logstash"/>-->
</root>
<logger
name=
"com.github.tangyi"
level=
"
debug
"
additivity=
"false"
>
<logger
name=
"com.github.tangyi"
level=
"
info
"
additivity=
"false"
>
<appender-ref
ref=
"console"
/>
<appender-ref
ref=
"debug"
/>
<appender-ref
ref=
"error"
/>
...
...
modules/exam-service-parent/exam-service/src/main/resources/logback.xml
View file @
01554785
...
...
@@ -39,21 +39,21 @@
</filter>
</appender>
<!-- 输出到logstash的appender,
ELK_DESTINATION
为logstash的IP和端口,从环境变量注入-->
<!--
<appender name="logstash" class="net.logstash.logback.appender.LogstashTcpSocketAppender">
<destination>${ELK_DESTINATION
}</destination>
<encoder charset="UTF-8" class="net.logstash.logback.encoder.LogstashEncoder"/>
</appender>-->
<!-- 输出到logstash的appender,
LOGSTASH_HOST
为logstash的IP和端口,从环境变量注入-->
<!--<appender name="logstash" class="net.logstash.logback.appender.LogstashTcpSocketAppender">
<destination>${LOGSTASH_HOST
}</destination>
<encoder charset="UTF-8" class="net.logstash.logback.encoder.LogstashEncoder"/>
</appender>-->
<!-- Level: FATAL 0 ERROR 3 WARN 4 INFO 6 DEBUG 7 -->
<root
level=
"
info
"
>
<root
level=
"
warn
"
>
<appender-ref
ref=
"console"
/>
<appender-ref
ref=
"debug"
/>
<appender-ref
ref=
"error"
/>
<!--<appender-ref ref="logstash"/>-->
</root>
<logger
name=
"com.github.tangyi"
level=
"
debug
"
additivity=
"false"
>
<logger
name=
"com.github.tangyi"
level=
"
info
"
additivity=
"false"
>
<appender-ref
ref=
"console"
/>
<appender-ref
ref=
"debug"
/>
<appender-ref
ref=
"error"
/>
...
...
modules/msc-service-parent/msc-service/src/main/resources/logback.xml
View file @
01554785
...
...
@@ -39,21 +39,21 @@
</filter>
</appender>
<!-- 输出到logstash的appender,
ELK_DESTINATION
为logstash的IP和端口,从环境变量注入-->
<!--
<appender name="logstash" class="net.logstash.logback.appender.LogstashTcpSocketAppender">
<destination>${ELK_DESTINATION
}</destination>
<encoder charset="UTF-8" class="net.logstash.logback.encoder.LogstashEncoder"/>
</appender>-->
<!-- 输出到logstash的appender,
LOGSTASH_HOST
为logstash的IP和端口,从环境变量注入-->
<!--<appender name="logstash" class="net.logstash.logback.appender.LogstashTcpSocketAppender">
<destination>${LOGSTASH_HOST
}</destination>
<encoder charset="UTF-8" class="net.logstash.logback.encoder.LogstashEncoder"/>
</appender>-->
<!-- Level: FATAL 0 ERROR 3 WARN 4 INFO 6 DEBUG 7 -->
<root
level=
"
info
"
>
<root
level=
"
warn
"
>
<appender-ref
ref=
"console"
/>
<appender-ref
ref=
"debug"
/>
<appender-ref
ref=
"error"
/>
<!--<appender-ref ref="logstash"/>-->
</root>
<logger
name=
"com.github.tangyi"
level=
"
debug
"
additivity=
"false"
>
<logger
name=
"com.github.tangyi"
level=
"
info
"
additivity=
"false"
>
<appender-ref
ref=
"console"
/>
<appender-ref
ref=
"debug"
/>
<appender-ref
ref=
"error"
/>
...
...
modules/user-service-parent/user-service/src/main/java/com/github/tangyi/user/controller/DashboardController.java
View file @
01554785
...
...
@@ -59,9 +59,15 @@ public class DashboardController extends BaseController {
ResponseBean
<
ExaminationDashboardDto
>
dashboardData
=
examinationService
.
findExaminationDashboardData
(
tenantCode
);
if
(!
ResponseUtil
.
isSuccess
(
dashboardData
))
throw
new
ServiceException
(
"Get examination dashboard data failed: "
+
dashboardData
.
getMsg
());
dashboardDto
.
setExaminationNumber
(
dashboardData
.
getData
().
getExaminationCount
().
toString
());
dashboardDto
.
setExamUserNumber
(
dashboardData
.
getData
().
getExamUserCount
().
toString
());
dashboardDto
.
setExaminationRecordNumber
(
dashboardData
.
getData
().
getExaminationRecordCount
().
toString
());
ExaminationDashboardDto
examinationDashboardDto
=
dashboardData
.
getData
();
if
(
examinationDashboardDto
!=
null
)
{
if
(
examinationDashboardDto
.
getExaminationCount
()
!=
null
)
dashboardDto
.
setExaminationNumber
(
examinationDashboardDto
.
getExaminationCount
().
toString
());
if
(
examinationDashboardDto
.
getExamUserCount
()
!=
null
)
dashboardDto
.
setExamUserNumber
(
examinationDashboardDto
.
getExamUserCount
().
toString
());
if
(
examinationDashboardDto
.
getExaminationRecordCount
()
!=
null
)
dashboardDto
.
setExaminationRecordNumber
(
examinationDashboardDto
.
getExaminationRecordCount
().
toString
());
}
return
new
ResponseBean
<>(
dashboardDto
);
}
...
...
modules/user-service-parent/user-service/src/main/java/com/github/tangyi/user/service/UserService.java
View file @
01554785
...
...
@@ -503,7 +503,7 @@ public class UserService extends CrudService<UserMapper, User> {
private
void
initUserAvatar
(
UserInfoDto
userInfoDto
,
User
user
)
{
try
{
// 附件id不为空,获取对应的预览地址,否则获取配置默认头像地址
if
(
user
.
getAvatarId
()
!=
0L
)
{
if
(
user
.
getAvatarId
()
!=
null
&&
user
.
getAvatarId
()
!=
0L
)
{
Attachment
attachment
=
new
Attachment
();
attachment
.
setId
(
user
.
getAvatarId
());
userInfoDto
.
setAvatarUrl
(
attachmentService
.
getPreviewUrl
(
attachment
));
...
...
modules/user-service-parent/user-service/src/main/resources/logback.xml
View file @
01554785
...
...
@@ -39,21 +39,21 @@
</filter>
</appender>
<!-- 输出到logstash的appender,
ELK_DESTINATION
为logstash的IP和端口,从环境变量注入-->
<!--
<appender name="logstash" class="net.logstash.logback.appender.LogstashTcpSocketAppender">
<destination>${ELK_DESTINATION
}</destination>
<encoder charset="UTF-8" class="net.logstash.logback.encoder.LogstashEncoder"/>
</appender>-->
<!-- 输出到logstash的appender,
LOGSTASH_HOST
为logstash的IP和端口,从环境变量注入-->
<!--<appender name="logstash" class="net.logstash.logback.appender.LogstashTcpSocketAppender">
<destination>${LOGSTASH_HOST
}</destination>
<encoder charset="UTF-8" class="net.logstash.logback.encoder.LogstashEncoder"/>
</appender>-->
<!-- Level: FATAL 0 ERROR 3 WARN 4 INFO 6 DEBUG 7 -->
<root
level=
"
info
"
>
<root
level=
"
warn
"
>
<appender-ref
ref=
"console"
/>
<appender-ref
ref=
"debug"
/>
<appender-ref
ref=
"error"
/>
<!--<appender-ref ref="logstash"/>-->
</root>
<logger
name=
"com.github.tangyi"
level=
"
debug
"
additivity=
"false"
>
<logger
name=
"com.github.tangyi"
level=
"
info
"
additivity=
"false"
>
<appender-ref
ref=
"console"
/>
<appender-ref
ref=
"debug"
/>
<appender-ref
ref=
"error"
/>
...
...
monitor-service/src/main/resources/logback.xml
View file @
01554785
...
...
@@ -39,21 +39,21 @@
</filter>
</appender>
<!-- 输出到logstash的appender,
ELK_DESTINATION
为logstash的IP和端口,从环境变量注入-->
<!--
<appender name="logstash" class="net.logstash.logback.appender.LogstashTcpSocketAppender">
<destination>${ELK_DESTINATION
}</destination>
<encoder charset="UTF-8" class="net.logstash.logback.encoder.LogstashEncoder"/>
</appender>-->
<!-- 输出到logstash的appender,
LOGSTASH_HOST
为logstash的IP和端口,从环境变量注入-->
<!--<appender name="logstash" class="net.logstash.logback.appender.LogstashTcpSocketAppender">
<destination>${LOGSTASH_HOST
}</destination>
<encoder charset="UTF-8" class="net.logstash.logback.encoder.LogstashEncoder"/>
</appender>-->
<!-- Level: FATAL 0 ERROR 3 WARN 4 INFO 6 DEBUG 7 -->
<root
level=
"
info
"
>
<root
level=
"
warn
"
>
<appender-ref
ref=
"console"
/>
<appender-ref
ref=
"debug"
/>
<appender-ref
ref=
"error"
/>
<!--<appender-ref ref="logstash"/>-->
</root>
<logger
name=
"com.github.tangyi"
level=
"
debug
"
additivity=
"false"
>
<logger
name=
"com.github.tangyi"
level=
"
info
"
additivity=
"false"
>
<appender-ref
ref=
"console"
/>
<appender-ref
ref=
"debug"
/>
<appender-ref
ref=
"error"
/>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment