Commit 1e131472 authored by youjie's avatar youjie

绑定line

parent 357589c3
......@@ -39,7 +39,7 @@ const router = createRouter({
component: () => import ('../views/personalCenter/myCoupon.vue')
},
{
path: '/accountCenter/:type?',//账号中心
path: '/accountCenter/:type/:reType?',//账号中心
meta: { title: "page.accountCenter" },
component: () => import ('../views/personalCenter/accountCenter.vue')
},
......
......@@ -234,7 +234,7 @@ const goPage = (path:string) => {
router.push(path)
return
}
router.push('/accountCenter')
router.push('/accountCenter/1')
}
// 验证邮箱是否可用
......@@ -371,7 +371,7 @@ const handleSubmit = async () => {
// 延迟跳转到登录页
setTimeout(() => {
if(params&&params.email){
router.push('/accountCenter')
router.push('/accountCenter/1')
}else{
router.push('/login')
}
......
......@@ -26,7 +26,7 @@
</div>
</template>
<script setup lang="ts">
import { ref, onMounted } from 'vue'
import { ref, onMounted, watch } from 'vue'
import { useI18n } from 'vue-i18n'
import { useRouter } from 'vue-router'
import account from "./components/accountCenter/account.vue"
......@@ -62,6 +62,12 @@ const TitleBars = [
value: 4
}
]
console.log(router ,'newVal-----')
watch(() => router, (newVal, oldVal) => {
if(newVal){
console.log(newVal,'newVal-----')
}
})
const changeStatus = (value: number) => {
current.value = value
......
......@@ -11,7 +11,7 @@
</div>
<div class="mt-[13px] text-lg font-medium text-center truncate">{{ userInfo?.name || '' }}</div>
<div class="flex justify-center items-center mt-[10px] cursor-pointer"
@click="goPage('/accountCenter')">
@click="goPage('/accountCenter/1')">
<span v-if="!userInfo?.IsComplete" class="LeftViewTisp w-[6px] h-[6px] rounded-full"></span>
<span class="LeftViewData ml-[5px] text-sm font-medium text-[#666]">
{{ t('personal.completeProfile') }}
......
......@@ -245,7 +245,10 @@ const generateState = () => {
// line授权
const loginWithLine = () => {
const channelId = openInfo.value.appId; // 替换为你的 LINE Channel ID
const redirectUri = encodeURIComponent(openInfo.value.redirectUri || 'https://www.oytour.com/#/login/2/3'); // 替换为你的重定向 URI
// https://www.oytour.com/#/login/2/3
console.log(openInfo.value,'----------')
// return
const redirectUri = encodeURIComponent(openInfo.value.redirectUri || 'http://localhost:8002/accountCenter/2/3'); // 替换为你的重定向 URI
const state = generateState(); // 防止 CSRF 攻击,生成随机的 state 参数
// 构造 LINE 授权 URL
const lineLoginUrl = `https://access.line.me/oauth2/v2.1/authorize?response_type=code&client_id=${channelId}&redirect_uri=${redirectUri}&state=${state}&scope=openid%20profile`;
......@@ -375,7 +378,6 @@ const initGoogleSDK = async () => {
document.head.appendChild(script);
});
};
onMounted(async () => {
setTimeout(() => {
loading.value = false
......
......@@ -55,7 +55,7 @@ const menuList = ref([
},
{
name: t('personal.menu.accountCenter'),
path: '/accountCenter',
path: '/accountCenter/1',
key: 'accountCenter',
},
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment