mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2026-01-12 17:08:14 +00:00
Merge branch 'fix-api-field' into 'release/1.0.0'
Fix api field See merge request !1050673
This commit is contained in:
commit
753bb7f277
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@ali/lowcode-datasource-mtop-handler",
|
||||
"version": "1.0.21",
|
||||
"version": "1.0.22-alpha.1",
|
||||
"main": "lib/index.js",
|
||||
"module": "es/index.js",
|
||||
"typings": "es/index.d.ts",
|
||||
@ -16,7 +16,7 @@
|
||||
"prepublishOnly": "npm run build"
|
||||
},
|
||||
"dependencies": {
|
||||
"@ali/lowcode-datasource-types": "^1.0.21",
|
||||
"@ali/lowcode-datasource-types": "^1.0.22-alpha.2",
|
||||
"@ali/universal-mtop": "^5.1.9",
|
||||
"typescript": "^3.9.7"
|
||||
},
|
||||
|
||||
@ -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',
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@ali/lowcode-datasource-types",
|
||||
"version": "1.0.21",
|
||||
"version": "1.0.22-alpha.2",
|
||||
"main": "lib/index.js",
|
||||
"module": "es/index.js",
|
||||
"typings": "es/index.d.ts",
|
||||
|
||||
@ -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