RBAC设计完成、拦截器、AOP、视图等测试通过
This commit is contained in:
47
src/main/resources/static/js/login.js
Normal file
47
src/main/resources/static/js/login.js
Normal file
@@ -0,0 +1,47 @@
|
||||
var Main = {
|
||||
data() {
|
||||
var checkUserName = (rule, value, callback) => {
|
||||
if (!value) {
|
||||
return callback(new Error('用户名不能为空'));
|
||||
}
|
||||
callback();
|
||||
};
|
||||
var validatePass = (rule, value, callback) => {
|
||||
if (value === '') {
|
||||
callback(new Error('请输入密码'));
|
||||
}
|
||||
callback();
|
||||
};
|
||||
return {
|
||||
ruleForm2: {
|
||||
password: '',
|
||||
userName: ''
|
||||
},
|
||||
rules2: {
|
||||
password: [
|
||||
{validator: validatePass, trigger: 'blur'}
|
||||
],
|
||||
userName: [
|
||||
{validator: checkUserName, trigger: 'blur'}
|
||||
]
|
||||
}
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
submitForm(formName) {
|
||||
this.$refs[formName].validate((valid) => {
|
||||
if (valid) {
|
||||
document.getElementById('loginForm').submit();
|
||||
} else {
|
||||
console.log('error submit!!');
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
resetForm(formName) {
|
||||
this.$refs[formName].resetFields();
|
||||
}
|
||||
}
|
||||
}
|
||||
var Ctor = Vue.extend(Main)
|
||||
new Ctor().$mount('#app')
|
||||
26
src/main/resources/templates/index.html
Normal file
26
src/main/resources/templates/index.html
Normal file
@@ -0,0 +1,26 @@
|
||||
<!DOCTYPE html SYSTEM "http://www.thymeleaf.org/dtd/xhtml1-strict-thymeleaf-4.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml"
|
||||
xmlns:th="http://www.thymeleaf.org">
|
||||
<head th:include="dist/thymeleaf/common_head :: header('登录')">
|
||||
</head>
|
||||
<body>
|
||||
<div th:insert="~{dist/thymeleaf/common_head :: #body_js}"></div>
|
||||
<div id="app">
|
||||
<h1>登录</h1>
|
||||
<el-form :model="ruleForm2" status-icon :rules="rules2" id="loginForm" action="/fileupload/dologin"
|
||||
method="POST" name="loginForm" ref="ruleForm2" label-width="100px" class="demo-ruleForm">
|
||||
<el-form-item label="用户名" prop="userName">
|
||||
<el-input v-model.number="ruleForm2.userName" name="userName"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="密码" prop="password">
|
||||
<el-input type="password" v-model="ruleForm2.password" name="password" auto-complete="off"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="submitForm('ruleForm2')">提交</el-button>
|
||||
<el-button @click="resetForm('ruleForm2')">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
<script th:src="@{/js/login.js}+'?v=0.1'"></script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user