Commit 635e8297 Harvey

与登录相关的跳转改为redirectTo

1 个父辈 2b339666
......@@ -67,9 +67,8 @@ async function graphql(options = {}) {
if (res.Error == '未登录') {
try {
if (Android) window.location.href = 'ydncp://www.ydniu.com?type=7'
} catch (e) {
console.log(e.message)
uni.navigateTo({
} catch (e) {
uni.redirectTo({
url: `/login?from=${encodeURIComponent(getCurrentPages()[0].__page__.fullPath)}`
})
}
......
......@@ -66,11 +66,21 @@
return
}
uni.navigateTo({
uni.redirectTo({
url: decodeURIComponent(this.from)
})
},
async sendMobileCode() {
async sendMobileCode() {
if (this.mobile.length != 11) {
uni.showToast({
icon: "none",
icon: 'error',
title: "手机号有误",
});
return;
}
var yzm = this.yzm
if (yzm.class == 'disabled') {
uni.showToast({
......@@ -84,11 +94,10 @@
const res = await uni.$u.request.post({
data: {
query: `mutation{ydn_send_mobile_code(mobile:"15574985121",type:7)}`
query: `mutation{ydn_send_mobile_code(mobile:"${this.mobile}",type:7)}`
}
}).then(a => a.data.data.ydn_send_mobile_code);
console.log(res)
if (res.success == '1') {
uni.showToast({
title: '验证码发送成功',
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!