mp-weixin-back 0.0.8 → 0.0.10
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/dist/index.cjs +247 -57
- package/dist/index.mjs +247 -57
- package/package.json +2 -2
- package/src/context.ts +6 -5
- package/test/data/index-default.vue +17 -0
- package/test/data/{index.vue → index-setup.vue} +1 -0
- package/test/generate.spec.ts +20 -3
- package/utils/index.ts +15 -156
- package/utils/walker.ts +389 -0
package/dist/index.cjs
CHANGED
|
@@ -4,10 +4,10 @@ const path = require('path');
|
|
|
4
4
|
const fs = require('fs');
|
|
5
5
|
const JSON5 = require('json5');
|
|
6
6
|
const kolorist = require('kolorist');
|
|
7
|
-
const generate = require('@babel/generator');
|
|
8
7
|
const compilerSfc = require('@vue/compiler-sfc');
|
|
9
|
-
const
|
|
8
|
+
const generate = require('@babel/generator');
|
|
10
9
|
const MagicString = require('magic-string');
|
|
10
|
+
const astKit = require('ast-kit');
|
|
11
11
|
|
|
12
12
|
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e.default : e; }
|
|
13
13
|
|
|
@@ -19,52 +19,42 @@ const MagicString__default = /*#__PURE__*/_interopDefaultCompat(MagicString);
|
|
|
19
19
|
|
|
20
20
|
const virtualFileId = "mp-weixin-back-helper";
|
|
21
21
|
|
|
22
|
+
const pageContainerComp = ' <page-container :show="__MP_BACK_SHOW_PAGE_CONTAINER__" :overlay="false" @beforeleave="onBeforeLeave" :z-index="1" :duration="false"></page-container>\n';
|
|
22
23
|
function isArrowFunction(func) {
|
|
23
24
|
if (typeof func !== "function")
|
|
24
25
|
return false;
|
|
25
26
|
return !func.hasOwnProperty("prototype") && func.toString().includes("=>");
|
|
26
27
|
}
|
|
27
|
-
|
|
28
|
-
try {
|
|
29
|
-
return compilerSfc.parse(code).descriptor;
|
|
30
|
-
} catch (error) {
|
|
31
|
-
throw new Error(`\u89E3\u6790vue\u6587\u4EF6\u5931\u8D25\uFF0C\u8BF7\u68C0\u67E5\u6587\u4EF6\u662F\u5426\u6B63\u786E`);
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
async function transformVueFile(code, id) {
|
|
35
|
-
const sfc = await parseSFC(code);
|
|
36
|
-
if (!sfc.template?.content) {
|
|
37
|
-
return code;
|
|
38
|
-
}
|
|
39
|
-
const componentStr = ' <page-container :show="__MP_BACK_SHOW_PAGE_CONTAINER__" :overlay="false" @beforeleave="onBeforeLeave" :z-index="1" :duration="false"></page-container>\n';
|
|
40
|
-
let pageBackConfig = { ...this.config };
|
|
41
|
-
let hasPageBack = false;
|
|
42
|
-
let hasImportRef = false;
|
|
43
|
-
let pageBackFnName = "onPageBack";
|
|
44
|
-
let callbackCode = ``;
|
|
28
|
+
function compositionWalk(context, code, sfc, id) {
|
|
45
29
|
const codeMs = new MagicString__default(code);
|
|
46
|
-
const
|
|
47
|
-
|
|
30
|
+
const setupAst = astKit.babelParse(sfc.scriptSetup.loc.source, sfc.scriptSetup.lang);
|
|
31
|
+
let pageInfo = {
|
|
32
|
+
hasPageBack: false,
|
|
33
|
+
pageBackFnName: "onPageBack",
|
|
34
|
+
hasImportRef: false,
|
|
35
|
+
backConfig: { ...context.config },
|
|
36
|
+
callbackCode: ""
|
|
37
|
+
};
|
|
48
38
|
if (setupAst) {
|
|
49
39
|
astKit.walkAST(setupAst, {
|
|
50
40
|
enter(node) {
|
|
51
41
|
if (node.type === "ImportDeclaration") {
|
|
52
42
|
if (node.source.value.includes(virtualFileId)) {
|
|
53
43
|
const importSpecifier = node.specifiers[0];
|
|
54
|
-
hasPageBack = true;
|
|
55
|
-
pageBackFnName = importSpecifier.local.name;
|
|
44
|
+
pageInfo.hasPageBack = true;
|
|
45
|
+
pageInfo.pageBackFnName = importSpecifier.local.name;
|
|
56
46
|
}
|
|
57
47
|
if (node.source.value === "vue") {
|
|
58
48
|
node.specifiers.some((specifier) => {
|
|
59
49
|
if (specifier.local.name === "ref") {
|
|
60
|
-
hasImportRef = true;
|
|
50
|
+
pageInfo.hasImportRef = true;
|
|
61
51
|
return true;
|
|
62
52
|
}
|
|
63
53
|
return false;
|
|
64
54
|
});
|
|
65
55
|
}
|
|
66
56
|
}
|
|
67
|
-
if (node.type === "ExpressionStatement" && node.expression.type === "CallExpression" && node.expression.callee.loc?.identifierName === pageBackFnName) {
|
|
57
|
+
if (node.type === "ExpressionStatement" && node.expression.type === "CallExpression" && node.expression.callee.loc?.identifierName === pageInfo.pageBackFnName) {
|
|
68
58
|
const callback = node.expression.arguments[0];
|
|
69
59
|
const backArguments = node.expression.arguments[1];
|
|
70
60
|
if (backArguments?.type === "ObjectExpression") {
|
|
@@ -72,12 +62,12 @@ async function transformVueFile(code, id) {
|
|
|
72
62
|
// @ts-ignore
|
|
73
63
|
`return (${(generate__default.default ? generate__default.default : generate__default)(backArguments).code});`
|
|
74
64
|
)();
|
|
75
|
-
Object.assign(
|
|
65
|
+
Object.assign(pageInfo.backConfig, config);
|
|
76
66
|
}
|
|
77
67
|
if (callback && (callback.type === "ArrowFunctionExpression" || callback.type === "FunctionExpression")) {
|
|
78
68
|
const body = callback.body;
|
|
79
69
|
if (body.type === "BlockStatement") {
|
|
80
|
-
callbackCode += body.body.map(
|
|
70
|
+
pageInfo.callbackCode += body.body.map(
|
|
81
71
|
// @ts-ignore
|
|
82
72
|
(statement) => (generate__default.default ? generate__default.default : generate__default)(statement).code
|
|
83
73
|
).join("");
|
|
@@ -87,66 +77,265 @@ async function transformVueFile(code, id) {
|
|
|
87
77
|
}
|
|
88
78
|
});
|
|
89
79
|
}
|
|
90
|
-
if (!hasPageBack)
|
|
91
|
-
return;
|
|
92
|
-
this.log.devLog(`\u9875\u9762${this.getPageById(id)}\u6CE8\u5165mp-weixin-back`);
|
|
80
|
+
if (!pageInfo.hasPageBack)
|
|
81
|
+
return code;
|
|
93
82
|
if (code.includes("<page-container")) {
|
|
94
|
-
|
|
83
|
+
context.log.debugLog(`${context.getPageById(id)}\u9875\u9762\u5DF2\u6709page-container\u7EC4\u4EF6\uFF0C\u6CE8\u5165\u5931\u8D25`);
|
|
95
84
|
return code;
|
|
96
85
|
}
|
|
97
|
-
if (!
|
|
98
|
-
callbackCode +=
|
|
86
|
+
if (!pageInfo.backConfig.preventDefault) {
|
|
87
|
+
pageInfo.callbackCode += "uni.navigateBack({ delta: 1 });";
|
|
99
88
|
}
|
|
89
|
+
const importRefFromVue = !pageInfo.hasImportRef ? `import { ref } from 'vue'` : "";
|
|
90
|
+
const stateFrequency = "let __MP_BACK_FREQUENCY__ = 1;";
|
|
91
|
+
const statePageContainerVar = "const __MP_BACK_SHOW_PAGE_CONTAINER__ = ref(true);";
|
|
100
92
|
const configBack = (() => {
|
|
101
|
-
const onPageBack =
|
|
93
|
+
const onPageBack = pageInfo.backConfig.onPageBack;
|
|
102
94
|
if (!onPageBack)
|
|
103
95
|
return "";
|
|
104
96
|
if (typeof onPageBack !== "function") {
|
|
105
97
|
throw new Error("`onPageBack` must be a function");
|
|
106
98
|
}
|
|
107
|
-
const params = JSON.stringify({ page:
|
|
99
|
+
const params = JSON.stringify({ page: context.getPageById(id) });
|
|
108
100
|
if (isArrowFunction(onPageBack) || onPageBack.toString().includes("function")) {
|
|
109
101
|
return `(${onPageBack})(${params});`;
|
|
110
102
|
}
|
|
111
103
|
return `(function ${onPageBack})()`;
|
|
112
104
|
})();
|
|
113
|
-
const
|
|
114
|
-
${!hasImportRef ? "import { ref } from 'vue'" : ""}
|
|
115
|
-
let __MP_BACK_FREQUENCY__ = 1
|
|
116
|
-
const __MP_BACK_SHOW_PAGE_CONTAINER__ = ref(true);
|
|
105
|
+
const stateBeforeLeave = `
|
|
117
106
|
const onBeforeLeave = () => {
|
|
118
|
-
|
|
119
|
-
if (__MP_BACK_FREQUENCY__ < ${pageBackConfig.frequency}) {
|
|
107
|
+
if (__MP_BACK_FREQUENCY__ < ${pageInfo.backConfig.frequency}) {
|
|
120
108
|
__MP_BACK_SHOW_PAGE_CONTAINER__.value = false
|
|
121
109
|
setTimeout(() => __MP_BACK_SHOW_PAGE_CONTAINER__.value = true, 0);
|
|
122
110
|
__MP_BACK_FREQUENCY__++
|
|
123
111
|
}
|
|
124
112
|
${configBack}
|
|
125
|
-
${callbackCode}
|
|
113
|
+
${pageInfo.callbackCode}
|
|
126
114
|
};
|
|
127
115
|
`;
|
|
128
|
-
const { template,
|
|
116
|
+
const { template, scriptSetup } = sfc;
|
|
129
117
|
const tempOffsets = {
|
|
130
118
|
start: template.loc.start.offset,
|
|
131
119
|
end: template.loc.end.offset,
|
|
132
120
|
content: template.content
|
|
133
121
|
};
|
|
134
122
|
const templateMagicString = new MagicString__default(tempOffsets.content);
|
|
135
|
-
templateMagicString.append(
|
|
123
|
+
templateMagicString.append(pageContainerComp);
|
|
136
124
|
codeMs.overwrite(tempOffsets.start, tempOffsets.end, templateMagicString.toString());
|
|
137
|
-
const scriptSfc = script || scriptSetup;
|
|
138
|
-
if (!scriptSfc)
|
|
139
|
-
return;
|
|
140
125
|
const scriptOffsets = {
|
|
141
|
-
start:
|
|
142
|
-
end:
|
|
143
|
-
content:
|
|
126
|
+
start: scriptSetup.loc.start.offset,
|
|
127
|
+
end: scriptSetup.loc.end.offset,
|
|
128
|
+
content: scriptSetup.content || ""
|
|
144
129
|
};
|
|
145
130
|
const scriptMagicString = new MagicString__default(scriptOffsets.content);
|
|
146
|
-
scriptMagicString.prepend(
|
|
131
|
+
scriptMagicString.prepend(
|
|
132
|
+
` ${importRefFromVue}
|
|
133
|
+
${stateFrequency}
|
|
134
|
+
${statePageContainerVar}
|
|
135
|
+
${stateBeforeLeave} `
|
|
136
|
+
);
|
|
147
137
|
codeMs.overwrite(scriptOffsets.start, scriptOffsets.end, scriptMagicString.toString());
|
|
148
138
|
return codeMs.toString();
|
|
149
139
|
}
|
|
140
|
+
function optionsWalk(context, code, sfc, id) {
|
|
141
|
+
const codeMs = new MagicString__default(code);
|
|
142
|
+
const ast = astKit.babelParse(sfc.script.loc.source, sfc.script.lang);
|
|
143
|
+
let pageInfo = {
|
|
144
|
+
hasPageBack: false,
|
|
145
|
+
pageBackFnName: "onPageBack",
|
|
146
|
+
backConfig: { ...context.config }
|
|
147
|
+
};
|
|
148
|
+
let exportDefaultNode = null;
|
|
149
|
+
let dataMethodNode = null;
|
|
150
|
+
let methodsNode = null;
|
|
151
|
+
let onPageBackNodeMethod = null;
|
|
152
|
+
let onPageBackNodeProperty = null;
|
|
153
|
+
if (ast) {
|
|
154
|
+
astKit.walkAST(ast, {
|
|
155
|
+
enter(node) {
|
|
156
|
+
if (node.type === "ExportDefaultDeclaration" && node.declaration.type === "ObjectExpression") {
|
|
157
|
+
exportDefaultNode = node.declaration;
|
|
158
|
+
const properties = node.declaration.properties;
|
|
159
|
+
for (let i = 0; i < properties.length; i++) {
|
|
160
|
+
const element = properties[i];
|
|
161
|
+
if (element.type === "ObjectMethod" && element.key.type === "Identifier" && element.key.name === "data" && element.body.type === "BlockStatement") {
|
|
162
|
+
dataMethodNode = element.body;
|
|
163
|
+
}
|
|
164
|
+
if (element.type === "ObjectProperty" && element.key.type === "Identifier" && element.key.name === "methods") {
|
|
165
|
+
methodsNode = element.value;
|
|
166
|
+
}
|
|
167
|
+
const blockStatementCondition = element.type === "ObjectMethod" && element.key.type === "Identifier" && element.key.name === pageInfo.pageBackFnName && element.body.type === "BlockStatement";
|
|
168
|
+
const functionExpressionCondition = element.type === "ObjectProperty" && element.key.type === "Identifier" && element.key.name === pageInfo.pageBackFnName && element.value.type === "FunctionExpression";
|
|
169
|
+
if (blockStatementCondition) {
|
|
170
|
+
pageInfo.hasPageBack = true;
|
|
171
|
+
onPageBackNodeMethod = element;
|
|
172
|
+
}
|
|
173
|
+
if (functionExpressionCondition) {
|
|
174
|
+
pageInfo.hasPageBack = true;
|
|
175
|
+
onPageBackNodeProperty = element;
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
});
|
|
181
|
+
}
|
|
182
|
+
if (!pageInfo.hasPageBack)
|
|
183
|
+
return;
|
|
184
|
+
const newDataProperty = [
|
|
185
|
+
{
|
|
186
|
+
type: "ObjectProperty",
|
|
187
|
+
key: { type: "Identifier", name: "__MP_BACK_SHOW_PAGE_CONTAINER__" },
|
|
188
|
+
value: { type: "BooleanLiteral", value: true },
|
|
189
|
+
computed: false,
|
|
190
|
+
shorthand: false
|
|
191
|
+
},
|
|
192
|
+
{
|
|
193
|
+
type: "ObjectProperty",
|
|
194
|
+
key: { type: "Identifier", name: "__MP_BACK_FREQUENCY__" },
|
|
195
|
+
value: { type: "NumericLiteral", value: 1 },
|
|
196
|
+
computed: false,
|
|
197
|
+
shorthand: false
|
|
198
|
+
}
|
|
199
|
+
];
|
|
200
|
+
if (dataMethodNode) {
|
|
201
|
+
const returnStatement = dataMethodNode.body.find(
|
|
202
|
+
(node) => node.type === "ReturnStatement"
|
|
203
|
+
);
|
|
204
|
+
if (returnStatement && returnStatement.argument && returnStatement.argument.type === "ObjectExpression") {
|
|
205
|
+
returnStatement.argument.properties.push(...newDataProperty);
|
|
206
|
+
}
|
|
207
|
+
} else if (exportDefaultNode) {
|
|
208
|
+
const addData = {
|
|
209
|
+
type: "ObjectMethod",
|
|
210
|
+
key: { type: "Identifier", name: "data" },
|
|
211
|
+
kind: "method",
|
|
212
|
+
params: [],
|
|
213
|
+
async: false,
|
|
214
|
+
generator: false,
|
|
215
|
+
computed: false,
|
|
216
|
+
body: {
|
|
217
|
+
type: "BlockStatement",
|
|
218
|
+
directives: [],
|
|
219
|
+
body: [
|
|
220
|
+
{
|
|
221
|
+
type: "ReturnStatement",
|
|
222
|
+
argument: {
|
|
223
|
+
type: "ObjectExpression",
|
|
224
|
+
properties: newDataProperty
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
]
|
|
228
|
+
}
|
|
229
|
+
};
|
|
230
|
+
exportDefaultNode.properties.push(addData);
|
|
231
|
+
}
|
|
232
|
+
const configBack = (() => {
|
|
233
|
+
const onPageBack = pageInfo.backConfig.onPageBack;
|
|
234
|
+
if (!onPageBack)
|
|
235
|
+
return "";
|
|
236
|
+
if (typeof onPageBack !== "function") {
|
|
237
|
+
throw new Error("`onPageBack` must be a function");
|
|
238
|
+
}
|
|
239
|
+
const params = JSON.stringify({ page: context.getPageById(id) });
|
|
240
|
+
if (isArrowFunction(onPageBack) || onPageBack.toString().includes("function")) {
|
|
241
|
+
return `(${onPageBack})(${params});`;
|
|
242
|
+
}
|
|
243
|
+
return `(function ${onPageBack})()`;
|
|
244
|
+
})();
|
|
245
|
+
const stateBeforeLeave = `
|
|
246
|
+
function onBeforeLeave() {
|
|
247
|
+
if (this.__MP_BACK_FREQUENCY__ < ${pageInfo.backConfig.frequency}) {
|
|
248
|
+
this.__MP_BACK_SHOW_PAGE_CONTAINER__ = false
|
|
249
|
+
setTimeout(() => { this.__MP_BACK_SHOW_PAGE_CONTAINER__ = true }, 0);
|
|
250
|
+
this.__MP_BACK_FREQUENCY__++
|
|
251
|
+
}
|
|
252
|
+
${configBack}
|
|
253
|
+
${!pageInfo.backConfig.preventDefault ? "uni.navigateBack({ delta: 1 });" : ""}
|
|
254
|
+
};
|
|
255
|
+
`;
|
|
256
|
+
const stateBeforeLeaveAst = astKit.babelParse(stateBeforeLeave);
|
|
257
|
+
const stateBeforeLeaveNode = stateBeforeLeaveAst.body.find(
|
|
258
|
+
(node) => node.type === "FunctionDeclaration"
|
|
259
|
+
);
|
|
260
|
+
const newMethodsProperty = {
|
|
261
|
+
type: "ObjectMethod",
|
|
262
|
+
key: {
|
|
263
|
+
type: "Identifier",
|
|
264
|
+
name: "onBeforeLeave"
|
|
265
|
+
},
|
|
266
|
+
kind: "method",
|
|
267
|
+
generator: false,
|
|
268
|
+
async: false,
|
|
269
|
+
params: [],
|
|
270
|
+
computed: false,
|
|
271
|
+
body: {
|
|
272
|
+
type: "BlockStatement",
|
|
273
|
+
directives: [],
|
|
274
|
+
body: [
|
|
275
|
+
...onPageBackNodeMethod ? onPageBackNodeMethod.body.body : [],
|
|
276
|
+
...onPageBackNodeProperty ? onPageBackNodeProperty.value.body.body : [],
|
|
277
|
+
...stateBeforeLeaveNode.body.body
|
|
278
|
+
]
|
|
279
|
+
}
|
|
280
|
+
};
|
|
281
|
+
if (methodsNode) {
|
|
282
|
+
methodsNode.properties.push(newMethodsProperty);
|
|
283
|
+
} else if (exportDefaultNode) {
|
|
284
|
+
const addMethods = {
|
|
285
|
+
type: "ObjectProperty",
|
|
286
|
+
computed: false,
|
|
287
|
+
shorthand: false,
|
|
288
|
+
key: {
|
|
289
|
+
type: "Identifier",
|
|
290
|
+
name: "methods"
|
|
291
|
+
},
|
|
292
|
+
value: {
|
|
293
|
+
type: "ObjectExpression",
|
|
294
|
+
properties: [newMethodsProperty]
|
|
295
|
+
}
|
|
296
|
+
};
|
|
297
|
+
exportDefaultNode.properties.push(addMethods);
|
|
298
|
+
}
|
|
299
|
+
const { template, script } = sfc;
|
|
300
|
+
const tempOffsets = {
|
|
301
|
+
start: template.loc.start.offset,
|
|
302
|
+
end: template.loc.end.offset,
|
|
303
|
+
content: template.content
|
|
304
|
+
};
|
|
305
|
+
const templateMagicString = new MagicString__default(tempOffsets.content);
|
|
306
|
+
templateMagicString.append(pageContainerComp);
|
|
307
|
+
codeMs.overwrite(tempOffsets.start, tempOffsets.end, templateMagicString.toString());
|
|
308
|
+
const scriptOffsets = {
|
|
309
|
+
start: script.loc.start.offset,
|
|
310
|
+
end: script.loc.end.offset
|
|
311
|
+
};
|
|
312
|
+
const newScriptContent = (generate__default.default ? generate__default.default : generate__default)(ast).code;
|
|
313
|
+
codeMs.overwrite(scriptOffsets.start, scriptOffsets.end, newScriptContent);
|
|
314
|
+
return codeMs.toString();
|
|
315
|
+
}
|
|
316
|
+
const vueWalker = {
|
|
317
|
+
compositionWalk,
|
|
318
|
+
optionsWalk
|
|
319
|
+
};
|
|
320
|
+
|
|
321
|
+
async function transformVueFile(code, id) {
|
|
322
|
+
try {
|
|
323
|
+
const sfc = compilerSfc.parse(code).descriptor;
|
|
324
|
+
const { template, script, scriptSetup } = sfc;
|
|
325
|
+
if (!template?.content) {
|
|
326
|
+
return code;
|
|
327
|
+
}
|
|
328
|
+
if (!script?.content && !scriptSetup?.content) {
|
|
329
|
+
return code;
|
|
330
|
+
}
|
|
331
|
+
const walker = scriptSetup ? "compositionWalk" : "optionsWalk";
|
|
332
|
+
return vueWalker[walker](this, code, sfc, id);
|
|
333
|
+
} catch (error) {
|
|
334
|
+
this.log.error("\u89E3\u6790vue\u6587\u4EF6\u5931\u8D25\uFF0C\u8BF7\u68C0\u67E5\u6587\u4EF6\u662F\u5426\u6B63\u786E");
|
|
335
|
+
this.log.debugLog(String(error));
|
|
336
|
+
return code;
|
|
337
|
+
}
|
|
338
|
+
}
|
|
150
339
|
|
|
151
340
|
var __defProp = Object.defineProperty;
|
|
152
341
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
@@ -156,18 +345,19 @@ var __publicField = (obj, key, value) => {
|
|
|
156
345
|
};
|
|
157
346
|
class pageContext {
|
|
158
347
|
constructor(config) {
|
|
348
|
+
__publicField(this, "logPreText", "[mp-weixin-back] : ");
|
|
159
349
|
__publicField(this, "config");
|
|
160
350
|
__publicField(this, "pages", []);
|
|
161
351
|
__publicField(this, "log", {
|
|
162
352
|
info: (text) => {
|
|
163
|
-
console.log(kolorist.white(text));
|
|
353
|
+
console.log(kolorist.white(this.logPreText + text));
|
|
164
354
|
},
|
|
165
355
|
error: (text) => {
|
|
166
|
-
console.log(kolorist.red(text));
|
|
356
|
+
console.log(kolorist.red(this.logPreText + text));
|
|
167
357
|
},
|
|
168
|
-
|
|
358
|
+
debugLog: (text) => {
|
|
169
359
|
if (this.config.mode === "development" && this.config.debug) {
|
|
170
|
-
console.log(kolorist.green(text));
|
|
360
|
+
console.log(kolorist.green(this.logPreText + text));
|
|
171
361
|
}
|
|
172
362
|
}
|
|
173
363
|
});
|
|
@@ -206,7 +396,7 @@ class pageContext {
|
|
|
206
396
|
}
|
|
207
397
|
} catch (error) {
|
|
208
398
|
this.log.error("\u8BFB\u53D6pages.json\u6587\u4EF6\u5931\u8D25");
|
|
209
|
-
this.log.
|
|
399
|
+
this.log.debugLog(String(error));
|
|
210
400
|
}
|
|
211
401
|
}
|
|
212
402
|
// 获取指定id的page
|