Commit 635e8297 Harvey

与登录相关的跳转改为redirectTo

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