Commit 6332dc3f authored by youjie's avatar youjie

获取appid

parent e2d29bea
......@@ -78,16 +78,16 @@ body {
--arcoblue-2: 235, 235, 233;//#EBEBE9
--arcoblue-1: 72, 96, 91;//#48605B
--primary-10:var(--arcoblue-10);//#F5F6F0
--primary-9: var(--arcoblue-9);//#FF9707
--primary-8: var(--arcoblue-8);//#263628
--primary-6: var(--arcoblue-6);//#4A664D
--primary-5: var(--arcoblue-5);//#95A997
--primary-7: var(--arcoblue-7);//#e3e6da
--primary-4: var(--arcoblue-4);//#C0CEB3
--primary-3: var(--arcoblue-3);//#8AA88A
--primary-2: var(--arcoblue-2);//#EBEBE9
--primary-1: var(--arcoblue-1);//#48605B
// --primary-10:var(--arcoblue-10);//#F5F6F0
// --primary-9: var(--arcoblue-9);//#FF9707
// --primary-8: var(--arcoblue-8);//#263628
// --primary-6: var(--arcoblue-6);//#4A664D
// --primary-5: var(--arcoblue-5);//#95A997
// --primary-7: var(--arcoblue-7);//#e3e6da
// --primary-4: var(--arcoblue-4);//#C0CEB3
// --primary-3: var(--arcoblue-3);//#8AA88A
// --primary-2: var(--arcoblue-2);//#EBEBE9
// --primary-1: var(--arcoblue-1);//#48605B
--gray-10: 12, 21, 13;//#0c150d 主字体色
--gray-9: 90, 90, 90;//#5a5a5a
......@@ -96,56 +96,64 @@ body {
--gray-6: 163, 164, 160;//#A3A4A0
--gray-5: 74, 102, 77;//#4A664D
--color-neutral-10: rgb(var(--gray-10));//#0c150d
--color-neutral-9: rgb(var(--gray-9));//#5a5a5a
--color-neutral-8: rgb(var(--gray-8));//#133537
--color-neutral-7: rgb(var(--gray-7));//#606961
--color-neutral-6: rgb(var(--gray-6));//#A3A4A0
--color-neutral-5: rgb(var(--gray-5));//#4A664D
// --color-neutral-10: rgb(var(--gray-10));//#0c150d
// --color-neutral-9: rgb(var(--gray-9));//#5a5a5a
// --color-neutral-8: rgb(var(--gray-8));//#133537
// --color-neutral-7: rgb(var(--gray-7));//#606961
// --color-neutral-6: rgb(var(--gray-6));//#A3A4A0
// --color-neutral-5: rgb(var(--gray-5));//#4A664D
}
:root {
--primary1-10: #F5F6F0;
--primary1-9: #ff9707;
--primary1-8: #263628;
--primary1-6: #4A664D;
--primary1-5: #95A997;
--primary1-7: #e3e6da;
--primary1-4: #C0CEB3;
--primary1-3: #8aa88a;
--primary1-2: #EBEBE9;
--primary1-1: #48605B;
--customPrimary-10: #F5F6F0;
--customPrimary-9: #ff9707;
--customPrimary-8: #263628;
--customPrimary-6: #4A664D;
--customPrimary-5: #95A997;
--customPrimary-7: #e3e6da;
--customPrimary-4: #C0CEB3;
--customPrimary-3: #8aa88a;
--customPrimary-2: #EBEBE9;
--customPrimary-1: #48605B;
/* 文本色调整为深灰 */
--color1-text-10: #0c150d;
--color1-text-9: #5a5a5a;
--color1-text-8: #133537;
--color1-text-7: #606961;
--customColor-text-10: #0c150d;
--customColor-text-9: #5a5a5a;
--customColor-text-8: #133537;
--customColor-text-7: #606961;
--customColor-text-6: #A3A4A0;
--customColor-text-5: #4A664D;
}
.primary1-9{color: var(--primary1-9);}
.primary1-8{color: var(--primary1-8);}
.primary1-6{color: var(--primary1-6);}
.primary1-5{color: var(--primary1-5);}
.primary1-7{color: var(--primary1-7);}
.primary1-4{color: var(--primary1-4);}
.primary1-3{color: var(--primary1-3);}
.primary1-2{color: var(--primary1-2);}
.primary1-1{color: var(--primary1-1);}
.primary1-bg-9{background-color: var(--primary1-9);}
.primary1-bg-8{background-color: var(--primary1-8);}
.primary1-bg-6{background-color: var(--primary1-6);}
.primary1-bg-5{background-color: var(--primary1-5);}
.primary1-bg-7{background-color: var(--primary1-7);}
.primary1-bg-4{background-color: var(--primary1-4);}
.primary1-bg-3{background-color: var(--primary1-3);}
.primary1-bg-2{background-color: var(--primary1-2);}
.primary1-bg-1{background-color: var(--primary1-1);}
.color1-text-1{color: var(--color1-text-1);}
.color1-text-2{color: var(--color1-text-2);}
.color1-text-3{color: var(--color1-text-3);}
.customPrimary-10{color: var(--customPrimary-10);}
.customPrimary-9{color: var(--customPrimary-9);}
.customPrimary-8{color: var(--customPrimary-8);}
.customPrimary-6{color: var(--customPrimary-6);}
.customPrimary-5{color: var(--customPrimary-5);}
.customPrimary-7{color: var(--customPrimary-7);}
.customPrimary-4{color: var(--customPrimary-4);}
.customPrimary-3{color: var(--customPrimary-3);}
.customPrimary-2{color: var(--customPrimary-2);}
.customPrimary-1{color: var(--customPrimary-1);}
.customPrimary-bg-10{background-color: var(--customPrimary-10);}
.customPrimary-bg-9{background-color: var(--customPrimary-9);}
.customPrimary-bg-8{background-color: var(--customPrimary-8);}
.customPrimary-bg-6{background-color: var(--customPrimary-6);}
.customPrimary-bg-5{background-color: var(--customPrimary-5);}
.customPrimary-bg-7{background-color: var(--customPrimary-7);}
.customPrimary-bg-4{background-color: var(--customPrimary-4);}
.customPrimary-bg-3{background-color: var(--customPrimary-3);}
.customPrimary-bg-2{background-color: var(--customPrimary-2);}
.customPrimary-bg-1{background-color: var(--customPrimary-1);}
.customColor-text-10{color: var(--customColor-text-10);}
.customColor-text-9{color: var(--customColor-text-9);}
.customColor-text-8{color: var(--customColor-text-8);}
.customColor-text-7{color: var(--customColor-text-7);}
.customColor-text-6{color: var(--customColor-text-6);}
.customColor-text-5{color: var(--customColor-text-5);}
@font-face{
font-family:'Source Han Sans CN ExtraLight';
......
<template>
<header class="app-header shadow-sm primary1-bg-7
<header class="app-header shadow-sm customPrimary-bg-7
flex justify-center items-center">
<div class="w-[1200px] h-[60px] flex items-center justify-between SourceHanSansCN">
<div class="flex">
......@@ -29,12 +29,15 @@
{{ t('login.loginButton') }}/{{ t('login.register') }}
</a-button>
<a-dropdown v-else position="br" trigger="click">
<a-avatar class="cursor-pointer flex-shrink-0 !w-[35px] !h-[35px]">
<img class="w-full h-full cursor-pointer"
alt="avatar"
:src="userStore.memberData.photo || systemConfigStore.config?.logo || 'https://p1-arco.byteimg.com/tos-cn-i-uwbnlip3yd/3ee5f13fb09879ecb5185e440cef6eb9.png~tplv-uwbnlip3yd-webp.webp'"
/>
</a-avatar>
<div class="flex items-center cursor-pointer">
<a-avatar class="flex-shrink-0 !w-[35px] !h-[35px]">
<img class="w-full h-full cursor-pointer"
alt="avatar"
:src="userStore.memberData.photo || systemConfigStore.config?.logo || 'https://p1-arco.byteimg.com/tos-cn-i-uwbnlip3yd/3ee5f13fb09879ecb5185e440cef6eb9.png~tplv-uwbnlip3yd-webp.webp'"
/>
</a-avatar>
<span class="ml-[9px] text-sm">{{ t('personal.profile') }}</span>
</div>
<template #content>
<a-doption @click="goPage('/myOrder')">
<template #icon>
......
......@@ -352,13 +352,13 @@ class UserService {
* @param tenantId 租户ID
* @returns
*/
static async wechatAppIdRedirectUriAsync(tenantId: string): Promise<HttpResponse> {
static async wechatThirdConfigAsync(tenantId: string,providerType: number,token: string): Promise<HttpResponse> {
const data = {
tenantId
providerType
}
// OtaRequest 的响应拦截器会返回 response.data
const response = await OtaRequest.post(
'/member-auth/we-chat-login-by-code',
'/member-auth/third-config',
data,
{
headers: {
......
......@@ -161,10 +161,9 @@ export const useUserStore = defineStore('user', {
* 获取微信appid
* @param tenantId 租户ID
*/
async getUserWechatAppIdRedirectUriAsync(tenantId: string): Promise<UserLoginResult> {
async getUserWechatAppIdAsync(tenantId: string,providerType: number): Promise<UserLoginResult> {
try {
const response = await UserService.wechatAppIdRedirectUriAsync(tenantId)
console.log('微信appid-----', response)
const response = await UserService.wechatThirdConfigAsync(tenantId,providerType,this.token)
return {
status: 'SUCCESS',
verify: false,
......
......@@ -73,7 +73,7 @@
<div class="mt-[40px] flex items-center justify-center">
<a-divider orientation="center" class="text-[16px] text-[#EEEFEB]"></a-divider>
<span class="text-nowrap primary1-5 px-[14px]">{{ t('login.othenLogin') }}</span>
<span class="text-nowrap customPrimary-5 px-[14px]">{{ t('login.othenLogin') }}</span>
<a-divider orientation="center" class="text-[16px] text-[#EEEFEB]"></a-divider>
</div>
<div class="flex items-center justify-between px-[100px] mt-[20px] mb-[40px]">
......@@ -208,30 +208,25 @@ const rules = computed(() => ({
],
}))
const openInfo = ref({
AppID: 'wx82752cffa22d20e1',
State: '1',
OpenRedirectUri: 'https://www.oytour.com/#/',
openId: '',
})
const openInfo = ref({} as any)
// 获取微信登录AppID 域名 重定向页面
const getAppIdRedirectUri = async () => {
const { AppID, State, OpenRedirectUri } = openInfo.value;
let redirect_uri = OpenRedirectUri;
const url = `https://open.weixin.qq.com/connect/qrconnect?appid=${AppID}&redirect_uri=${encodeURIComponent('https://www.oytour.com/#/login')}&response_type=code&scope=snsapi_login&state=${State}&wechat_redirect=${redirect_uri}`;
window.location.href = url;
return
// const { AppID, State, OpenRedirectUri } = openInfo.value;
// let redirect_uri = OpenRedirectUri;
// const url = `https://open.weixin.qq.com/connect/qrconnect?appid=${AppID}&redirect_uri=${encodeURIComponent('https://www.oytour.com/#/login')}&response_type=code&scope=snsapi_login&state=${State}&wechat_redirect=${redirect_uri}`;
// window.location.href = url;
// return
loading.value = true
try {
// 获取微信登录AppID 域名
const response = await userStore.getUserWechatAppIdRedirectUriAsync(loginMsg.tenantId?.toString() || '')
const response = await userStore.getUserWechatAppIdAsync(loginMsg.tenantId?.toString() || '',loginMsg.reType || 2)
console.log('微信appid-----', response)
if (response.status == 'SUCCESS') {
openInfo.value = response.data[0]
const { AppID, State, OpenRedirectUri } = openInfo.value;
let redirect_uri = OpenRedirectUri;
const url = `https://open.weixin.qq.com/connect/qrconnect?appid=${AppID}&redirect_uri=${encodeURIComponent('http://localhost:8002/login')}&response_type=code&scope=snsapi_login&state=${State}&wechat_redirect=${redirect_uri}`;
const { appId, redirectUri } = openInfo.value;
const url = `https://open.weixin.qq.com/connect/qrconnect?appid=${appId}&redirect_uri=${encodeURIComponent('https://www.oytour.com/#/login')}&response_type=code&scope=snsapi_login&wechat_redirect=${redirectUri}`;
window.location.href = url;
}
}catch (error: any) {
......@@ -267,13 +262,12 @@ const handleClick = (path: string) => {
const toggleLoginType = (type: number) => {
if(type==3||type==7) return Message.error(t('login.loginTypeNotSupport'))
if(type==2) {
getAppIdRedirectUri()
}
loginMsg.reType = type
if(type==2) { getAppIdRedirectUri() }
// if(type==1) {
// loginWithGoogle()
// }
loginMsg.reType = type
}
const loginHandler = async ({ values, errors }: any) => {
......
......@@ -3,14 +3,14 @@
<div class="flex justify-center">
<div class="w-[1073px] h-[638px] rounded-[18px] loginForm-bg flex flex-col justify-center items-center">
<icon-check-circle-fill size="68" class="!text-[#34CA51]"></icon-check-circle-fill>
<div class="flex justify-center items-center text-[32px] font-bold primary1-6 pt-[45px] pb-[31px]">
<div class="flex justify-center items-center text-[32px] font-bold customPrimary-6 pt-[45px] pb-[31px]">
<span class="" v-if="userInfo?.email">
<!-- ranjunjun@aliyun.com -->
{{ userInfo.email }}
</span>
<span class="ml-[18px]">{{ t('login.registerSuccess') }}</span>
</div>
<div class="text-[20px] primary1-6 text-center font-normal SourceHanSansCN">
<div class="text-[20px] customPrimary-6 text-center font-normal SourceHanSansCN">
{{ t('login.registerSuccessText') }}
</div>
<div class="mt-[74px]">
......
......@@ -41,7 +41,7 @@
<icon-close-circle-fill v-else-if="codeValidateStatus === 'error'" class="text-red-500" /> -->
<a-button @click="handleSendCode" :disabled="sendCodeCountdown > 0"
:loading="sendingCode" size="large" type="text" class="w-full !px-[0]">
<span class="primary1-6 font-medium">
<span class="customPrimary-6 font-medium">
{{ sendCodeCountdown > 0 ? `${sendCodeCountdown}s ${t('login.resend')}` :
t('login.getVerifyCode') }}</span>
</a-button>
......
......@@ -50,7 +50,7 @@
<icon-close-circle-fill v-else-if="codeValidateStatus === 'error'" class="text-red-500" />
<a-button @click="handleSendCode" :disabled="!canSendCode || sendCodeCountdown > 0"
:loading="sendingCode" size="large" type="text" class="w-full !px-[0]">
<span class="primary1-6 font-medium">
<span class="customPrimary-6 font-medium">
{{ sendCodeCountdown > 0 ? `${sendCodeCountdown}s ${t('login.resend')}` :
t('login.getVerifyCode') }}</span>
</a-button>
......
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