+
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{
+ computeTime > 0 ? `(${computeTime}s)已发送` : "获取验证码"
+ }}
+
+
+
+
+
+
@@ -109,6 +110,8 @@ export default {
formData: {
username: "admin", //账号
password: "admin123", //密码
+ // username:'',
+ // password:'',
code: null, //图片验证码
uuid: null, //识别uuid
mobile: null, //手机号
@@ -131,7 +134,6 @@ export default {
// signature: res.signature,// 必填,签名,见附录1
// jsApiList: ['scanQRCode'] // 必填,需要使用的JS接口列表,所有JS接口列表见附录2
// });
-
//分享要用encodeURIComponent()方法
},
methods: {
@@ -145,12 +147,16 @@ export default {
if (!this.computeTime) {
let myreg = /^[1][3,4,5,7,8,9][0-9]{9}$/;
if (!myreg.test(this.formData.mobile)) {
- this.$notify({ type: "warning", message: "手机号格式不正确" });
+ this.$dialog.alert({
+ message: '手机号格式不正确',
+ });
return false;
}
getSmsCode(this.formData.mobile).then((res) => {
if (res.code === 200) {
- this.$notify({ type: "success", message: "验证码已发送" });
+ this.$dialog.alert({
+ message: '验证码已发送',
+ });
this.loginForm.uuid = res.uuid;
this.computeTime = 60;
this.timer = setInterval(() => {
@@ -168,10 +174,14 @@ export default {
//短信登录
let myreg = /^[1][3,4,5,7,8,9][0-9]{9}$/;
if (!myreg.test(this.formData.mobile)) {
- this.$notify({ type: "warning", message: "手机号格式不正确" });
+ this.$dialog.alert({
+ message: '手机号格式不正确',
+ });
return false;
} else if (this.formData.smsCode == "") {
- this.$notify({ type: "warning", message: "短信验证码不能为空" });
+ this.$dialog.alert({
+ message: '短信验证码不能为空',
+ });
return false;
}
this.loading = true;
@@ -186,13 +196,19 @@ export default {
} else {
//账号密码登录
if (this.formData.username == "") {
- this.$notify({ type: "warning", message: "账号不能为空" });
+ this.$dialog.alert({
+ message: '账号不能为空',
+ });
return false;
} else if (this.formData.password == "") {
- this.$notify({ type: "warning", message: "密码不能为空" });
+ this.$dialog.alert({
+ message: '密码不能为空',
+ });
return false;
} else if (this.formData.code == "") {
- this.$notify({ type: "warning", message: "图片验证码不能为空" });
+ this.$dialog.alert({
+ message: '图片验证码不能为空',
+ });
return false;
}
this.$store
@@ -212,7 +228,7 @@ export default {
\ No newline at end of file