You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1 line
5.7 KiB

{"remainingRequest":"D:\\YuanZhuoLogistics\\WarehouseManagerVue\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!D:\\YuanZhuoLogistics\\WarehouseManagerVue\\src\\components\\Register.vue?vue&type=style&index=0&id=7bf3755a&scoped=true&lang=css&","dependencies":[{"path":"D:\\YuanZhuoLogistics\\WarehouseManagerVue\\src\\components\\Register.vue","mtime":1729728910124},{"path":"D:\\YuanZhuoLogistics\\WarehouseManagerVue\\node_modules\\css-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\YuanZhuoLogistics\\WarehouseManagerVue\\node_modules\\vue-loader\\lib\\loaders\\stylePostLoader.js","mtime":1655715156000},{"path":"D:\\YuanZhuoLogistics\\WarehouseManagerVue\\node_modules\\postcss-loader\\src\\index.js","mtime":499162500000},{"path":"D:\\YuanZhuoLogistics\\WarehouseManagerVue\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\YuanZhuoLogistics\\WarehouseManagerVue\\node_modules\\vue-loader\\lib\\index.js","mtime":1655715099000}],"contextDependencies":[],"result":[{"type":"Buffer","data":"base64:Cmh0bWwsIGJvZHkgewogIG92ZXJmbG93LXg6IGhpZGRlbjsKfQoKLnJlZ2lzdGVyQm9keSB7CiAgcG9zaXRpb246IGFic29sdXRlOwogIHdpZHRoOiAxMDAlOwogIGhlaWdodDogMTAwJTsKICBiYWNrZ3JvdW5kOnVybCgnLi4vYXNzZXRzL2hvbWUuanBnJyk7CiAgYmFja2dyb3VuZC1zaXplOjEwMCUgMTAwJTsKICBvdmVyZmxvdy14OiBoaWRkZW47Cn0KLnJlZ2lzdGVyRGl2IHsKICBwb3NpdGlvbjogYWJzb2x1dGU7CiAgdG9wOiA1MCU7CiAgbGVmdDogNTAlOwogIG1hcmdpbi10b3A6IC0yMDBweDsKICBtYXJnaW4tbGVmdDogLTI1MHB4OwogIHdpZHRoOiA0NTBweDsKICBoZWlnaHQ6IDQwMHB4OwogIGJhY2tncm91bmQ6ICNmZmY7CiAgYm9yZGVyLXJhZGl1czogNSU7Cn0KLnJlZ2lzdGVyLXRpdGxlIHsKICBtYXJnaW46IDIwcHggMDsKICB0ZXh0LWFsaWduOiBjZW50ZXI7Cn0KLnJlZ2lzdGVyLWNvbnRlbnQgewogIHdpZHRoOiA0MDBweDsKICBoZWlnaHQ6IDMyMHB4OwogIHBvc2l0aW9uOiBhYnNvbHV0ZTsKICB0b3A6IDI1cHg7CiAgbGVmdDogMjVweDsKfQo="},{"version":3,"sources":["Register.vue"],"names":[],"mappings":";AA2HA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"Register.vue","sourceRoot":"src/components","sourcesContent":["<template>\n <div class=\"registerBody\">\n <div style=\"width:98%;text-align:center;color:white;padding: 100px 100px 0 0;font-size:22px;\">\n <h1>欢迎注册仓库管理系统</h1>\n </div>\n \n <div class=\"registerDiv\">\n <div class=\"register-content\">\n <h1 class=\"register-title\">用户注册</h1>\n <el-form :model=\"registerForm\" label-width=\"100px\" :rules=\"rules\" ref=\"registerForm\">\n <el-form-item label=\"账号\" prop=\"no\">\n <el-input style=\"width: 200px\" type=\"text\" v-model=\"registerForm.no\" autocomplete=\"off\" size=\"small\"></el-input>\n </el-form-item>\n <el-form-item label=\"密码\" prop=\"password\">\n <el-input style=\"width: 200px\" type=\"password\" v-model=\"registerForm.password\" show-password autocomplete=\"off\" size=\"small\"></el-input>\n </el-form-item>\n <el-form-item label=\"确认密码\" prop=\"confirmPassword\">\n <el-input style=\"width: 200px\" type=\"password\" v-model=\"registerForm.confirmPassword\" show-password autocomplete=\"off\" size=\"small\"></el-input>\n </el-form-item>\n <el-form-item>\n <el-button type=\"primary\" @click=\"register\" :disabled=\"register_disabled\">注 册</el-button>\n </el-form-item>\n </el-form>\n </div>\n </div>\n </div>\n</template>\n\n<script>\nexport default {\n name: \"Register\",\n data() {\n return {\n register_disabled: false, // 防止多次提交\n registerForm: {\n no: '',\n password: '',\n confirmPassword: ''\n },\n rules: {\n no: [\n { required: true, message: '请输入账号', trigger: 'blur' }\n ],\n password: [\n { required: true, message: '请输入密码', trigger: 'blur' }\n ],\n confirmPassword: [\n { required: true, message: '请确认密码', trigger: 'blur' },\n { validator: (rule, value, callback) => {\n if (value !== this.registerForm.password) {\n callback(new Error('两次输入密码不一致'));\n } else {\n callback();\n }\n }, trigger: 'blur' }\n ],\n }\n };\n },\n methods: {\n register() {\n this.register_disabled = true;\n this.$refs.registerForm.validate((valid) => {\n if (valid) {\n // 去后台注册用户\n this.$axios.post(this.$httpUrl + '/user/register', this.registerForm).then(res => res.data).then(res => {\n console.log(res);\n if (res.code == 200) {\n alert('注册成功!');\n // 可以在这里添加跳转到登录页面的逻辑\n } else {\n this.register_disabled = false;\n alert('注册失败,请重试!');\n return false;\n }\n });\n } else {\n this.register_disabled = false;\n console.log('校验失败');\n return false;\n }\n });\n }\n }\n}\n</script>\n\n<style scoped>\n html, body {\n overflow-x: hidden;\n }\n\n .registerBody {\n position: absolute;\n width: 100%;\n height: 100%;\n background:url('../assets/home.jpg');\n background-size:100% 100%;\n overflow-x: hidden;\n }\n .registerDiv {\n position: absolute;\n top: 50%;\n left: 50%;\n margin-top: -200px;\n margin-left: -250px;\n width: 450px;\n height: 400px;\n background: #fff;\n border-radius: 5%;\n }\n .register-title {\n margin: 20px 0;\n text-align: center;\n }\n .register-content {\n width: 400px;\n height: 320px;\n position: absolute;\n top: 25px;\n left: 25px;\n }\n</style>"]}]}