mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2026-01-12 17:08:14 +00:00
fix: 兼容服务大厅已有的的 api 字段
This commit is contained in:
parent
7757ef7af7
commit
8f5d0ce6ee
@ -16,7 +16,7 @@ export function createMtopHandler<T = unknown>(config?: MTopConfig) {
|
||||
// eslint-disable-next-line space-before-function-paren
|
||||
return async function(options: RuntimeOptionsConfig): Promise<{ data: T }> {
|
||||
const response = await mtopRequest.request<T>({
|
||||
api: options.uri,
|
||||
api: options.uri || options.api, // 兼容老的结构
|
||||
v: (options.v as string) || '1.0',
|
||||
data: options.params,
|
||||
type: (options.method as Method) || 'get',
|
||||
|
||||
@ -30,6 +30,7 @@ export interface InterpretDataSourceConfig {
|
||||
shouldFetch?: JSFunction;
|
||||
options?: {
|
||||
uri: string | JSExpression;
|
||||
api?: string | JSExpression; // 兼容
|
||||
params?: JSONObject | JSExpression;
|
||||
method?: string | JSExpression;
|
||||
isCors?: boolean | JSExpression;
|
||||
|
||||
@ -38,6 +38,7 @@ export type RuntimeOptions = () => RuntimeOptionsConfig;
|
||||
|
||||
export interface RuntimeOptionsConfig {
|
||||
uri: string;
|
||||
api?: string;
|
||||
params?: Record<string, unknown>;
|
||||
method?: string;
|
||||
isCors?: boolean;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user