不勾选权限没有反应的代码
let _this = this; uni.showModal({ title: '提示', content: '是否退出登录', confirmText: "确定", // 确认按钮文字 cancelText:"取消", confirmColor: '#1295c9', cancelColor: '#7f7f7f', success: function(res) { if (res.confirm) { uni.request({ url: _this.$serverUrl, data: { request_type: 'USER_LOGOUT', app_id: _this.userInfo.app_id, }, method: 'POST', success: (res) => { if (res.data.code == 200) { _this.logout(res); uni.redirectTo({ url: "../login/login" }) }else{ uni.showToast({ title:'退出失败,请稍后再试', icon:"error" }) } }, fail: (res) => { uni.showToast({ title:'退出失败', icon:"error" }) } }) } else if (res.cancel) { uni.showToast({ title:"取消退出", icon:"none" }) } }, fail: (res) => { uni.showToast({ title:JSON.stringify(res), icon:"none" }) } });
点击修改密码,表单验证也无效果
updatePwd() { let _this = this; if(!_this.form.old_pwd || _this.form.new_pwd){ uni.showToast({ title:"表单信息不能为空", icon:"error" }); }else{ let _data = { phone: _this.phone, request_type: 'USER_CHANGE_PASSWORD', app_id: _this.app_id, old_password: this.form.old_pwd, password: this.form.new_pwd }; uni.showModal({ title: '提示', content: '确认修改密码吗?', confirmText: "确定", // 确认按钮文字 cancelText:"取消", confirmColor: '#1295c9', cancelColor: '#7f7f7f', success: function(res) { if (res.confirm) { uni.request({ url: _this.$serverUrl, data: _data, method: 'POST', success: (res) => { if (res.data.code == 200) { uni.redirectTo({ url: "../login/login" }) }else{ uni.showToast({ title:"密码修改失败,稍后重试", icon:"none" }); } }, fail: (res) => { uni.showToast({ title:JSON.stringify(res), icon:"none" }) } }) } else if (res.cancel) { uni.uni.showToast({ title: '取消修改', icon:"none" }); } }, }); } }
标签:真机,title,res,app,apk,uni,icon,打包,showToast From: https://www.cnblogs.com/LindaBlog/p/16594973.html