|
@@ -58,11 +58,51 @@ export default {
|
|
},
|
|
},
|
|
|
|
|
|
getSubmit1() {
|
|
getSubmit1() {
|
|
- window.location.href = this.flowUrl;
|
|
|
|
|
|
+ if (this.flowUrl.length === 0) {
|
|
|
|
+ deviceUrlInfo({
|
|
|
|
+ code: this.state,
|
|
|
|
+ code: this.openId,
|
|
|
|
+ }).then((res) => {
|
|
|
|
+ if (res.code === 0) {
|
|
|
|
+ this.flowUrl = res.data.flowUrl;
|
|
|
|
+ this.wifiUrl = res.data.wifiUrl;
|
|
|
|
+ window.location.href = this.flowUrl;
|
|
|
|
+ } else {
|
|
|
|
+ uni.showToast({
|
|
|
|
+ title: res.message,
|
|
|
|
+ icon: "none",
|
|
|
|
+ mask: true,
|
|
|
|
+ duration: 2000,
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ } else {
|
|
|
|
+ window.location.href = this.flowUrl;
|
|
|
|
+ }
|
|
},
|
|
},
|
|
|
|
|
|
getSubmit2() {
|
|
getSubmit2() {
|
|
- window.location.href = this.wifiUrl;
|
|
|
|
|
|
+ if (this.wifiUrl.length === 0) {
|
|
|
|
+ deviceUrlInfo({
|
|
|
|
+ code: this.state,
|
|
|
|
+ code: this.openId,
|
|
|
|
+ }).then((res) => {
|
|
|
|
+ if (res.code === 0) {
|
|
|
|
+ this.flowUrl = res.data.flowUrl;
|
|
|
|
+ this.wifiUrl = res.data.wifiUrl;
|
|
|
|
+ window.location.href = this.wifiUrl;
|
|
|
|
+ } else {
|
|
|
|
+ uni.showToast({
|
|
|
|
+ title: res.message,
|
|
|
|
+ icon: "none",
|
|
|
|
+ mask: true,
|
|
|
|
+ duration: 2000,
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ } else {
|
|
|
|
+ window.location.href = this.wifiUrl;
|
|
|
|
+ }
|
|
},
|
|
},
|
|
},
|
|
},
|
|
};
|
|
};
|