提交 dd690dc672479019f59d3b61d70ca84115443eb9

作者 guomingshu
1 个父辈 850e3ed6

feat: 验证码逻辑更改

... ... @@ -255,21 +255,27 @@ export default {
255 255 uni.showLoading({
256 256 title: "正在获取验证码",
257 257 });
258   - setTimeout(() => {
259   - uni.hideLoading();
260   - // 通知验证码组件内部开始倒计时
261   -
  258 +
262 259 getSmsCodeApi({ phone: mobile, type: 'teacher_login' }).then(res => {
263 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 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 279 } else {
274 280 this.$u.toast("倒计时结束后再发送");
275 281 }
... ...
注册登录 后发表评论