@wx-sab/renkei 1.1.0 → 1.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/core/generate.js
CHANGED
|
@@ -68,7 +68,7 @@ const generate = (conf) => {
|
|
|
68
68
|
onCreateRouteName(routeNameInfo, rawRouteInfo) {
|
|
69
69
|
var _a, _b, _c;
|
|
70
70
|
// 自定义请求路由
|
|
71
|
-
const newRoute = (_a = config.customRequestUrl) === null || _a === void 0 ? void 0 : _a.call(config, rawRouteInfo);
|
|
71
|
+
const newRoute = (_a = config.customRequestUrl) === null || _a === void 0 ? void 0 : _a.call(config, rawRouteInfo, config);
|
|
72
72
|
if (typeof newRoute === "string") {
|
|
73
73
|
rawRouteInfo.route = newRoute;
|
|
74
74
|
}
|
package/lib/core/interface.d.ts
CHANGED
|
@@ -25,6 +25,12 @@ export type BasicConfig = {
|
|
|
25
25
|
* 数据模型的命名空间
|
|
26
26
|
*/
|
|
27
27
|
modelNamespace?: string;
|
|
28
|
+
/**
|
|
29
|
+
* 模型的导出类型,默认是 export
|
|
30
|
+
* export - 需要import进来才能用
|
|
31
|
+
* decalre - 全局声明,无需引用
|
|
32
|
+
*/
|
|
33
|
+
modelExportType?: "export" | "declare";
|
|
28
34
|
/**
|
|
29
35
|
* 接口服务名
|
|
30
36
|
*/
|
|
@@ -46,7 +52,7 @@ export type BasicConfig = {
|
|
|
46
52
|
* 自定义组装请求的url
|
|
47
53
|
* 自定义组装 mock 的url
|
|
48
54
|
*/
|
|
49
|
-
customRequestUrl?(routeData: RawRouteInfo): string | {
|
|
55
|
+
customRequestUrl?(routeData: RawRouteInfo, config: Partial<GenerateConfig>): string | {
|
|
50
56
|
/**
|
|
51
57
|
* 接口请求路径
|
|
52
58
|
*/
|
package/package.json
CHANGED