Commit 9248ab66 by peijy

密码验证 报名超时限制

parent c2ef6744
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -84,8 +84,8 @@ export default {
for (let i = 0; i < this.identifyCode.length; i++) {
this.drawText(ctx, this.identifyCode[i], i)
}
this.drawLine(ctx)
this.drawDot(ctx)
// this.drawLine(ctx)
// this.drawDot(ctx)
},
drawText(ctx, txt, i) {
ctx.fillStyle = this.randomColor(this.colorMin, this.colorMax)
......@@ -138,4 +138,4 @@ export default {
margin-top: 5px;
}
}
</style>
\ No newline at end of file
</style>
<template>
<div class="box">
<div class="container">
<div class="head">
<head-info :name="studentName"></head-info>
</div>
<div class="entry-card-container">
<div class="entry-top">
<span>&emsp;&nbsp;考试报名</span>
</div>
<el-table
:data="testList"
:header-cell-style="{'text-align':'center', 'color':'#416af2'}"
:cell-style="{'text-align':'center', 'color': '#000000'}"
class="table"
border
v-loading="loading"
height="750"
style="width:100%; ">
<el-table-column prop="date" label="序号" type="index" width="100"/>
<el-table-column prop="examName" label="考试名称" min-width="180"/>
<el-table-column prop="deadline" label="报名截止日期" min-width="180"/>
<el-table-column prop="currentState" label="当前状态" min-width="180">
<template slot-scope="scope">
{{ getState(scope.row.currentState) }}
</template>
</el-table-column>
<el-table-column label="操作" min-width="120">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-d-arrow-right"
@click="handleSignUp(scope.row)"
>进入
</el-button>
</template>
</el-table-column>
</el-table>
</div>
<div style="width: 100%; height: 60px; text-align: center; color: white; font-size: 16px; font-weight: bold; padding-top: 30px; letter-spacing: 2px">
山东省东营市第二中学
</div>
<div class="box">
<div class="container">
<div class="head">
<head-info :name="studentName"></head-info>
</div>
<div class="entry-card-container">
<div class="entry-top">
<span>&emsp;&nbsp;考试报名</span>
</div>
<el-table
:data="testList"
:header-cell-style="{'text-align':'center', 'color':'#416af2'}"
:cell-style="{'text-align':'center', 'color': '#000000'}"
class="table"
border
v-loading="loading"
height="750"
style="width:100%; ">
<el-table-column prop="date" label="序号" type="index" width="100"/>
<el-table-column prop="examName" label="考试名称" min-width="180"/>
<el-table-column prop="deadline" label="报名截止日期" min-width="180"/>
<el-table-column prop="currentState" label="当前状态" min-width="180">
<template slot-scope="scope">
{{ getState(scope.row.currentState) }}
</template>
</el-table-column>
<el-table-column label="操作" min-width="120">
<template slot-scope="scope">
<el-button
:disabled="scope.row.currentState == '0' && new Date().getTime() > new Date(scope.row.deadline).getTime()"
size="mini"
type="text"
icon="el-icon-d-arrow-right"
@click="handleSignUp(scope.row)"
>进入
</el-button>
</template>
</el-table-column>
</el-table>
</div>
<div
style="width: 100%; height: 60px; text-align: center; color: white; font-size: 16px; font-weight: bold; padding-top: 30px; letter-spacing: 2px">
山东省东营市第二中学
</div>
</div>
</div>
</template>
<script>
......@@ -50,147 +52,147 @@ import HeadInfo from '@/components/HeadInfo.vue';
import {getList, isEnter, allInfo} from '@/api/student'
export default {
name: 'Entry',
components: {
HeadInfo
},
data() {
return {
loading: true,// 遮罩层
testList: [], // 考试列表
studentName: '',// 学生姓名
studentId: '',// 学生ID
}
},
created() {
this.studentName = this.$store.state.user.studentName
this.studentId = this.$store.state.user.studentId
this.getTestList()
name: 'Entry',
components: {
HeadInfo
},
data() {
return {
loading: true,// 遮罩层
testList: [], // 考试列表
studentName: '',// 学生姓名
studentId: '',// 学生ID
}
},
created() {
this.studentName = this.$store.state.user.studentName
this.studentId = this.$store.state.user.studentId
this.getTestList()
},
methods: {
getTestList() {
getList(this.studentId).then(res => {
this.testList = res.rows
this.loading = false
})
},
methods: {
getTestList() {
getList(this.studentId).then(res => {
this.testList = res.rows
this.loading = false
})
},
handleSignUp(row) {
//查询能否进入
isEnter(row.id, this.studentId).then(res => {
if (res.data == 1) {
/** 如果为1则有权限进入,为0则无权进入 */
//查询进入页面显示的阶段
allInfo(row.id, this.studentId).then(res => {
let node = res?.node
if (node === "0") {
//考试须知阶段
this.$router.push({
path: '/Instruction',
query: {
testId: row.id,
}
})
} else {
this.$store.commit("SET_ACTIVE", res?.node - 1)
//其他阶段,大页面
this.$router.push({
path: '/ApplyProcess',
query: {
testId: row.id,
studentId: this.studentId
}
})
}
})
} else {
/** 为0则无权进入 */
this.$message({
message: '暂时无法进入',
type: 'warning'
});
handleSignUp(row) {
//查询能否进入
isEnter(row.id, this.studentId).then(res => {
if (res.data == 1) {
/** 如果为1则有权限进入,为0则无权进入 */
//查询进入页面显示的阶段
allInfo(row.id, this.studentId).then(res => {
let node = res?.node
if (node === "0") {
//考试须知阶段
this.$router.push({
path: '/Instruction',
query: {
testId: row.id,
}
})
} else {
this.$store.commit("SET_ACTIVE", res?.node - 1)
//其他阶段,大页面
this.$router.push({
path: '/ApplyProcess',
query: {
testId: row.id,
studentId: this.studentId
}
})
}
})
} else {
/** 为0则无权进入 */
this.$message({
message: '暂时无法进入',
type: 'warning'
});
}
}).catch(err => {
})
}).catch(err => {
})
},
},
computed: {
getState() {
return function (cur) {
let state = ''
switch (cur) {
case '0':
state = '待报名'
break
case '1':
state = '待审核'
break
case '2':
state = '通过'
break
case '3':
state = '驳回'
break
case '4':
state = '信息修改'
break
case '5':
state = '准考证打印'
break
case '6':
state = '成绩查询'
break
case '7':
state = '审核中'
}
return state
}
},
computed: {
getState() {
return function (cur) {
let state = ''
switch (cur) {
case '0':
state = '待报名'
break
case '1':
state = '待审核'
break
case '2':
state = '通过'
break
case '3':
state = '驳回'
break
case '4':
state = '信息修改'
break
case '5':
state = '准考证打印'
break
case '6':
state = '成绩查询'
break
case '7':
state = '审核中'
}
return state
}
}
}
}
</script>
<style>
.box {
display: flex;
justify-content: center;
background-image: url("../assets/image/background.png");
display: flex;
justify-content: center;
background-image: url("../assets/image/background.png");
}
.container {
width: 70%;
height: 100%;
/*background: red;*/
width: 70%;
height: 100%;
/*background: red;*/
}
.head {
width: 100%;
height: 100px;
width: 100%;
height: 100px;
}
.entry-card-container {
width: 100%;
height: 845px;
/*margin: 25px auto 105px;*/
/* border: 2px solid black; */
border-radius: 12px;
background-color: #fff;
width: 100%;
height: 845px;
/*margin: 25px auto 105px;*/
/* border: 2px solid black; */
border-radius: 12px;
background-color: #fff;
}
.entry-top {
background-color: rgb(245, 248, 251);
height: 80px;
border-radius: 12px 12px 0 0;
line-height: 80px;
font-size: 18px;
font-weight: 700;
background-color: rgb(245, 248, 251);
height: 80px;
border-radius: 12px 12px 0 0;
line-height: 80px;
font-size: 18px;
font-weight: 700;
}
</style>
\ No newline at end of file
</style>
......@@ -128,7 +128,8 @@ export default {
],
password: [
{required: true, trigger: "blur", message: "请输入您的密码"},
{min: 5, max: 20, message: '用户密码长度必须介于 5 和 20 之间', trigger: 'blur'}
{pattern:/^(?=.*[A-Za-z])(?=.*\d)(?=.*[@$!%*?&])[A-Za-z\d@$!%*?&]{6,20}$/, message: '用户密码长度为 6 到 20 个字符,且必须包含字母、数字以及特殊符号', trigger: 'blur'}
],
code: [{required: true, trigger: "change", message: "请输入验证码"},
{required: true, validator: validateCode, trigger: "blur"}
......
......@@ -126,7 +126,8 @@ export default {
],
password: [
{required: true, trigger: "blur", message: "请输入您的密码"},
{min: 5, max: 20, message: '用户密码长度必须介于 5 和 20 之间', trigger: 'blur'}
{pattern:/^(?=.*[A-Za-z])(?=.*\d)(?=.*[@$!%*?&])[A-Za-z\d@$!%*?&]{6,20}$/, message: '用户密码长度为 6 到 20 个字符,且必须包含字母、数字以及特殊符号', trigger: 'blur'}
],
confirmPassword: [
{required: true, trigger: "blur", message: "请再次输入您的密码"},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment