正在显示
1 个修改的文件
包含
17 行增加
和
11 行删除
| @@ -255,21 +255,27 @@ export default { | @@ -255,21 +255,27 @@ export default { | ||
| 255 | uni.showLoading({ | 255 | uni.showLoading({ |
| 256 | title: "正在获取验证码", | 256 | title: "正在获取验证码", |
| 257 | }); | 257 | }); |
| 258 | - setTimeout(() => { | ||
| 259 | - uni.hideLoading(); | ||
| 260 | - // 通知验证码组件内部开始倒计时 | ||
| 261 | - | 258 | + |
| 262 | getSmsCodeApi({ phone: mobile, type: 'teacher_login' }).then(res => { | 259 | getSmsCodeApi({ phone: mobile, type: 'teacher_login' }).then(res => { |
| 263 | console.warn(res) | 260 | console.warn(res) |
| 264 | - this.$refs.uCode.start(); | 261 | + if (res) { |
| 262 | + setTimeout(() => { | ||
| 263 | + uni.hideLoading(); | ||
| 264 | + // 通知验证码组件内部开始倒计时 | ||
| 265 | + this.$refs.uCode.start(); | ||
| 266 | + }, 1000); | ||
| 267 | + } else { | ||
| 268 | + this.$u.toast('网络错误!'); | ||
| 269 | + } | ||
| 265 | }).catch(errors => { | 270 | }).catch(errors => { |
| 266 | - uni.showToast({ | ||
| 267 | - title: errors.data.msg, | ||
| 268 | - icon: "none", | ||
| 269 | - duration: 2500, | ||
| 270 | - }) | 271 | + // uni.showToast({ |
| 272 | + // title: errors.data.msg, | ||
| 273 | + // icon: "none", | ||
| 274 | + // duration: 2500, | ||
| 275 | + // }) | ||
| 276 | + this.$u.toast('网络错误!'); | ||
| 271 | }) | 277 | }) |
| 272 | - }, 1000); | 278 | + |
| 273 | } else { | 279 | } else { |
| 274 | this.$u.toast("倒计时结束后再发送"); | 280 | this.$u.toast("倒计时结束后再发送"); |
| 275 | } | 281 | } |
请
注册
或
登录
后发表评论