Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Hooke
/
lls_program
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
hookehuyr
2025-09-12 13:35:46 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
cfc52bd4ad5caae774470f442dd69da40d43dea6
cfc52bd4
1 parent
1f4839cc
feat: 添加未加入家庭用户的跳转逻辑
在静默授权成功后检查用户是否已加入家庭,未加入则跳转至欢迎页面
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
1 deletions
src/pages/Dashboard/index.vue
src/pages/Dashboard/index.vue
View file @
cfc52bd
...
...
@@ -171,7 +171,7 @@ const defaultFamilyCover = 'https://cdn.ipadbiz.cn/lls_prog/images/default-famil
const defaultAvatar = 'https://cdn.ipadbiz.cn/mlaj/images/icon_1.jpeg'
// 接口信息
import { getFamilyDashboardAPI } from '@/api/family'
import { silentAuth } from '@/utils/authRedirect'
import { silentAuth
, checkUserHasFamily
} from '@/utils/authRedirect'
const todaySteps = ref(0);
const isWeRunAuthorized = ref(false);
...
...
@@ -359,6 +359,18 @@ useLoad(async () => {
console.log('Dashboard onLoad - 静默授权成功:', result);
// 静默授权成功后立即刷新页面数据
await refreshDashboardData();
// 检查用户是否已加入家庭
const hasFamily = await checkUserHasFamily()
// 如果用户没有加入家庭,跳转到欢迎页面
if (!hasFamily) {
console.warn('用户未加入家庭,跳转到欢迎页面');
await Taro.reLaunch({
url: '/pages/Welcome/index'
})
return
}
},
(error) => {
console.error('Dashboard onLoad - 静默授权失败:', error);
...
...
Please
register
or
login
to post a comment