mirror of
https://gitee.com/beijing_hongye_huicheng/lilishop-ui.git
synced 2026-08-06 10:57:26 +08:00
refactor: 统一组件导入与消息提示方式
- 将多个组件中的 require 替换为 import,提升代码一致性。 - 更新消息提示方式,使用统一的 Message 和 Modal 组件,增强用户体验。 - 调整部分组件的样式和逻辑,确保界面一致性与可读性。
This commit is contained in:
@@ -94,18 +94,20 @@
|
||||
|
||||
<script>
|
||||
|
||||
import { Message } from "@/utils/message";
|
||||
import * as RegExp from '@/plugins/RegExp.js';
|
||||
import { md5 } from '@/plugins/md5.js';
|
||||
import * as apiLogin from '@/api/login.js';
|
||||
import { sendSms } from '@/api/common.js';
|
||||
import Verify from '@/components/verify';
|
||||
import { User, Lock, Iphone, Document } from '@element-plus/icons-vue';
|
||||
import config from '@/config';
|
||||
export default {
|
||||
name: 'SignUp',
|
||||
components: { Verify, User, Lock, Iphone, Document },
|
||||
data () {
|
||||
return {
|
||||
config:require('@/config'),
|
||||
config,
|
||||
year: new Date().getFullYear(),
|
||||
formRegist: {
|
||||
// 注册表单
|
||||
@@ -152,10 +154,10 @@ export default {
|
||||
data.password = md5(data.password);
|
||||
apiLogin.regist(data).then((res) => {
|
||||
if (res.success) {
|
||||
this.$Message.success('注册成功!');
|
||||
Message.success('注册成功!');
|
||||
this.$router.push('login');
|
||||
} else {
|
||||
this.$Message.warning(res.message || '注册失败');
|
||||
Message.warning(res.message || '注册失败');
|
||||
}
|
||||
}).catch(() => {});
|
||||
}).catch(() => {});
|
||||
@@ -164,11 +166,11 @@ export default {
|
||||
sendCode () {
|
||||
if (this.time === 60) {
|
||||
if (this.formRegist.mobilePhone === '') {
|
||||
this.$Message.warning('请先填写手机号');
|
||||
Message.warning('请先填写手机号');
|
||||
return;
|
||||
}
|
||||
if (!this.verifyStatus) {
|
||||
this.$Message.warning('请先完成安全验证');
|
||||
Message.warning('请先完成安全验证');
|
||||
return;
|
||||
}
|
||||
let params = {
|
||||
@@ -177,7 +179,7 @@ export default {
|
||||
};
|
||||
sendSms(params).then(res => {
|
||||
if (res.success) {
|
||||
this.$Message.success('验证码发送成功');
|
||||
Message.success('验证码发送成功');
|
||||
let that = this;
|
||||
this.interval = setInterval(() => {
|
||||
that.time--;
|
||||
@@ -191,7 +193,7 @@ export default {
|
||||
}
|
||||
}, 1000);
|
||||
} else {
|
||||
this.$Message.warning(res.message || '验证码发送失败');
|
||||
Message.warning(res.message || '验证码发送失败');
|
||||
}
|
||||
}).catch(() => {});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user