| | |
| | | |
| | | </div> |
| | | </div> |
| | | |
| | | |
| | | <!-- 添加QQ客服按钮 --> |
| | | <div class="qq-service-btn" @click="openQQChat"> |
| | | <img :src="require('@/assets/image/qq.png')" alt="QQ客服"> |
| | | <span>QQ客服</span> |
| | | </div> |
| | | <el-dialog :visible.sync="open" style="margin: 0px;" customClass="customWidth" width="620px"> |
| | | <el-form ref="loginForm" :model="loginForm" :rules="loginRules" class="login-form" style="margin: 0px;"> |
| | | <h3 class="title">登录本都都家网</h3> |
| | |
| | | </el-button> |
| | | |
| | | </el-form-item> |
| | | |
| | | <!-- 添加忘记密码按钮 --> |
| | | <el-form-item> |
| | | <el-link type="primary" @click="openForgotPasswordDialog">忘记密码</el-link> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <a href="https://www.bendudu.com:8080/profile/upload/2023/10/10/Bendudu20231010_20231010203358A033.apk">点击此处下载应用程序</a> |
| | | |
| | |
| | | </el-form-item> |
| | | <el-form-item style="width:100%;"> |
| | | <el-button |
| | | :loading="loading" |
| | | :loading="loadingr" |
| | | size="medium" |
| | | type="primary" |
| | | style="width:100%;" |
| | | @click.native.prevent="handleRegister" |
| | | > |
| | | <span v-if="!loading">注 册</span> |
| | | <span v-if="!loadingr">注 册</span> |
| | | <span v-else>注 册 中...</span> |
| | | </el-button> |
| | | |
| | |
| | | |
| | | </div> |
| | | </el-dialog> |
| | | <el-dialog :visible.sync="forgotPasswordDialogVisible" :title="forgotPasswordStep === 1 ? '忘记密码' : '重置密码'" width="30%"> |
| | | <!-- 步骤 1:输入邮箱发送验证码 --> |
| | | <div v-if="forgotPasswordStep === 1"> |
| | | <p style="margin-bottom: 20px; color: #666;">忘记密码,可以通过邮箱找回,请输入注册邮箱获取验证码</p> |
| | | <el-form ref="forgotPasswordFormStep1" :model="forgotPasswordForm" :rules="forgotPasswordRulesStep1"> |
| | | <el-form-item prop="nickName"> |
| | | <el-input |
| | | v-model="forgotPasswordForm.nickName" |
| | | type="text" |
| | | auto-complete="off" |
| | | placeholder="请输入用户名" |
| | | ></el-input> |
| | | </el-form-item> |
| | | <el-form-item prop="email"> |
| | | <el-input |
| | | v-model="forgotPasswordForm.email" |
| | | type="text" |
| | | auto-complete="off" |
| | | placeholder="请输入注册邮箱" |
| | | ></el-input> |
| | | </el-form-item> |
| | | |
| | | </el-form> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <el-button @click="forgotPasswordDialogVisible = false">取消</el-button> |
| | | <el-button type="primary" @click="sendVerificationCode">发送验证码</el-button> |
| | | </span> |
| | | </div> |
| | | <!-- 步骤 2:输入验证码和新密码进行修改 --> |
| | | <div v-else> |
| | | <p style="margin-bottom: 20px; color: #666;">请输入收到的验证码和新密码重置密码</p> |
| | | <el-form ref="forgotPasswordFormStep2" :model="forgotPasswordForm" :rules="forgotPasswordRulesStep2"> |
| | | <el-form-item prop="nickName"> |
| | | <el-input |
| | | v-model="forgotPasswordForm.nickName" |
| | | type="text" |
| | | auto-complete="off" |
| | | placeholder="请输入用户名" |
| | | ></el-input> |
| | | </el-form-item> |
| | | <el-form-item prop="code"> |
| | | <el-input |
| | | v-model="forgotPasswordForm.code" |
| | | auto-complete="off" |
| | | placeholder="请输入验证码" |
| | | ></el-input> |
| | | </el-form-item> |
| | | <el-form-item prop="newPassword"> |
| | | <el-input |
| | | v-model="forgotPasswordForm.newPassword" |
| | | type="password" |
| | | auto-complete="off" |
| | | placeholder="请输入新密码" |
| | | ></el-input> |
| | | </el-form-item> |
| | | <el-form-item prop="confirmNewPassword"> |
| | | <el-input |
| | | v-model="forgotPasswordForm.confirmNewPassword" |
| | | type="password" |
| | | auto-complete="off" |
| | | placeholder="请再次输入新密码" |
| | | ></el-input> |
| | | </el-form-item> |
| | | </el-form> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <el-button @click="goBackToStep1">返回</el-button> |
| | | <el-button @click="forgotPasswordDialogVisible = false">取消</el-button> |
| | | <el-button type="primary" @click="submitPasswordReset">确定</el-button> |
| | | </span> |
| | | </div> |
| | | </el-dialog> |
| | | |
| | | <el-dialog :visible.sync="qqDialogVisible" title="QQ客服" width="400px"> |
| | | <div style="text-align: center; padding: 20px;"> |
| | | <img :src="require('@/assets/image/qq.png')" alt="QQ客服" style="width: 80px; height: 80px; margin-bottom: 15px;"> |
| | | <h3 style="margin-bottom: 15px;">客服QQ: 3224414357</h3> |
| | | <p style="margin-bottom: 20px; color: #666;">请添加好友后发起会话</p> |
| | | <div style="display: flex; justify-content: center; gap: 15px;"> |
| | | <el-button type="primary" @click="copyQQ" plain> |
| | | 复制QQ号 |
| | | </el-button> |
| | | <el-button type="success" @click="addQQFriend"> |
| | | 添加好友 |
| | | </el-button> |
| | | </div> |
| | | </div> |
| | | </el-dialog> |
| | | <!-- 底部 --> |
| | | <div class="el-login-footer" > |
| | | <span style="color: black; ">Copyright © GDUT All Rights Reserved.<span v-html="'\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0'"></span></span> |
| | | <span style="color: black; "><span v-html="'\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0'"></span></span> |
| | | <a href="https://beian.miit.gov.cn/" target="_blank" style="color: black; ">粤ICP备2023050334号<span v-html="'\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0'"></span>公安备案号44010402003045</a> |
| | | </div> |
| | | </div> |
| | |
| | | <div class="gpr"> |
| | | <!-- <img :key="url" :src="url" style="width:100%;height:30%"></img> --> |
| | | </div> |
| | | |
| | | |
| | | |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import { getCodeImg,Download,register } from "@/api/login"; |
| | | import { getCodeImg,Download,register,getEmailCode, resetPassword } from "@/api/login"; |
| | | import Cookies from "js-cookie"; |
| | | import { encrypt, decrypt } from '@/utils/jsencrypt' |
| | | |
| | |
| | | |
| | | } |
| | | }; |
| | | const validateEmail = (rule, value, callback) => { |
| | | const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/; |
| | | if (!value) { |
| | | return callback(new Error('请输入邮箱')); |
| | | } |
| | | if (!emailRegex.test(value)) { |
| | | return callback(new Error('请输入正确的邮箱格式')); |
| | | } |
| | | callback(); |
| | | }; |
| | | const equalToNewPassword = (rule, value, callback) => { |
| | | if (this.forgotPasswordForm.newPassword !== value) { |
| | | callback(new Error("两次输入的新密码不一致")); |
| | | } else { |
| | | callback(); |
| | | } |
| | | }; |
| | | return { |
| | | // ... existing code ... |
| | | nnme: '', |
| | | forgotPasswordDialogVisible: false, |
| | | forgotPasswordStep: 1, // 1 表示输入邮箱步骤,2 表示输入验证码和新密码步骤 |
| | | forgotPasswordForm: { |
| | | nickName: '', |
| | | email: '', |
| | | code: '', |
| | | newPassword: '', |
| | | confirmNewPassword: '' |
| | | }, |
| | | forgotPasswordRulesStep1: { |
| | | email: [ |
| | | { validator: validateEmail, trigger: 'blur' } |
| | | ] |
| | | }, |
| | | forgotPasswordRulesStep2: { |
| | | code: [ |
| | | { required: true, trigger: 'blur', message: '请输入验证码' } |
| | | ], |
| | | newPassword: [ |
| | | { required: true, trigger: 'blur', message: '请输入新密码' }, |
| | | { min: 5, max: 20, message: '新密码长度必须介于 5 和 20 之间', trigger: 'blur' } |
| | | ], |
| | | confirmNewPassword: [ |
| | | { required: true, trigger: 'blur', message: '请再次输入新密码' }, |
| | | { validator: equalToNewPassword, trigger: 'blur' } |
| | | ] |
| | | }, |
| | | qqDialogVisible: false, |
| | | url: require('../assets/images/index.png'), |
| | | openRegister: false, |
| | | avatar: undefined, |
| | |
| | | code: [{ required: true, trigger: "change", message: "请输入验证码" }] |
| | | }, |
| | | loading: false, |
| | | loadingr: false, |
| | | // 验证码开关 |
| | | captchaEnabled: true, |
| | | // 注册开关 |
| | |
| | | this.getCookie(); |
| | | }, |
| | | methods: { |
| | | openForgotPasswordDialog() { |
| | | this.forgotPasswordDialogVisible = true; |
| | | this.forgotPasswordStep = 1; |
| | | this.forgotPasswordForm = { |
| | | nickName: '', |
| | | email: '', |
| | | code: '', |
| | | newPassword: '', |
| | | confirmNewPassword: '' |
| | | }; |
| | | }, |
| | | sendVerificationCode() { |
| | | this.nnme = this.forgotPasswordForm.nickName; |
| | | this.$refs.forgotPasswordFormStep1.validate(valid => { |
| | | if (valid) { |
| | | getEmailCode({ nickName:this.forgotPasswordForm.nickName, email: this.forgotPasswordForm.email }).then(() => { |
| | | this.$message.success('验证码已发送至您的邮箱,请查收'); |
| | | this.forgotPasswordStep = 2; |
| | | }).catch(() => { |
| | | this.$message.error('验证码发送失败,请重试'); |
| | | }); |
| | | } |
| | | }); |
| | | }, |
| | | submitPasswordReset() { |
| | | this.$refs.forgotPasswordFormStep2.validate(valid => { |
| | | if (valid) { |
| | | var formData = new FormData(); |
| | | formData.append('nickName', this.forgotPasswordForm.nickName); |
| | | formData.append('verificationCode', this.forgotPasswordForm.code); |
| | | formData.append('newPassword', this.forgotPasswordForm.newPassword); |
| | | resetPassword(formData).then(() => { |
| | | this.$message.success('密码修改成功'); |
| | | this.forgotPasswordDialogVisible = false; |
| | | }).catch(() => { |
| | | this.$message.error('密码修改失败,请重试'); |
| | | }); |
| | | } |
| | | }); |
| | | }, |
| | | goBackToStep1() { |
| | | this.forgotPasswordStep = 1; |
| | | }, |
| | | |
| | | openQQChat() { |
| | | this.qqDialogVisible = true; |
| | | }, |
| | | copyQQ() { |
| | | const qq = '3224414357'; |
| | | navigator.clipboard.writeText(qq).then(() => { |
| | | this.$message.success('QQ号已复制到剪贴板'); |
| | | }).catch(() => { |
| | | // 兼容不支持clipboard API的浏览器 |
| | | const input = document.createElement('input'); |
| | | input.value = qq; |
| | | document.body.appendChild(input); |
| | | input.select(); |
| | | document.execCommand('copy'); |
| | | document.body.removeChild(input); |
| | | this.$message.success('QQ号已复制'); |
| | | }); |
| | | }, |
| | | addQQFriend() { |
| | | window.open('tencent://message/?Menu=yes&uin=3224414357&Site=xxx&Service=10&sigT=10&sigU=10', '_blank'); |
| | | }, |
| | | handleRegister() { |
| | | //alert(this.registerForm.nickname) |
| | | this.$refs.registerForm.validate(valid => { |
| | | if (valid) { |
| | | this.loading = true; |
| | | this.loadingr = false; |
| | | //alert(this.registerForm.nickname) |
| | | register(this.registerForm).then(res => { |
| | | const nickName = this.registerForm.nickname; |
| | |
| | | type: 'success' |
| | | }).then(() => { |
| | | this.openRegister = false; |
| | | this.resetForm("registerForm"); |
| | | // this.$router.push("/login"); |
| | | |
| | | }).catch(() => {}); |
| | | }).catch(() => { |
| | | this.loading = false; |
| | | this.loadingr = true; |
| | | if (this.captchaEnabled) { |
| | | this.getCode(); |
| | | } |