diff --git a/src/router/modules/remaining.ts b/src/router/modules/remaining.ts index 39d2bb42..3c5bf235 100644 --- a/src/router/modules/remaining.ts +++ b/src/router/modules/remaining.ts @@ -434,7 +434,7 @@ const remainingRouter: AppRouteRecordRaw[] = [ meta: { hidden: true }, children: [ { - path: 'user/detail', + path: 'user/detail/:member_id', name: 'MemberUserDetail', meta: { title: '会员详情', diff --git a/src/views/member/user/detail/index.vue b/src/views/member/user/detail/index.vue index c77934d1..38c8712c 100644 --- a/src/views/member/user/detail/index.vue +++ b/src/views/member/user/detail/index.vue @@ -200,9 +200,7 @@ const openForm = (type: string, id?: number) => { /** 初始化 */ const route = useRoute() const router = useRouter() -// TODO @梦:改成 id 路径参数,而不是 query -// TODO @梦:会员列表,把【详情】按钮加上哈 -const member_id = route.query.member_id as number +const member_id = route.params.member_id as number onMounted(() => { if (!member_id) { // TODO diff --git a/src/views/member/user/index.vue b/src/views/member/user/index.vue index 777fa8d5..0cadf5d1 100644 --- a/src/views/member/user/index.vue +++ b/src/views/member/user/index.vue @@ -183,7 +183,7 @@ const resetQuery = () => { const { push } = useRouter() const goMemberDetail = (id: number) => { - push({ path: 'user/detail', query: { member_id: id } }) + push({ name: 'MemberUserDetail', params: { member_id: id } }) } /** 初始化 **/