mirror of
https://gitee.com/qqtt-ah/ecom-dmb.git
synced 2026-11-24 05:49:20 +08:00
feat(浏览器扩展): 改用新店铺名称精确匹配店铺接口
This commit is contained in:
@@ -1,24 +1,16 @@
|
||||
import type { PddChannelShop } from '@/api/open/pddShop';
|
||||
import { listPddChannelShops } from '@/api/open/pddShop';
|
||||
import { matchPddChannelShopByMallName } from '@/api/open/pddShop';
|
||||
|
||||
/**
|
||||
* 用页面店铺名匹配 BI channelShop:仅接受 mallName 完全一致。
|
||||
* 接口 filters 可能是模糊搜,结果里再做精确过滤。
|
||||
* 用页面店铺名匹配 BI channelShop:后端按 mallName trim 后精确匹配。
|
||||
*/
|
||||
export async function matchChannelShopByMallName(
|
||||
mallName: string,
|
||||
): Promise<PddChannelShop | null> {
|
||||
const name = mallName.trim();
|
||||
if (!name) return null;
|
||||
|
||||
const result = await listPddChannelShops({
|
||||
page: 1,
|
||||
pageSize: 50,
|
||||
filters: { mallName: name },
|
||||
});
|
||||
const records = result.records ?? [];
|
||||
const exact = records.find((shop) => (shop.mallName ?? '').trim() === name);
|
||||
return exact ?? null;
|
||||
const shop = await matchPddChannelShopByMallName(name);
|
||||
return shop ?? null;
|
||||
}
|
||||
|
||||
export function shopAuthorizeHint(mallName: string): string {
|
||||
|
||||
Reference in New Issue
Block a user