提交 b359bc86 编写于 作者: DCloud_JSON's avatar DCloud_JSON

修改 各类错误toast提示时间为3秒

上级 26a60d45
......@@ -3,13 +3,11 @@ const uniIdCo = uniCloud.importObject("uni-id-co")
const db = uniCloud.database();
const usersTable = db.collection('uni-id-users')
let hostUserInfo = uni.getStorageSync('uni-id-pages-userInfo')||{}
console.log( hostUserInfo);
const data = {
userInfo: hostUserInfo,
hasLogin: Object.keys(hostUserInfo).length != 0
hasLogin: getUniIdTokenExpired() > Date.now()
}
console.log('data', data);
......@@ -23,13 +21,15 @@ export const mutations = {
if (e.result.updated) {
uni.showToast({
title: "更新成功",
icon: 'none'
icon: 'none',
duration: 3000
});
this.setUserInfo(data)
} else {
uni.showToast({
title: "没有改变",
icon: 'none'
icon: 'none',
duration: 3000
});
}
})
......@@ -80,7 +80,8 @@ export const mutations = {
if (showToast) {
uni.showToast({
title: toastText,
icon: 'none'
icon: 'none',
duration: 3000
});
}
this.updateUserInfo()
......
......@@ -123,17 +123,20 @@
this.$refs.captcha.focusCaptchaInput = true
return uni.showToast({
title: '请先输入图形验证码',
icon: 'none'
icon: 'none',
duration: 3000
});
}
if(!this.email) return uni.showToast({
title: "请输入邮箱",
icon: 'none'
icon: 'none',
duration: 3000
});
let reg_email = /@/;
if (!reg_email.test(this.email)) return uni.showToast({
title: "邮箱格式错误",
icon: 'none'
icon: 'none',
duration: 3000
});
const uniIdCo = uniCloud.importObject("uni-id-co", {
customUI: true
......@@ -152,7 +155,8 @@
console.log(result.code);
uni.showToast({
title: "邮箱验证码发送成功",
icon: 'none'
icon: 'none',
duration: 3000
});
this.reverseNumber = Number(this.count);
this.getCode();
......@@ -171,7 +175,8 @@
this.captcha = ""
uni.showToast({
title: e.message,
icon: 'none'
icon: 'none',
duration: 3000
});
}
})
......
......@@ -248,7 +248,8 @@
].includes(type)) {
return uni.showToast({
title: '该登录方式暂未实现,欢迎提交pr',
icon: 'none'
icon: 'none',
duration: 3000
});
}
......@@ -264,7 +265,8 @@
}else{
return uni.showToast({
title: '当前设备不支持此登录,请选择其他登录方式',
icon: 'none'
icon: 'none',
duration: 3000
});
}
}, err => {
......@@ -286,7 +288,8 @@
) {
return uni.showToast({
title: '当前设备不支持此登录,请选择其他登录方式',
icon: 'none'
icon: 'none',
duration: 3000
});
}
......@@ -359,7 +362,8 @@
//console.log("你未同意隐私政策协议");
uni.showToast({
title: "你未同意隐私政策协议",
icon: 'none'
icon: 'none',
duration: 3000
});
}
}
......@@ -383,7 +387,8 @@
fail(err) {
uni.showToast({
title: JSON.stringify(err),
icon: 'none'
icon: 'none',
duration: 3000
});
},
complete: async e => {
......@@ -443,7 +448,8 @@
console.log("login-result", result);
uni.showToast({
title: '登录成功',
icon: 'none'
icon: 'none',
duration: 2000
});
// #ifdef MP-WEIXIN
//如果是微信小程序端的微信登录,且为首次登录,就弹出获取微信昵称+头像用于绑定资料
......
......@@ -123,13 +123,15 @@
this.$refs.captcha.focusCaptchaInput = true
return uni.showToast({
title: '请先输入图形验证码',
icon: 'none'
icon: 'none',
duration: 3000
});
}
let reg_phone = /^1\d{10}$/;
if (!reg_phone.test(this.phone)) return uni.showToast({
title: "手机号格式错误",
icon: 'none'
icon: 'none',
duration: 3000
});
const uniIdCo = uniCloud.importObject("uni-id-co", {
customUI: true
......@@ -147,7 +149,8 @@
console.log(result.code);
uni.showToast({
title: "短信验证码发送成功",
icon: 'none'
icon: 'none',
duration: 3000
});
this.reverseNumber = Number(this.count);
this.getCode();
......@@ -166,7 +169,8 @@
this.captcha = ""
uni.showToast({
title: e.message,
icon: 'none'
icon: 'none',
duration: 3000
});
}
})
......
......@@ -59,7 +59,8 @@
this.$refs.smsCode.focusSmsCodeInput = true
return uni.showToast({
title: '验证码不能为空',
icon: 'none'
icon: 'none',
duration: 3000
});
}
uniIdCo.loginBySms({
......
......@@ -116,7 +116,8 @@
this.focusPhone = true
return uni.showToast({
title: "手机号码格式不正确",
icon: 'none'
icon: 'none',
duration: 3000
});
}
if (this.needAgreements && !this.agree) {
......@@ -136,7 +137,8 @@
chooseArea() {
uni.showToast({
title: '暂不支持其他国家',
icon: 'none'
icon: 'none',
duration: 3000
});
},
}
......
......@@ -84,21 +84,24 @@
this.focusPassword = true
return uni.showToast({
title: '请输入密码',
icon: 'none'
icon: 'none',
duration: 3000
});
}
if (!this.username.length) {
this.focusUsername = true
return uni.showToast({
title: '请输入手机号/用户名/邮箱',
icon: 'none'
icon: 'none',
duration: 3000
});
}
if (this.needCaptcha && this.captcha.length != 4) {
this.$refs.captcha.getImageCaptcha()
return uni.showToast({
title: '请输入验证码',
icon: 'none'
icon: 'none',
duration: 3000
});
}
......
......@@ -89,7 +89,8 @@
this.$refs.captcha.focusCaptchaInput = true
return uni.showToast({
title: '请输入验证码',
icon: 'none'
icon: 'none',
duration: 3000
});
}
if (this.needAgreements && !this.agree) {
......
......@@ -96,7 +96,8 @@
this.$refs.captcha.focusCaptchaInput = true
return uni.showToast({
title: '请输入验证码',
icon: 'none'
icon: 'none',
duration: 3000
});
}
if (this.needAgreements && !this.agree) {
......
......@@ -52,14 +52,16 @@
this.focusMobile = true
return uni.showToast({
title: '手机号码格式不正确',
icon: 'none'
icon: 'none',
duration: 3000
});
}
if(! /^\d{6}$/.test(this.formData.code)){
this.$refs.smsForm.focusSmsCodeInput = true
return uni.showToast({
title: '验证码格式不正确',
icon: 'none'
icon: 'none',
duration: 3000
});
}
......@@ -69,7 +71,8 @@
console.log(e);
uni.showToast({
title: e.errMsg,
icon: 'none'
icon: 'none',
duration: 3000
});
// #ifdef APP-NVUE
const eventChannel = this.$scope.eventChannel; // 兼容APP-NVUE
......
......@@ -506,7 +506,8 @@ export default {
if (!this.image) {
uni.showToast({
title: '请选择图片',
icon: 'none'
icon: 'none',
duration: 3000
});
return;
}
......@@ -536,7 +537,8 @@ export default {
if (!this.image) {
uni.showToast({
title: '请选择图片',
icon: 'none'
icon: 'none',
duration: 3000
});
return;
}
......@@ -721,7 +723,8 @@ export default {
if (!this.image) {
uni.showToast({
title: '请选择图片',
icon: 'none'
icon: 'none',
duration: 3000
});
return;
}
......@@ -739,7 +742,8 @@ export default {
if (!this.image) {
uni.showToast({
title: '请选择图片',
icon: 'none'
icon: 'none',
duration: 3000
});
return;
}
......
......@@ -45,7 +45,8 @@
uniIdco.closeAccount().then((e) => {
console.log(e);
uni.showToast({
title: '注销成功'
title: '注销成功',
duration: 3000
});
uni.removeStorageSync('uni_id_token');
uni.setStorageSync('uni_id_token_expired', 0)
......
......@@ -183,7 +183,8 @@
})
if (res.errCode) {
uni.showToast({
title: res.errMsg || '绑定失败'
title: res.errMsg || '绑定失败',
duration: 3000
})
}
await mutations.updateUserInfo()
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册