mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2026-03-01 22:10:27 +00:00
fix: 代码结构调整
This commit is contained in:
parent
64a477cf35
commit
af4bc83cc3
@ -16,7 +16,7 @@ export function createMopenHandler<T = unknown>(
|
||||
appKey: MOPEN_APPKEY_XSPACE_PRE_ONLINE,
|
||||
},
|
||||
) {
|
||||
return async function (options: RuntimeOptionsConfig): Promise<{ data: T }> {
|
||||
return async function(options: RuntimeOptionsConfig): Promise<{ data: T }> {
|
||||
const { data, response } = await MopenClient.request<T>({
|
||||
config,
|
||||
...options,
|
||||
|
||||
@ -9,9 +9,11 @@ export type DataType = 'jsonp' | 'json' | 'originaljsonp';
|
||||
// 考虑一下 mtop 类型的问题,官方没有提供 ts 文件
|
||||
export function createMtopHandler<T = unknown>(config?: MTopConfig) {
|
||||
if (config && Object.keys(config).length > 0) {
|
||||
Object.keys(config).forEach((key: string) => mtopRequest.config(key, config[key]));
|
||||
Object.keys(config).forEach((key: string) =>
|
||||
mtopRequest.config(key, config[key]),
|
||||
);
|
||||
}
|
||||
return async function (options: RuntimeOptionsConfig): Promise<{ data: T }> {
|
||||
return async function(options: RuntimeOptionsConfig): Promise<{ data: T }> {
|
||||
const response = await mtopRequest.request<T>({
|
||||
api: options.uri,
|
||||
v: (options.v as string) || '1.0',
|
||||
|
||||
@ -16,7 +16,7 @@
|
||||
"prepublishOnly": "npm run build"
|
||||
},
|
||||
"dependencies": {
|
||||
"@ali/lowcode-types": "^1.0.10",
|
||||
"@ali/lowcode-types": "^0.8.13",
|
||||
"query-string": "^6.13.1",
|
||||
"typescript": "^3.9.7"
|
||||
},
|
||||
|
||||
@ -1,10 +1,8 @@
|
||||
import qs from 'query-string';
|
||||
import { UrlParamsHandler } from '@ali/lowcode-types';
|
||||
|
||||
export function createUrlParamsHandler<T = unknown>(
|
||||
searchString: string | T = '',
|
||||
): UrlParamsHandler<T> {
|
||||
return async function (): Promise<T> {
|
||||
export function createUrlParamsHandler<T = unknown>(searchString: string | T = ''): UrlParamsHandler<T> {
|
||||
return async function(): Promise<T> {
|
||||
if (typeof searchString === 'string') {
|
||||
const params = (qs.parse(searchString) as unknown) as T;
|
||||
return params;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user