Skip to content

Commit

Permalink
fix: 정책 페이지 연결 수정(safari)v1.4
Browse files Browse the repository at this point in the history
  • Loading branch information
taewan2002 committed Feb 8, 2024
1 parent da6b313 commit e8b7413
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 17 deletions.
14 changes: 8 additions & 6 deletions components/signup/SignUpTerms.vue
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
</template>

<script>
const { $native } = useNuxtApp();
export default {
emits: ["all-checkboxes-checked"],
data() {
Expand Down Expand Up @@ -112,12 +113,13 @@ export default {
return label.replace(/\/(.*?)\//g, "<strong>$1</strong>");
},
handleMoveToBrowser(link) {
const newTab = window.open(link, "_blank");
if (newTab) {
newTab.opener = null;
newTab.referrerPolicy = "no-referrer";
newTab.location.href = serviceCheckbox.content;
}
$native.openLink(link);
// const newTab = window.open(link, "_blank");
// if (newTab) {
// newTab.opener = null;
// newTab.referrerPolicy = "no-referrer";
// newTab.location.href = serviceCheckbox.content;
// }
},
},
};
Expand Down
2 changes: 1 addition & 1 deletion pages/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const router = useRouter();
onMounted(() => {
const isOnboarding = window.localStorage.getItem("isOnboarding");
if (isOnboarding) {
if (!isOnboarding) {
router.replace(`/onboarding`);
return;
}
Expand Down
21 changes: 12 additions & 9 deletions pages/setting/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -130,19 +130,22 @@ export default {
this.$router.push(`/profile/modify`);
},
openKakaoLink() {
window.open("https://pf.kakao.com/_vNxnRG", "_blank");
$native.openLink("https://pf.kakao.com/_vNxnRG");
// window.open("https://pf.kakao.com/_vNxnRG", "_blank");
},
openToSLink() {
window.open(
"https://docent-ai.notion.site/53a465da1ef04985aabba86fdfb5d388?pvs=4",
"_blank",
);
$native.openLink("https://docent-ai.notion.site/53a465da1ef04985aabba86fdfb5d388?pvs=4");
// window.open(
// "https://docent-ai.notion.site/53a465da1ef04985aabba86fdfb5d388?pvs=4",
// "_blank",
// );
},
openPolicyLink() {
window.open(
"https://docent-ai.notion.site/bdd51533f0424658ac5c52b4cc067cad?pvs=4",
"_blank",
);
$native.openLink("https://docent-ai.notion.site/bdd51533f0424658ac5c52b4cc067cad?pvs=4");
// window.open(
// "https://docent-ai.notion.site/bdd51533f0424658ac5c52b4cc067cad?pvs=4",
// "_blank",
// );
},
logout() {
const { reset } = useUserStore();
Expand Down
3 changes: 2 additions & 1 deletion pages/signin/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ export default {
const { getSocialLogin } = useAuthService();
const res = await getSocialLogin(service);
if (res.success) {
window.location.href = res.data.url;
console.log("res.data.url", res.data.url);
await $native.openKakaoLink(res.data.url);
} else {
this.isOAuthFailed = true;
alert("로그인에 실패하였습니다.\n", res.message);
Expand Down
16 changes: 16 additions & 0 deletions plugins/native.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,22 @@ export default defineNuxtPlugin(() => {
}, 300); // 300ms 딜레이
}
},
// openKakaoLink 함수를 native 객체에 추가
openKakaoLink: async (url) => {
if (isIOSApp() && window.webkit && window.webkit.messageHandlers.openKakaoLink) {
window.webkit.messageHandlers.openKakaoLink.postMessage(url);
// } else {
// window.location.href = url;
// }
}
},
openLink: async (url) => {
if (isIOSApp() && window.webkit && window.webkit.messageHandlers.openLink) {
window.webkit.messageHandlers.openLink.postMessage(url);
} else {
window.location.href = url;
}
}
};

// native 객체를 Nuxt 애플리케이션에 제공
Expand Down

0 comments on commit e8b7413

Please sign in to comment.