IOTAT任务周志
负责人:黄越 时间:2019/10/29至 2019/11/2 任务基本信息: 1.完成签到系统登陆注册 2. 介绍相关技术
任务完成情况:
1.需要实现的登陆界面
2.目前实现效果
登陆
注册
主要函数代码
register () {
var that = this
this.$axios({
method: 'post',
url: 'http://10.10.5.130:18887/register?userName=' + that.userName + '&password=' + that.passWord + '&mac=' + that.mac + '&realName=' + that.realName + '&stuId=' + that.stuId + '&userMail=' + that.userMail
}).then(res => {
console.log(res)
})
},
checkUsername () {
var that = this
if (this.userName.length > that.maxlength || this.userName.length < that.minlength) {
this.$message({
showClose: true,
message: '账号输入不合法',
type: 'warning'
});
}
},
checkPassword () {
var that = this
if (this.passWord.length > that.maxlength || this.passWord.length < that.minlength) {
this.$message({
showClose: true,
message: '密码输入不合法',
type: 'warning'
});
}
},
checkRepassword () {
var that = this
if (this.rePassWord.length > that.maxlength || this.rePassWord.length < that.minlength) {
this.$message({
showClose: true,
message: '密码输入不合法',
type: 'warning'
});
}
if (this.rePassWord != this.passWord) {
this.$message({
showClose: true,
message: '密码输入不一致',
type: 'warning'
});
}
},
checkRealName () {
var realname = /^[\u4E00-\u9FA5]{2,4}$/
if (!realname.test(this.realName)) {
this.$message({
showClose: true,
message: '真实姓名输入不合法',
type: 'warning'
});
}
},
checkStuid () {
if (this.stuId.length != 10) {
this.$message({
showClose: true,
message: '学号输入不合法',
type: 'warning'
});
}
},
checkUserMail () {
var usermail = /^[a-zA-Z0-9_-]+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$/
if (!usermail.test(this.userMail)) { //正则表达式的使用
this.$message({
showClose: true,
message: '邮箱输入不合法',
type: 'warning'
});
}
},
checkMac () {
var mac = /^([0-9a-fA-F]{2})(([/\s:][0-9a-fA-F]{2}){5})$/ //正则表达式的使用
if (!mac.test(this.Mac)) {
this.$message({
showClose: true,
message: 'MAC地址输入不合法',
type: 'warning'
});
}
},
gologin () {
this.$router.push("/")
}
}