mirror of
https://gitee.com/qqtt-ah/ecom-dmb.git
synced 2026-11-24 07:49:19 +08:00
refactor: 修改结构 功能动态从后端获取
This commit is contained in:
@@ -3,9 +3,12 @@ export const EXTENSION_NAME = 'ECBI 数据同步';
|
||||
export const OPEN_API_PATHS = {
|
||||
pddShopList: '/open/v1/channel/pdd/shop/list',
|
||||
pddGoodsAdFeeBatchImport: '/open/v1/channel/pdd/goods/adfee/batch-import',
|
||||
extensionFeatureList: '/open/v1/extension/features',
|
||||
extensionFeatureScript: '/open/v1/extension/features',
|
||||
} as const;
|
||||
|
||||
export const OPEN_SCOPES = {
|
||||
pddShopRead: 'open:scope:pdd_shop:read',
|
||||
pddGoodsAdFeeImport: 'open:scope:pdd_goods_ad_fee:import',
|
||||
extensionFeatureRead: 'open:scope:extension_feature:read',
|
||||
} as const;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import type { AdvertisingCostBatch, PageContext } from '@/types/advertisingCost';
|
||||
import type { ExtensionFeatureManifest } from '@/features/runtime/types';
|
||||
|
||||
export type ExtensionMessage =
|
||||
| { type: 'GET_PAGE_CONTEXT' }
|
||||
@@ -6,6 +7,9 @@ export type ExtensionMessage =
|
||||
| { type: 'TOGGLE_FLOATING_PANEL' }
|
||||
| { type: 'SET_FLOATING_PANEL'; payload: { visible: boolean } }
|
||||
| { type: 'GET_FLOATING_PANEL_STATE' }
|
||||
| { type: 'MOUNT_FEATURE'; payload: { featureId: string } }
|
||||
| { type: 'UNMOUNT_FEATURE' }
|
||||
| { type: 'GET_ACTIVE_FEATURE' }
|
||||
| { type: 'PING' };
|
||||
|
||||
export type ExtensionResponse =
|
||||
@@ -13,6 +17,8 @@ export type ExtensionResponse =
|
||||
| { ok: true; data: AdvertisingCostBatch }
|
||||
| { ok: true; data: { pong: true } }
|
||||
| { ok: true; data: { visible: boolean } }
|
||||
| { ok: true; data: { featureId: string | null } }
|
||||
| { ok: true; data: ExtensionFeatureManifest }
|
||||
| { ok: false; code: string; message: string };
|
||||
|
||||
const MESSAGE_TYPES = new Set([
|
||||
@@ -21,6 +27,9 @@ const MESSAGE_TYPES = new Set([
|
||||
'TOGGLE_FLOATING_PANEL',
|
||||
'SET_FLOATING_PANEL',
|
||||
'GET_FLOATING_PANEL_STATE',
|
||||
'MOUNT_FEATURE',
|
||||
'UNMOUNT_FEATURE',
|
||||
'GET_ACTIVE_FEATURE',
|
||||
'PING',
|
||||
]);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user