|
|
|
@ -18,20 +18,53 @@
|
|
|
|
|
</el-carousel>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="12">
|
|
|
|
|
<el-form ref="ruleForm" :model="ruleForm" :rules="rules" class="login-box" label-width="80px" status-icon>
|
|
|
|
|
|
|
|
|
|
<h4 align="center" class="login-title">欢迎来到国防科大请销假系统!</h4>
|
|
|
|
|
<el-form-item label="账号" maxlength="255" prop="username">
|
|
|
|
|
<el-input v-model="ruleForm.username"></el-input>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="密码" maxlength="64" prop="password">
|
|
|
|
|
<el-input v-model="ruleForm.password" autocomplete="off" type="password"></el-input>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item>
|
|
|
|
|
<el-button type="primary" @click="submitForm('ruleForm')">登录</el-button>
|
|
|
|
|
<el-button @click="resetForm('ruleForm')">重置</el-button>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-form>
|
|
|
|
|
<div v-if="login_type === 'login'">
|
|
|
|
|
<el-form ref="ruleForm" :model="ruleForm" :rules="rules" class="login-box" label-width="80px" status-icon>
|
|
|
|
|
|
|
|
|
|
<h4 align="center" class="login-title">欢迎来到国防科大请销假系统!</h4>
|
|
|
|
|
<el-form-item label="账号" maxlength="255" prop="username">
|
|
|
|
|
<el-input v-model="ruleForm.username"></el-input>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="密码" maxlength="64" prop="password">
|
|
|
|
|
<el-input v-model="ruleForm.password" autocomplete="off" type="password"></el-input>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item>
|
|
|
|
|
<el-button type="primary" @click="submitForm('ruleForm')">登录</el-button>
|
|
|
|
|
<el-button @click="setLoginType('register')">注册</el-button>
|
|
|
|
|
<el-button @click="resetForm('ruleForm')">重置</el-button>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-form>
|
|
|
|
|
</div>
|
|
|
|
|
<div v-else>
|
|
|
|
|
<el-form ref="ruleForm_register" :model="ruleForm_register" :rules="rules_register" class="register-box"
|
|
|
|
|
label-width="80px" status-icon>
|
|
|
|
|
<h4 align="center" class="login-title">欢迎来到国防科大请销假系统!</h4>
|
|
|
|
|
<el-form-item label="账号" maxlength="255" prop="username">
|
|
|
|
|
<el-input v-model="ruleForm_register.username"></el-input>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="密码" maxlength="64" prop="password">
|
|
|
|
|
<el-input v-model="ruleForm_register.password" autocomplete="off" type="password"></el-input>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="确认密码" maxlength="64" prop="check_password">
|
|
|
|
|
<el-input v-model="ruleForm_register.check_password" autocomplete="off" type="password"></el-input>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="真实姓名" maxlength="20" prop="name">
|
|
|
|
|
<el-input v-model="ruleForm_register.name"></el-input>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="学号" maxlength="64" prop="school_id">
|
|
|
|
|
<el-input v-model="ruleForm_register.school_id"></el-input>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-radio v-model="ruleForm_register.type" label="student">我是学生</el-radio>
|
|
|
|
|
<el-radio v-model="ruleForm_register.type" label="teacher">我是老师</el-radio>
|
|
|
|
|
<el-radio v-model="ruleForm_register.type" label="outer">我是管理员</el-radio>
|
|
|
|
|
<p></p>
|
|
|
|
|
<el-form-item style="text-align: left">
|
|
|
|
|
<el-button type="primary" @click="submitFormRegister()">注册</el-button>
|
|
|
|
|
<el-button @click="setLoginType('login')">返回登录</el-button>
|
|
|
|
|
<el-button @click="resetForm('ruleForm_register')">重置</el-button>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-form>
|
|
|
|
|
</div>
|
|
|
|
|
</el-col>
|
|
|
|
|
</el-row>
|
|
|
|
|
|
|
|
|
@ -39,9 +72,13 @@
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
<script>
|
|
|
|
|
import {L2Dwidget} from 'live2d-widget'
|
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
|
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
login_type: "login",
|
|
|
|
|
ruleForm: {
|
|
|
|
|
username: '',
|
|
|
|
|
password: '',
|
|
|
|
@ -54,6 +91,32 @@ export default {
|
|
|
|
|
{required: true, message: '请输入密码', trigger: 'blur'}
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
ruleForm_register: {
|
|
|
|
|
username: '',
|
|
|
|
|
password: '',
|
|
|
|
|
check_password: '',
|
|
|
|
|
type: '',
|
|
|
|
|
name: '',
|
|
|
|
|
school_id: '',
|
|
|
|
|
email: ''
|
|
|
|
|
},
|
|
|
|
|
rules_register: {
|
|
|
|
|
username: [
|
|
|
|
|
{required: true, message: '请输入账号', trigger: 'blur'}
|
|
|
|
|
],
|
|
|
|
|
password: [
|
|
|
|
|
{required: true, message: '请输入密码', trigger: 'blur'}
|
|
|
|
|
],
|
|
|
|
|
check_password: [
|
|
|
|
|
{required: true, message: '请确认密码', trigger: 'blur'}
|
|
|
|
|
],
|
|
|
|
|
name: [
|
|
|
|
|
{required: true, message: '请输入姓名', trigger: 'blur'}
|
|
|
|
|
],
|
|
|
|
|
school_id: [
|
|
|
|
|
{required: true, message: '请输入学校id', trigger: 'blur'}
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
pictures: [
|
|
|
|
|
'https://www.nudt.edu.cn/images/2020-09/315f04ae3e4e4e488db721ba151f0fcc.jpg',
|
|
|
|
|
'https://www.nudt.edu.cn/images/2020-09/a41b098679a047bba53623f64958a4c2.jpg',
|
|
|
|
@ -94,9 +157,61 @@ export default {
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
resetForm(formName) {
|
|
|
|
|
console.log(this.$refs)
|
|
|
|
|
this.$refs[formName].resetFields();
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
setLoginType(type) {
|
|
|
|
|
this.login_type = type;
|
|
|
|
|
},
|
|
|
|
|
submitFormRegister() {
|
|
|
|
|
const _this = this
|
|
|
|
|
if (this.ruleForm_register.type === '') {
|
|
|
|
|
this.$message({
|
|
|
|
|
message: '请填写您的职业!',
|
|
|
|
|
type: 'warning'
|
|
|
|
|
});
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
if (this.ruleForm_register.password !== this.ruleForm_register.check_password) {
|
|
|
|
|
this.$message({
|
|
|
|
|
message: '两次密码不一致!',
|
|
|
|
|
type: 'warning'
|
|
|
|
|
});
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
axios.get('http://localhost:8181/userDetail/checkValuable/' + this.ruleForm_register.username + '/' + this.ruleForm_register.school_id + '/' + this.ruleForm_register.name).then(function (resp) {
|
|
|
|
|
if (resp.data !== 'success') {
|
|
|
|
|
_this.$message.error(resp.data + '重复,请登录!');
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
|
axios.post('http://localhost:8181/userDetail/saveUAD', _this.ruleForm_register).then(function (resp) {
|
|
|
|
|
if (resp.data === 'success') {
|
|
|
|
|
_this.$message({
|
|
|
|
|
message: '保存成功,已提交到管理员,请等待管理员批准',
|
|
|
|
|
type: 'success'
|
|
|
|
|
})
|
|
|
|
|
} else {
|
|
|
|
|
_this.$message.error('保存失败')
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
created() {
|
|
|
|
|
setTimeout(function () {
|
|
|
|
|
L2Dwidget.init({
|
|
|
|
|
model: {
|
|
|
|
|
jsonPath: 'https://cdn.jsdelivr.net/gh/wangsrGit119/wangsr-image-bucket/L2Dwidget/live2d-widget-model-miku/assets/miku.model.json',
|
|
|
|
|
},
|
|
|
|
|
display: {
|
|
|
|
|
width: 150,
|
|
|
|
|
height: 350,
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}, 1000);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
@ -143,6 +258,17 @@ export default {
|
|
|
|
|
margin: 110px 190px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.register-box {
|
|
|
|
|
border: 1px solid #DCDFE6;
|
|
|
|
|
width: 350px;
|
|
|
|
|
margin: 110px 0px;
|
|
|
|
|
padding: 35px 35px 15px 35px;
|
|
|
|
|
border-radius: 5px;
|
|
|
|
|
-webkit-border-radius: 5px;
|
|
|
|
|
-moz-border-radius: 5px;
|
|
|
|
|
box-shadow: 0 0 25px #909399;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.el-carousel__item:nth-child(2n) {
|
|
|
|
|
background-color: #99a9bf;
|
|
|
|
|
}
|
|
|
|
|