瀏覽代碼

[bugfix] test open

jihuaqiang 2 年之前
父節點
當前提交
8269dfbde4
共有 1 個文件被更改,包括 3 次插入1 次删除
  1. 3 1
      components/MobileLandPage.vue

+ 3 - 1
components/MobileLandPage.vue

@@ -198,6 +198,8 @@ export default {
 			location.href = `/course?useful=${this.useFul ? '1' : '0'}&playType=${this.playType}&rewardType=${this.rewardType}&postId=${this.postId}`;
 		},
 		async twitterAuth() {
+			let win = window.open();
+			win.opener = null;
 			postRequest(`/denet/user/twitterRequestToken`, {
 				params: {
 					oauthCallback: `${location.protocol}//${location.host}/authlogin`,
@@ -205,7 +207,7 @@ export default {
 			}).then(({ code, data }) => {
 				if (code == 0) {
 					let url = getOauthUrl(data.authToken);
-					let win = window.open(url);
+					win.location.href = url;
 					this.timer.value = setInterval(() => {
 						if (win && win.closed) {
 							clearInterval(this.timer.value);