This commit is contained in:
dong_bo0602 2022-12-07 21:49:31 +08:00
parent 457c8fb9f1
commit dbb1723309
4 changed files with 56 additions and 49 deletions

View File

@ -13,7 +13,7 @@ module.exports = {
proxyTable: {}, proxyTable: {},
// Various Dev Server settings // Various Dev Server settings
host: '192.168.0.106', // can be overwritten by process.env.HOST host: '192.168.1.8', // can be overwritten by process.env.HOST
port: 8080, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined port: 8080, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
autoOpenBrowser: false, autoOpenBrowser: false,
errorOverlay: true, errorOverlay: true,

View File

@ -1,11 +1,15 @@
const registerUrl = 'https://www.yjkaoshi.cn/signup/' // const registerUrl = 'https://www.yjkaoshi.cn/signup/'
const loginUrl = 'https://www.yjkaoshi.cn/signup/' // const loginUrl = 'https://www.yjkaoshi.cn/signup/'
const signUrl = 'https://www.yjkaoshi.cn/signup/' // const signUrl = 'https://www.yjkaoshi.cn/signup/'
const personInfoUrl = 'https://www.yjkaoshi.cn/signup/' // const personInfoUrl = 'https://www.yjkaoshi.cn/signup/'
// const registerUrl = 'http://192.168.0.109:8070/signup/' const registerUrl = 'http://1.180.60.42:8092/signup/'
// const loginUrl = 'http://192.168.0.109:8070/signup/' const loginUrl = 'http://1.180.60.42:8092/signup/'
// const signUrl = 'http://192.168.0.109:8070/signup/' const signUrl = 'http://1.180.60.42:8092/signup/'
// const personInfoUrl = 'http://192.168.0.109:8070/signup/' const personInfoUrl = 'http://1.180.60.42:8092/signup/'
// const registerUrl = 'http://175.24.42.217:9101/signup/'
// const loginUrl = 'http://175.24.42.217:9101/signup/'
// const signUrl = 'http://175.24.42.217:9101/signup/'
// const personInfoUrl = 'http://175.24.42.217:9101/signup/'
export default { export default {
registerUrl, registerUrl,
loginUrl, loginUrl,

View File

@ -28,7 +28,7 @@
<router-link to="/login"> <router-link to="/login">
<img src="@/assets/images/login-box1.png" alt=""> <img src="@/assets/images/login-box1.png" alt="">
</router-link> </router-link>
<a href="https://www.yjkaoshi.cn/signup/" target="_blank"> <a href="http://1.180.60.42:8092/signup/" target="_blank">
<img src="@/assets/images/login-box2.png" alt=""> <img src="@/assets/images/login-box2.png" alt="">
</a> </a>
</div> </div>

View File

@ -44,46 +44,49 @@ export default {
var self = this var self = this
var reg=/^[1][3,4,5,6,7,8,9][0-9]{9}$/; var reg=/^[1][3,4,5,6,7,8,9][0-9]{9}$/;
var pwdReg = /^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]*$/; var pwdReg = /^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]*$/;
if (!self.registerInfo.username) { if (!self.isLoading) {
self.$layer.msg('用户名不能为空') if (!self.registerInfo.username) {
return self.$layer.msg('用户名不能为空')
} return
if (!self.registerInfo.password) { }
self.$layer.msg('密码不能为空') if (!self.registerInfo.password) {
return self.$layer.msg('密码不能为空')
} return
if (!self.registerInfo.passwordSame) { }
self.$layer.msg('请再次输入密码') if (!self.registerInfo.passwordSame) {
return self.$layer.msg('请再次输入密码')
} return
if (!reg.test(self.registerInfo.username)) { }
self.$layer.msg('用户名应为有效手机号码') if (!reg.test(self.registerInfo.username)) {
return self.$layer.msg('用户名应为有效手机号码')
} return
if (self.registerInfo.password != self.registerInfo.passwordSame) { }
self.$layer.msg('两次输入的密码不一致') if (self.registerInfo.password != self.registerInfo.passwordSame) {
return self.$layer.msg('两次输入的密码不一致')
} return
if (!pwdReg.test(self.registerInfo.password)) { }
self.$layer.msg('密码应由字母和数字组成') if (!pwdReg.test(self.registerInfo.password)) {
return self.$layer.msg('密码应由字母和数字组成')
} return
if (self.registerInfo.username && self.registerInfo.password && self.registerInfo.passwordSame) { }
self.isLoading = true if (self.registerInfo.username && self.registerInfo.password && self.registerInfo.passwordSame) {
axios.post(self.url + 'app/register/default', self.registerInfo).then(function (res) { self.isLoading = true
if (res.status == '200') { axios.post(self.url + 'app/register/default', self.registerInfo).then(function (res) {
if (res.status == '200') {
self.isLoading = false
self.$layer.msg('注册成功')
setTimeout(function () {
self.$router.push('/login')
}, 1500)
}
}).catch(function (error) {
// self.$layer.msg(error.response.data.message)
self.$layer.msg('用户名可能已存在')
self.isLoading = false self.isLoading = false
self.$layer.msg('注册成功') })
setTimeout(function () { } else {
self.$router.push('/login') self.$layer.msg('用户名或密码不能为空')
}, 1500) }
}
}).catch(function (error) {
self.$layer.msg(error.response.data.msg)
self.isLoading = false
})
} else {
self.$layer.msg('用户名或密码不能为空')
} }
} }
}, },