|
@@ -183,31 +183,31 @@
|
|
|
this.codeText = text;
|
|
|
},
|
|
|
getCode() {
|
|
|
- if (this.tel) {
|
|
|
- this.codeLoading = true
|
|
|
- request({
|
|
|
- url: '/sailun/appStoreBasicInfo/sendCode',
|
|
|
- method: 'post',
|
|
|
- data: {
|
|
|
- "phoneNumber": this.tel,
|
|
|
- "opreaType": "1"
|
|
|
- },
|
|
|
- }).then(res => {
|
|
|
- if (res.data.code == 0) {
|
|
|
- if (this.$refs.uCode.canGetCode) {
|
|
|
- this.$refs.uCode.start();
|
|
|
- } else {
|
|
|
- this.$u.toast('倒计时结束后再发送');
|
|
|
- }
|
|
|
- }
|
|
|
- if (res.data.code == 500) {
|
|
|
- this.$u.toast(res.data.msg);
|
|
|
- }
|
|
|
- }).catch(err => {
|
|
|
- console.log(err)
|
|
|
- }).finally(() => {
|
|
|
- this.codeLoading = false
|
|
|
- })
|
|
|
+ if (this.$u.test.mobile(this.tel)) {
|
|
|
+ if (this.$refs.uCode.canGetCode) {
|
|
|
+ this.codeLoading = true
|
|
|
+ request({
|
|
|
+ url: '/sailun/appStoreBasicInfo/sendCode',
|
|
|
+ method: 'post',
|
|
|
+ data: {
|
|
|
+ "phoneNumber": this.tel,
|
|
|
+ "opreaType": "1"
|
|
|
+ },
|
|
|
+ }).then(res => {
|
|
|
+ if (res.data.code == 0) {
|
|
|
+ this.$refs.uCode.start();
|
|
|
+ }
|
|
|
+ if (res.data.code == 500) {
|
|
|
+ this.$u.toast(res.data.msg);
|
|
|
+ }
|
|
|
+ }).catch(err => {
|
|
|
+ console.log(err)
|
|
|
+ }).finally(() => {
|
|
|
+ this.codeLoading = false
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ this.$u.toast('倒计时结束后再发送');
|
|
|
+ }
|
|
|
} else {
|
|
|
this.$u.toast('请输入手机号');
|
|
|
}
|