Commit b1bbcab6 authored by youjie's avatar youjie

微信登录

parent f60782be
......@@ -67,20 +67,14 @@ service.interceptors.response.use(
// 处理 401 错误(临时令牌过期)
if (error.response?.status === 401) {
const tempToken = sessionStorage.getItem('tempToken');
console.log('临时令牌过期:', tempToken);
if (tempToken) {
// 清除临时令牌和 OTA 用户信息
sessionStorage.removeItem('tempToken');
sessionStorage.removeItem('otaUserInfo');
useUserStore().signOutAsync();
location.href= '/login';
// 返回更友好的错误信息
// const customError = new Error('授权已过期,请重新从 OTA 平台进入');
// (customError as any).response = error.response;
// (customError as any).config = error.config;
// (customError as any).isAuthExpired = true;
// return Promise.reject(customError);
}
location.href= '/login';
}
// 如果有响应数据,尝试提取错误信息
......
......@@ -36,7 +36,7 @@
/>
</a-avatar>
<template #content>
<a-doption @click="goPage('/personalCenter/myOrder')">
<a-doption @click="goPage('/myOrder')">
<template #icon>
<icon-user />
</template>
......
......@@ -15,7 +15,7 @@ const router = createRouter({
component: () => import ('../views/home/index.vue')
},
{
path: '',
path: '/personalCenter',
meta: { title: "page.profile" },
component: () => import ('../views/personalCenter/index.vue'),
children: [{
......
......@@ -198,7 +198,6 @@ export const useUserStore = defineStore('user', {
async registerDistributorAsync(data: DistributorSelfRegisterDto): Promise<UserLoginResult> {
try {
const response = await UserService.distributorSelfRegisterAsync(data)
console.log('Register response:', response)
this.token = response.token || ''
this.userInfo = response.userInfo || {}
this.memberData = response.memberData
......
......@@ -157,7 +157,7 @@ const loginMsg = reactive({
reType: 0,//登录方式 0账号密码 1谷歌授权 3LINE授权 7FaceBook授权
openId: "",
email: "2310721242@qq.com",//
password: 'yj950815',//123456
password: 'yj123456',//123456
distributorId: systemConfigStore.distributorId as any,
parentId: null,
redirectUri: '',
......
......@@ -439,6 +439,16 @@ watch(()=>currentStep.value,(newVal,oldVal)=>{
}
})
// 初始化
const init = async () => {
// 如果已经登录且是正常用户,直接跳转到首页
if (userStore.getUserToken && userStore.getUser) {
router.replace('/')
}
}
init()
</script>
<style scoped lang="scss">
.light-login-bg {
......@@ -457,7 +467,7 @@ watch(()=>currentStep.value,(newVal,oldVal)=>{
height: 46px;
border-radius: 12px !important;
background-color: #EEEFEB;
border: 2px solid #FFFFFF;
border: 2px solid rgba(225,225,225,0);
}
:deep(.arco-input-focus){
border-radius: 12px;
......@@ -527,9 +537,9 @@ watch(()=>currentStep.value,(newVal,oldVal)=>{
opacity: 0 !important;
}
:deep(.arco-btn-text.arco-btn-disabled){
background-color: #EEEEEB;
background-color: rgba(225,225,225,0);
}
:deep(.arco-btn-text.arco-btn-loading){
background-color: #dddddd;
background-color: rgba(225,225,225,0);
}
</style>
......@@ -64,7 +64,7 @@
size="large"
:placeholder="t('login.setPasswordRequired')"
:maxLength="8"
:defaultVisibility="false"
:defaultVisibility="true"
:invisible-button="false"
>
<!-- <template #prefix>
......@@ -113,7 +113,8 @@
@click.stop="handleAreaCodeChange(option.value)">
<div class="flex items-center space-x-3 px-2 py-1">
<!-- <span class="text-lg">{{ option.flag }}</span> -->
<span class="font-medium">{{ option.label }}({{ option.value }})</span>
<span class="font-medium">{{ option.label }}</span>
<span class="text-[#A3A4A0] font-light">({{ option.value }})</span>
</div>
</a-doption>
</template>
......@@ -377,7 +378,7 @@ const getSimples = async () => {
if(result&&result.length>0){
AreaCodeList.value = result.map((item: any) => ({
label: item.name,
value: item.phoneCode
value: `+${item.phoneCode}`
}))
}
}
......@@ -672,6 +673,16 @@ watch(()=>currentStep.value,(newVal,oldVal)=>{
}
})
// 初始化
const init = async () => {
// 如果已经登录且是正常用户,直接跳转到首页
if (userStore.getUserToken && userStore.getUser) {
router.replace('/')
}
}
init()
getSimples()
</script>
......@@ -694,7 +705,7 @@ getSimples()
height: 46px;
border-radius: 12px !important;
background-color: #EEEFEB;
border: 2px solid #FFFFFF;
border: 2px solid rgba(225,225,225,0);
}
:deep(.arco-input-focus){
border-radius: 12px;
......@@ -766,9 +777,9 @@ getSimples()
opacity: 0 !important;
}
:deep(.arco-btn-text.arco-btn-disabled){
background-color: #EEEEEB;
background-color: rgba(225,225,225,0);
}
:deep(.arco-btn-text.arco-btn-loading){
background-color: #dddddd;
background-color: rgba(225,225,225,0);
}
</style>
......@@ -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">
<span v-if="userInfo.externalLoginList?.length==0" 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]">
{{ t('personal.completeProfile') }}
>>
......
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