Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
Q
qualityTesting_studentHome
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
tobacco
qualityTesting_studentHome
Commits
f5e59b9a
提交
f5e59b9a
authored
3月 20, 2023
作者:
Yroc
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
'学生登录'
上级
fbe83b92
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
11 个修改的文件
包含
224 行增加
和
40 行删除
+224
-40
user.js
src/api/user.js
+36
-6
index.vue
src/components/ViewHeader/index.vue
+0
-4
main.js
src/main.js
+4
-2
permission.js
src/permission.js
+3
-3
index.js
src/router/index.js
+19
-12
user.js
src/store/modules/user.js
+23
-5
validate.js
src/utils/validate.js
+2
-1
index.vue
src/views/login-info/index.vue
+0
-0
account.vue
src/views/login/components/account.vue
+114
-0
index.vue
src/views/login/index.vue
+0
-0
index.vue
src/views/upload-result/index.vue
+23
-7
没有找到文件。
src/api/user.js
浏览文件 @
f5e59b9a
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* @Author: AnthonyD
* @Author: AnthonyD
* @Date: 2023-02-22 11:31:31
* @Date: 2023-02-22 11:31:31
* @Last Modified by: AnthonyD
* @Last Modified by: AnthonyD
* @Last Modified time: 2023-03-1
3 10:11:24
* @Last Modified time: 2023-03-1
7 18:38:05
*/
*/
import
request
from
'@/utils/request'
import
request
from
'@/utils/request'
...
@@ -24,9 +24,9 @@ export function login(data) {
...
@@ -24,9 +24,9 @@ export function login(data) {
}
}
//获取邮件
//获取邮件
export
function
getCode
(
data
){
export
function
getCode
(
data
)
{
return
request
({
return
request
({
url
:
'student/mail/code'
,
url
:
'
/
student/mail/code'
,
method
:
'post'
,
method
:
'post'
,
data
data
})
})
...
@@ -58,7 +58,7 @@ export function getResults(params) {
...
@@ -58,7 +58,7 @@ export function getResults(params) {
}
}
//开始考试详情
//开始考试详情
export
function
getResultsData
(
id
,
params
)
{
export
function
getResultsData
(
id
,
params
)
{
return
request
({
return
request
({
url
:
`/student/test_results/
${
id
}
`
,
url
:
`/student/test_results/
${
id
}
`
,
method
:
'get'
,
method
:
'get'
,
...
@@ -67,15 +67,16 @@ export function getResultsData(id,params) {
...
@@ -67,15 +67,16 @@ export function getResultsData(id,params) {
}
}
//学员拍照上传考试结果
//学员拍照上传考试结果
export
function
getPhotoResults
(
id
)
{
export
function
getPhotoResults
(
id
,
data
)
{
return
request
({
return
request
({
url
:
`/student/test_results/imageUpload/
${
id
}
`
,
url
:
`/student/test_results/imageUpload/
${
id
}
`
,
method
:
'post'
,
method
:
'post'
,
data
})
})
}
}
//提交答题结果
//提交答题结果
export
function
uploadTestResults
(
id
,
data
)
{
export
function
uploadTestResults
(
id
,
data
)
{
return
request
({
return
request
({
url
:
`/student/test_results/
${
id
}
`
,
url
:
`/student/test_results/
${
id
}
`
,
method
:
'put'
,
method
:
'put'
,
...
@@ -91,6 +92,35 @@ export function viewExamResults(id) {
...
@@ -91,6 +92,35 @@ export function viewExamResults(id) {
})
})
}
}
//注册
export
function
userLogon
(
data
)
{
return
request
({
url
:
'/student/auth/sign_up'
,
method
:
'post'
,
data
})
}
//账号密码登录
export
function
accountLogin
(
data
)
{
return
request
({
url
:
'/student/auth/login'
,
method
:
'post'
,
data
})
}
//获取省市信息
export
function
getCityIntfo
(
data
)
{
return
request
({
url
:
'/api/treeprovince'
,
method
:
'post'
,
data
})
}
export
function
logout
()
{
export
function
logout
()
{
return
request
({
return
request
({
url
:
'/vue-element-admin/user/logout'
,
url
:
'/vue-element-admin/user/logout'
,
...
...
src/components/ViewHeader/index.vue
浏览文件 @
f5e59b9a
...
@@ -55,9 +55,5 @@ export default {
...
@@ -55,9 +55,5 @@ export default {
height
:
100%
;
height
:
100%
;
}
}
}
}
.btn
{
// background-color: $defaultColor;
}
}
}
</
style
>
</
style
>
src/main.js
浏览文件 @
f5e59b9a
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* @Author: AnthonyD
* @Author: AnthonyD
* @Date: 2023-02-22 11:31:31
* @Date: 2023-02-22 11:31:31
* @Last Modified by: AnthonyD
* @Last Modified by: AnthonyD
* @Last Modified time: 2023-03-
07 16:07:1
7
* @Last Modified time: 2023-03-
20 15:52:0
7
*/
*/
import
Vue
from
'vue'
import
Vue
from
'vue'
...
@@ -28,9 +28,10 @@ import * as filters from './filters' // global filters
...
@@ -28,9 +28,10 @@ import * as filters from './filters' // global filters
//引入加密函数,并将其封装
//引入加密函数,并将其封装
import
{
handleParams
,
Aesdecrypt
}
from
'@/utils/cryptoJS'
;
import
{
handleParams
,
Aesdecrypt
,
removeProperty
}
from
'@/utils/cryptoJS'
;
Vue
.
prototype
.
$handleParams
=
handleParams
;
//封装机密格式的参数
Vue
.
prototype
.
$handleParams
=
handleParams
;
//封装机密格式的参数
Vue
.
prototype
.
$Aesdecrypt
=
Aesdecrypt
;
//封装机密格式的参数
Vue
.
prototype
.
$Aesdecrypt
=
Aesdecrypt
;
//封装机密格式的参数
Vue
.
prototype
.
$removeProperty
=
removeProperty
;
//去除空值
/**
/**
* If you don't want to use mock-server
* If you don't want to use mock-server
...
@@ -45,6 +46,7 @@ if (process.env.NODE_ENV === 'production') {
...
@@ -45,6 +46,7 @@ if (process.env.NODE_ENV === 'production') {
mockXHR
()
mockXHR
()
}
}
Vue
.
use
(
Element
,
{
Vue
.
use
(
Element
,
{
size
:
Cookies
.
get
(
'size'
)
||
'medium'
,
// set element-ui default size
size
:
Cookies
.
get
(
'size'
)
||
'medium'
,
// set element-ui default size
locale
:
enLang
// 如果使用中文,无需设置,请删除
locale
:
enLang
// 如果使用中文,无需设置,请删除
...
...
src/permission.js
浏览文件 @
f5e59b9a
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* @Author: AnthonyD
* @Author: AnthonyD
* @Date: 2023-02-22 11:31:31
* @Date: 2023-02-22 11:31:31
* @Last Modified by: AnthonyD
* @Last Modified by: AnthonyD
* @Last Modified time: 2023-03-
01 14:40:23
* @Last Modified time: 2023-03-
17 16:45:37
*/
*/
import
router
from
'./router'
import
router
from
'./router'
import
store
from
'./store'
import
store
from
'./store'
...
@@ -14,9 +14,9 @@ import getPageTitle from '@/utils/get-page-title'
...
@@ -14,9 +14,9 @@ import getPageTitle from '@/utils/get-page-title'
NProgress
.
configure
({
showSpinner
:
false
})
// NProgress Configuration
NProgress
.
configure
({
showSpinner
:
false
})
// NProgress Configuration
const
whiteList
=
[
'/login'
,
'/auth-redirect'
]
// no redirect whitelist
const
whiteList
=
[
'/login'
,
'/auth-redirect'
,
'/login_info'
]
// no redirect whitelist
router
.
beforeEach
(
async
(
to
,
from
,
next
)
=>
{
router
.
beforeEach
(
async
(
to
,
from
,
next
)
=>
{
// start progress bar
// start progress bar
NProgress
.
start
()
NProgress
.
start
()
...
...
src/router/index.js
浏览文件 @
f5e59b9a
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* @Author: AnthonyD
* @Author: AnthonyD
* @Date: 2023-02-22 11:31:31
* @Date: 2023-02-22 11:31:31
* @Last Modified by: AnthonyD
* @Last Modified by: AnthonyD
* @Last Modified time: 2023-03-1
4 18:19:16
* @Last Modified time: 2023-03-1
7 16:45:18
*/
*/
import
Vue
from
'vue'
import
Vue
from
'vue'
import
Router
from
'vue-router'
import
Router
from
'vue-router'
...
@@ -61,6 +61,11 @@ export const constantRoutes = [
...
@@ -61,6 +61,11 @@ export const constantRoutes = [
component
:
()
=>
import
(
'@/views/login/index'
),
component
:
()
=>
import
(
'@/views/login/index'
),
hidden
:
true
hidden
:
true
},
},
{
path
:
'/login_info'
,
component
:
()
=>
import
(
'@/views/login-info/index.vue'
),
},
{
{
path
:
'/auth-redirect'
,
path
:
'/auth-redirect'
,
component
:
()
=>
import
(
'@/views/login/auth-redirect'
),
component
:
()
=>
import
(
'@/views/login/auth-redirect'
),
...
@@ -77,6 +82,7 @@ export const constantRoutes = [
...
@@ -77,6 +82,7 @@ export const constantRoutes = [
hidden
:
true
hidden
:
true
},
},
// {
// {
// path: '/documentation',
// path: '/documentation',
// component: Layout,
// component: Layout,
...
@@ -127,32 +133,33 @@ export const asyncRoutes = [
...
@@ -127,32 +133,33 @@ export const asyncRoutes = [
path
:
'/'
,
path
:
'/'
,
component
:
Layout
,
component
:
Layout
,
redirect
:
'/personal'
,
redirect
:
'/personal'
,
children
:[
children
:
[
{
{
path
:
'personal'
,
path
:
'personal'
,
name
:
'personal'
,
name
:
'personal'
,
component
:
()
=>
import
(
'@/views/personal/index.vue'
),
component
:
()
=>
import
(
'@/views/personal/index.vue'
),
},
},
{
{
path
:
'affirm'
,
path
:
'affirm'
,
name
:
'affirm'
,
name
:
'affirm'
,
component
:
()
=>
import
(
'@/views/affirm/index.vue'
),
component
:
()
=>
import
(
'@/views/affirm/index.vue'
),
},
},
{
{
path
:
'test-result'
,
path
:
'test-result'
,
name
:
'test-result'
,
name
:
'test-result'
,
component
:
()
=>
import
(
'@/views/test-result/index.vue'
),
component
:
()
=>
import
(
'@/views/test-result/index.vue'
),
},
},
{
{
path
:
'upload-result'
,
path
:
'upload-result'
,
name
:
'upload-result'
,
name
:
'upload-result'
,
component
:
()
=>
import
(
'@/views/upload-result/index.vue'
),
component
:
()
=>
import
(
'@/views/upload-result/index.vue'
),
},
},
{
{
path
:
'analysis'
,
path
:
'analysis'
,
name
:
'analysis'
,
name
:
'analysis'
,
component
:
()
=>
import
(
'@/views/analysis/index.vue'
),
component
:
()
=>
import
(
'@/views/analysis/index.vue'
),
},
},
]
]
},
},
...
...
src/store/modules/user.js
浏览文件 @
f5e59b9a
...
@@ -2,9 +2,9 @@
...
@@ -2,9 +2,9 @@
* @Author: AnthonyD
* @Author: AnthonyD
* @Date: 2023-02-22 11:31:31
* @Date: 2023-02-22 11:31:31
* @Last Modified by: AnthonyD
* @Last Modified by: AnthonyD
* @Last Modified time: 2023-03-
07 15:00:39
* @Last Modified time: 2023-03-
20 15:37:37
*/
*/
import
{
login
,
logout
,
getInfo
}
from
'@/api/user'
import
{
login
,
logout
,
getInfo
,
accountLogin
}
from
'@/api/user'
import
{
getToken
,
setToken
,
removeToken
}
from
'@/utils/auth'
import
{
getToken
,
setToken
,
removeToken
}
from
'@/utils/auth'
import
router
,
{
resetRouter
}
from
'@/router'
import
router
,
{
resetRouter
}
from
'@/router'
...
@@ -16,12 +16,12 @@ const state = {
...
@@ -16,12 +16,12 @@ const state = {
roles
:
[],
roles
:
[],
hasUser
:
false
,
hasUser
:
false
,
//创建一个对象
//创建一个对象
user
:{},
user
:
{},
}
}
const
mutations
=
{
const
mutations
=
{
//存vuex里
//存vuex里
SET_USER
:
(
state
,
user
)
=>
{
SET_USER
:
(
state
,
user
)
=>
{
state
.
user
=
user
state
.
user
=
user
},
},
SET_TOKEN
:
(
state
,
token
)
=>
{
SET_TOKEN
:
(
state
,
token
)
=>
{
...
@@ -42,7 +42,7 @@ const mutations = {
...
@@ -42,7 +42,7 @@ const mutations = {
SET_HASUSER
:
(
state
,
hasUser
)
=>
{
SET_HASUSER
:
(
state
,
hasUser
)
=>
{
state
.
hasUser
=
hasUser
state
.
hasUser
=
hasUser
},
},
}
}
const
actions
=
{
const
actions
=
{
...
@@ -66,6 +66,24 @@ const actions = {
...
@@ -66,6 +66,24 @@ const actions = {
})
})
},
},
// user login
AccountLogin
({
commit
},
userInfo
)
{
const
{
username
,
password
}
=
userInfo
return
new
Promise
((
resolve
,
reject
)
=>
{
accountLogin
(
userInfo
).
then
(
response
=>
{
// const { data } = response
//存储在vuex中
commit
(
'SET_TOKEN'
,
response
.
access_token
)
//存储在Cookies中
setToken
(
response
.
access_token
)
//返回继续执行then
resolve
(
response
)
}).
catch
(
error
=>
{
reject
(
error
)
})
})
},
// get user info
// get user info
getInfo
({
commit
,
state
})
{
getInfo
({
commit
,
state
})
{
return
new
Promise
((
resolve
,
reject
)
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
...
...
src/utils/validate.js
浏览文件 @
f5e59b9a
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* @Author: AnthonyD
* @Author: AnthonyD
* @Date: 2023-02-22 11:31:31
* @Date: 2023-02-22 11:31:31
* @Last Modified by: AnthonyD
* @Last Modified by: AnthonyD
* @Last Modified time: 2023-03-1
4 11:12:01
* @Last Modified time: 2023-03-1
7 14:58:10
*/
*/
/**
/**
* Created by PanJiaChen on 16/11/18.
* Created by PanJiaChen on 16/11/18.
...
@@ -71,6 +71,7 @@ export function validEmail(email) {
...
@@ -71,6 +71,7 @@ export function validEmail(email) {
return
reg
.
test
(
email
)
return
reg
.
test
(
email
)
}
}
/**
/**
* @param {string} str
* @param {string} str
* @returns {Boolean}
* @returns {Boolean}
...
...
src/views/login-info/index.vue
0 → 100644
浏览文件 @
f5e59b9a
差异被折叠。
点击展开。
src/views/login/components/account.vue
0 → 100644
浏览文件 @
f5e59b9a
<
script
>
/**
* @Author: AnthonyD
* @Date: 2023-03-17 13:37:43
* @Last Modified by: AnthonyD
* @Last Modified time: 2023-03-20 17:27:35
*/
</
script
><
template
>
<div>
<el-form
:model=
"loginForm"
:rules=
"loginRules"
ref=
"ruleForm"
class=
"demo-ruleForm"
>
<el-form-item
prop=
"name"
>
<div>
<p
style=
"font-weight: bold; line-height: 25px"
class=
"pointer"
>
账号
</p>
<div>
<el-input
ref=
"account_input"
v-model=
"loginForm.name"
placeholder=
"手机号/邮箱/身份证号"
type=
"text"
tabindex=
"1"
>
</el-input>
</div>
</div>
</el-form-item>
<el-form-item
prop=
"password"
>
<div>
<p
style=
"font-weight: bold; line-height: 25px"
class=
"pointer"
>
密码
</p>
<div>
<el-input
ref=
"password"
:key=
"passwordType"
:type=
"passwordType"
placeholder=
"输入密码"
v-model=
"loginForm.password"
name=
"password"
@
keyup
.
native=
"checkCapslock"
@
blur=
"capsTooltip = false"
@
keyup
.
enter
.
native=
"handleLogin"
tabindex=
"2"
>
</el-input>
</div>
</div>
</el-form-item>
</el-form>
</div>
</
template
>
<
script
>
export
default
{
name
:
''
,
data
()
{
const
validateAccount
=
(
rule
,
value
,
callback
)
=>
{
if
(
!
value
||
/
[\u
4E00-
\u
9FA5
]
/g
.
test
(
value
)
||
''
)
{
console
.
log
(
value
);
callback
(
new
Error
(
'请重新账号输入'
));
}
else
{
callback
();
}
};
const
validatePassword
=
(
rule
,
value
,
callback
)
=>
{
if
(
!
value
||
!
(
value
.
length
>=
8
))
{
callback
(
new
Error
(
'密码错误,请重新输入'
));
}
else
{
callback
();
}
};
return
{
loginForm
:
{
name
:
null
,
password
:
null
,
},
passwordType
:
'password'
,
loginRules
:
{
name
:
[{
required
:
true
,
trigger
:
'blur'
,
validator
:
validateAccount
}],
password
:
[
{
required
:
true
,
trigger
:
'blur'
,
validator
:
validatePassword
},
],
},
};
},
mounted
()
{
// if (!this.loginForm.name) {
// this.$refs.account_input.focus();
// } else if (!this.loginForm.password) {
// this.$refs.password.focus();
// }
},
methods
:
{
checkCapslock
(
e
)
{
const
{
key
}
=
e
;
this
.
capsTooltip
=
key
&&
key
.
length
===
1
&&
key
>=
'A'
&&
key
<=
'Z'
;
},
//
handleLogin
()
{
this
.
$emit
(
'Login'
,
null
);
},
},
};
</
script
>
<
style
lang=
""
scoped
>
</
style
>
src/views/login/index.vue
浏览文件 @
f5e59b9a
差异被折叠。
点击展开。
src/views/upload-result/index.vue
浏览文件 @
f5e59b9a
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
* @Author: AnthonyD
* @Author: AnthonyD
* @Date: 2023-03-01 16:25:21
* @Date: 2023-03-01 16:25:21
* @Last Modified by: AnthonyD
* @Last Modified by: AnthonyD
* @Last Modified time: 2023-03-1
4 16:18:01
* @Last Modified time: 2023-03-1
7 11:25:26
*/
*/
</
script
>
</
script
>
...
@@ -111,6 +111,8 @@
...
@@ -111,6 +111,8 @@
<h3
class=
"photo_header_title"
>
上传纸质考试照片
</h3>
<h3
class=
"photo_header_title"
>
上传纸质考试照片
</h3>
</el-col>
</el-col>
<el-col
:span=
"12"
style=
"text-align: right"
>
<el-col
:span=
"12"
style=
"text-align: right"
>
<!-- :on-success="handleAvatarSuccess" -->
<!-- :http-request="uploadSubmit" -->
<el-upload
<el-upload
name=
"image"
name=
"image"
v-if=
"test_results && test_results.test_results_image"
v-if=
"test_results && test_results.test_results_image"
...
@@ -118,6 +120,7 @@
...
@@ -118,6 +120,7 @@
:action=
"
:action=
"
IP + '/student/test_results/imageUpload/' + result_id
IP + '/student/test_results/imageUpload/' + result_id
"
"
:on-progress=
"uploadSubmit"
:on-success=
"handleAvatarSuccess"
:on-success=
"handleAvatarSuccess"
:headers=
"headers"
:headers=
"headers"
:show-file-list=
"false"
:show-file-list=
"false"
...
@@ -138,7 +141,7 @@
...
@@ -138,7 +141,7 @@
</el-upload> -->
</el-upload> -->
</el-col>
</el-col>
</el-row>
</el-row>
<div
class=
"grid-content_upload"
>
<div
class=
"grid-content_upload"
v-loading=
"is_loading"
>
<div
class=
"upload_btn"
>
<div
class=
"upload_btn"
>
<div
<div
class=
"img_box"
class=
"img_box"
...
@@ -153,6 +156,7 @@
...
@@ -153,6 +156,7 @@
:action=
"
:action=
"
IP + '/student/test_results/imageUpload/' + result_id
IP + '/student/test_results/imageUpload/' + result_id
"
"
:on-progress=
"uploadSubmit"
:on-success=
"handleAvatarSuccess"
:on-success=
"handleAvatarSuccess"
:headers=
"headers"
:headers=
"headers"
drag
drag
...
@@ -198,6 +202,7 @@ export default {
...
@@ -198,6 +202,7 @@ export default {
imgrul
:
null
,
imgrul
:
null
,
test_card_info
:
{},
test_card_info
:
{},
is_force
:
false
,
is_force
:
false
,
is_loading
:
false
,
};
};
},
},
created
()
{
created
()
{
...
@@ -293,8 +298,19 @@ export default {
...
@@ -293,8 +298,19 @@ export default {
// });
// });
// },
// },
handleAvatarSuccess
(
res
,
file
)
{
handleAvatarSuccess
(
res
,
file
)
{
// this.imageUrl = URL.createObjectURL(file.raw);
if
(
res
.
code
==
200
&&
res
.
message
)
{
this
.
getTestData
();
this
.
is_loading
=
false
;
this
.
test_results
.
test_results_image
=
res
.
status
;
for
(
let
i
in
this
.
test_result_sub_data
)
{
if
(
res
.
message
[
this
.
test_result_sub_data
[
i
].
id
])
{
this
.
test_result_sub_data
[
i
].
value
=
res
.
message
[
this
.
test_result_sub_data
[
i
].
id
];
}
}
}
},
uploadSubmit
(
event
,
file
,
fileList
)
{
this
.
is_loading
=
true
;
},
},
},
},
};
};
...
@@ -397,18 +413,18 @@ export default {
...
@@ -397,18 +413,18 @@ export default {
.grid-content_upload
{
.grid-content_upload
{
text-align
:
center
;
text-align
:
center
;
background
:
#fafafa
;
background
:
#fafafa
;
height
:
648
px
;
height
:
779
px
;
border
:
2px
solid
#dcdfe6
;
border
:
2px
solid
#dcdfe6
;
border-radius
:
5px
;
border-radius
:
5px
;
position
:
relative
;
position
:
relative
;
.img_box
{
.img_box
{
width
:
100%
;
width
:
100%
;
height
:
640px
;
// height: 100%
;
// position: absolute;
// position: absolute;
text-align
:
center
;
text-align
:
center
;
img
{
img
{
width
:
100%
;
width
:
100%
;
height
:
100%
;
height
:
775px
;
}
}
}
}
}
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论