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 { ...@@ -84,8 +84,8 @@ export default {
for (let i = 0; i < this.identifyCode.length; i++) { for (let i = 0; i < this.identifyCode.length; i++) {
this.drawText(ctx, this.identifyCode[i], i) this.drawText(ctx, this.identifyCode[i], i)
} }
this.drawLine(ctx) // this.drawLine(ctx)
this.drawDot(ctx) // this.drawDot(ctx)
}, },
drawText(ctx, txt, i) { drawText(ctx, txt, i) {
ctx.fillStyle = this.randomColor(this.colorMin, this.colorMax) ctx.fillStyle = this.randomColor(this.colorMin, this.colorMax)
...@@ -138,4 +138,4 @@ export default { ...@@ -138,4 +138,4 @@ export default {
margin-top: 5px; margin-top: 5px;
} }
} }
</style> </style>
\ No newline at end of file
<template> <template>
<div class="box"> <div class="box">
<div class="container"> <div class="container">
<div class="head"> <div class="head">
<head-info :name="studentName"></head-info> <head-info :name="studentName"></head-info>
</div> </div>
<div class="entry-card-container"> <div class="entry-card-container">
<div class="entry-top"> <div class="entry-top">
<span>&emsp;&nbsp;考试报名</span> <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> </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>
</div>
</template> </template>
<script> <script>
...@@ -50,147 +52,147 @@ import HeadInfo from '@/components/HeadInfo.vue'; ...@@ -50,147 +52,147 @@ import HeadInfo from '@/components/HeadInfo.vue';
import {getList, isEnter, allInfo} from '@/api/student' import {getList, isEnter, allInfo} from '@/api/student'
export default { export default {
name: 'Entry', name: 'Entry',
components: { components: {
HeadInfo HeadInfo
}, },
data() { data() {
return { return {
loading: true,// 遮罩层 loading: true,// 遮罩层
testList: [], // 考试列表 testList: [], // 考试列表
studentName: '',// 学生姓名 studentName: '',// 学生姓名
studentId: '',// 学生ID studentId: '',// 学生ID
} }
}, },
created() { created() {
this.studentName = this.$store.state.user.studentName this.studentName = this.$store.state.user.studentName
this.studentId = this.$store.state.user.studentId this.studentId = this.$store.state.user.studentId
this.getTestList() this.getTestList()
},
methods: {
getTestList() {
getList(this.studentId).then(res => {
this.testList = res.rows
this.loading = false
})
}, },
methods: {
getTestList() { handleSignUp(row) {
getList(this.studentId).then(res => { //查询能否进入
this.testList = res.rows isEnter(row.id, this.studentId).then(res => {
this.loading = false if (res.data == 1) {
})
}, /** 如果为1则有权限进入,为0则无权进入 */
//查询进入页面显示的阶段
handleSignUp(row) { allInfo(row.id, this.studentId).then(res => {
//查询能否进入 let node = res?.node
isEnter(row.id, this.studentId).then(res => { if (node === "0") {
if (res.data == 1) { //考试须知阶段
this.$router.push({
/** 如果为1则有权限进入,为0则无权进入 */ path: '/Instruction',
//查询进入页面显示的阶段 query: {
allInfo(row.id, this.studentId).then(res => { testId: row.id,
let node = res?.node }
if (node === "0") { })
//考试须知阶段 } else {
this.$router.push({ this.$store.commit("SET_ACTIVE", res?.node - 1)
path: '/Instruction', //其他阶段,大页面
query: { this.$router.push({
testId: row.id, path: '/ApplyProcess',
} query: {
}) testId: row.id,
} else { studentId: this.studentId
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'
});
} }
})
}
})
} else {
/** 为0则无权进入 */
this.$message({
message: '暂时无法进入',
type: 'warning'
});
}
}).catch(err => {
}) }).catch(err => {
})
},
}, },
computed: {
getState() { },
return function (cur) { computed: {
let state = '' getState() {
switch (cur) { return function (cur) {
case '0': let state = ''
state = '待报名' switch (cur) {
break case '0':
case '1': state = '待报名'
state = '待审核' break
break case '1':
case '2': state = '待审核'
state = '通过' break
break case '2':
case '3': state = '通过'
state = '驳回' break
break case '3':
case '4': state = '驳回'
state = '信息修改' break
break case '4':
case '5': state = '信息修改'
state = '准考证打印' break
break case '5':
case '6': state = '准考证打印'
state = '成绩查询' break
break case '6':
case '7': state = '成绩查询'
state = '审核中' break
} case '7':
return state state = '审核中'
}
} }
return state
}
} }
}
} }
</script> </script>
<style> <style>
.box { .box {
display: flex; display: flex;
justify-content: center; justify-content: center;
background-image: url("../assets/image/background.png"); background-image: url("../assets/image/background.png");
} }
.container { .container {
width: 70%; width: 70%;
height: 100%; height: 100%;
/*background: red;*/ /*background: red;*/
} }
.head { .head {
width: 100%; width: 100%;
height: 100px; height: 100px;
} }
.entry-card-container { .entry-card-container {
width: 100%; width: 100%;
height: 845px; height: 845px;
/*margin: 25px auto 105px;*/ /*margin: 25px auto 105px;*/
/* border: 2px solid black; */ /* border: 2px solid black; */
border-radius: 12px; border-radius: 12px;
background-color: #fff; background-color: #fff;
} }
.entry-top { .entry-top {
background-color: rgb(245, 248, 251); background-color: rgb(245, 248, 251);
height: 80px; height: 80px;
border-radius: 12px 12px 0 0; border-radius: 12px 12px 0 0;
line-height: 80px; line-height: 80px;
font-size: 18px; font-size: 18px;
font-weight: 700; font-weight: 700;
} }
</style> </style>
\ No newline at end of file
...@@ -128,7 +128,8 @@ export default { ...@@ -128,7 +128,8 @@ export default {
], ],
password: [ password: [
{required: true, trigger: "blur", message: "请输入您的密码"}, {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: "请输入验证码"}, code: [{required: true, trigger: "change", message: "请输入验证码"},
{required: true, validator: validateCode, trigger: "blur"} {required: true, validator: validateCode, trigger: "blur"}
......
...@@ -126,7 +126,8 @@ export default { ...@@ -126,7 +126,8 @@ export default {
], ],
password: [ password: [
{required: true, trigger: "blur", message: "请输入您的密码"}, {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: [ confirmPassword: [
{required: true, trigger: "blur", message: "请再次输入您的密码"}, {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