Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
ujia
/
uj-admin
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 9c4fe581
authored
Nov 18, 2026
by
chenwq
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
优化活码详情获取逻辑,确保编辑时展示最新的群池和门店配置
1 parent
894b821b
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
7 deletions
apps/web/subapps/usedcar/src/api/modules/liveCode.ts
apps/web/subapps/usedcar/src/pages/CustomerGroup/GroupCodeEditor.tsx
apps/web/subapps/usedcar/src/api/modules/liveCode.ts
View file @
9c4fe58
...
...
@@ -7,6 +7,7 @@
import
{
usedcarClient
}
from
'../core/client'
;
import
type
{
UsedcarParams
}
from
'../core/types'
;
/**
* 一客一码分页列表
*/
...
...
@@ -52,9 +53,13 @@ export function deleteLiveCode<T = unknown>(data: UsedcarParams = {}) {
/**
* 一客一群 - 活码配置详情
*/
export
function
getLiveCodeDetail
<
T
=
unknown
>
(
data
:
UsedcarParams
=
{})
{
return
usedcarClient
.
post
<
T
>
(
'/liveCode/details'
,
data
);
}
export
const
getLiveCodeDetail
=
Object
.
assign
(
<
T
=
unknown
>
(
data
:
UsedcarParams
=
{})
=>
usedcarClient
.
post
<
T
>
(
'/liveCode/details'
,
data
),
{
// 编辑群池时需读取最新详情,不使用子应用默认的30秒查询缓存。
queryOptions
:
{
staleTime
:
0
,
refetchOnMount
:
'always'
as
const
},
},
);
/** 模块单例出口,与 dashboardApi 同一调用面;实现与上方具名函数完全同源。 */
export
const
liveCodeApi
=
{
...
...
apps/web/subapps/usedcar/src/pages/CustomerGroup/GroupCodeEditor.tsx
View file @
9c4fe58
...
...
@@ -2,7 +2,7 @@ import { useEffect, useMemo, useState } from 'react';
import { useQuery } from '@tanstack/react-query';
import { UAlert, UButton, UCard, UForm, UInput, UModal, UResult, useUMessage } from '@uj/ui';
import { CombiForm, DataTable, PageShell, type FieldSchema } from '@/components';
import { liveCodeApi } from '@/api';
import {
getLiveCodeDetail,
liveCodeApi } from '@/api';
import { useAccess } from '@/access';
import { UC } from '@/permissions/codes';
import { errorDetail } from '@/utils/error';
...
...
@@ -133,9 +133,7 @@ export default function GroupCodeEditor({ params }: Props) {
const detail = useQuery({
queryKey: ['live-code-detail', params?.id],
enabled: editing && Boolean(params?.id),
// 活码编辑必须展示服务端最新的群池和门店配置;不沿用子应用默认的 30 秒缓存。
staleTime: 0,
refetchOnMount: 'always',
...getLiveCodeDetail.queryOptions,
queryFn: () => liveCodeApi.getLiveCodeDetail<Detail>({ id: params?.id }),
});
useEffect(() => {
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment