Commit 1e131472 authored by youjie's avatar youjie

绑定line

parent 357589c3
...@@ -39,7 +39,7 @@ const router = createRouter({ ...@@ -39,7 +39,7 @@ const router = createRouter({
component: () => import ('../views/personalCenter/myCoupon.vue') component: () => import ('../views/personalCenter/myCoupon.vue')
}, },
{ {
path: '/accountCenter/:type?',//账号中心 path: '/accountCenter/:type/:reType?',//账号中心
meta: { title: "page.accountCenter" }, meta: { title: "page.accountCenter" },
component: () => import ('../views/personalCenter/accountCenter.vue') component: () => import ('../views/personalCenter/accountCenter.vue')
}, },
......
...@@ -234,7 +234,7 @@ const goPage = (path:string) => { ...@@ -234,7 +234,7 @@ const goPage = (path:string) => {
router.push(path) router.push(path)
return return
} }
router.push('/accountCenter') router.push('/accountCenter/1')
} }
// 验证邮箱是否可用 // 验证邮箱是否可用
...@@ -371,7 +371,7 @@ const handleSubmit = async () => { ...@@ -371,7 +371,7 @@ const handleSubmit = async () => {
// 延迟跳转到登录页 // 延迟跳转到登录页
setTimeout(() => { setTimeout(() => {
if(params&&params.email){ if(params&&params.email){
router.push('/accountCenter') router.push('/accountCenter/1')
}else{ }else{
router.push('/login') router.push('/login')
} }
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
</div> </div>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { ref, onMounted } from 'vue' import { ref, onMounted, watch } from 'vue'
import { useI18n } from 'vue-i18n' import { useI18n } from 'vue-i18n'
import { useRouter } from 'vue-router' import { useRouter } from 'vue-router'
import account from "./components/accountCenter/account.vue" import account from "./components/accountCenter/account.vue"
...@@ -62,6 +62,12 @@ const TitleBars = [ ...@@ -62,6 +62,12 @@ const TitleBars = [
value: 4 value: 4
} }
] ]
console.log(router ,'newVal-----')
watch(() => router, (newVal, oldVal) => {
if(newVal){
console.log(newVal,'newVal-----')
}
})
const changeStatus = (value: number) => { const changeStatus = (value: number) => {
current.value = value current.value = value
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
</div> </div>
<div class="mt-[13px] text-lg font-medium text-center truncate">{{ userInfo?.name || '' }}</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" <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 v-if="!userInfo?.IsComplete" class="LeftViewTisp w-[6px] h-[6px] rounded-full"></span>
<span class="LeftViewData ml-[5px] text-sm font-medium text-[#666]"> <span class="LeftViewData ml-[5px] text-sm font-medium text-[#666]">
{{ t('personal.completeProfile') }} {{ t('personal.completeProfile') }}
......
...@@ -245,7 +245,10 @@ const generateState = () => { ...@@ -245,7 +245,10 @@ const generateState = () => {
// line授权 // line授权
const loginWithLine = () => { const loginWithLine = () => {
const channelId = openInfo.value.appId; // 替换为你的 LINE Channel ID 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 参数 const state = generateState(); // 防止 CSRF 攻击,生成随机的 state 参数
// 构造 LINE 授权 URL // 构造 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`; 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 () => { ...@@ -375,7 +378,6 @@ const initGoogleSDK = async () => {
document.head.appendChild(script); document.head.appendChild(script);
}); });
}; };
onMounted(async () => { onMounted(async () => {
setTimeout(() => { setTimeout(() => {
loading.value = false loading.value = false
......
...@@ -55,7 +55,7 @@ const menuList = ref([ ...@@ -55,7 +55,7 @@ const menuList = ref([
}, },
{ {
name: t('personal.menu.accountCenter'), name: t('personal.menu.accountCenter'),
path: '/accountCenter', path: '/accountCenter/1',
key: 'accountCenter', 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