@cloudbase/lowcode-builder 1.8.9 → 1.8.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.
@@ -6,12 +6,12 @@ export declare const materialsDirName = "materials";
6
6
  * src/template的代码,在IDE编辑器插件中构建builder
7
7
  * 存放在大账号:100015939275。访问地址:https://console.cloud.tencent.com/cos/bucket?bucket=comp-public-1303824488&region=ap-shanghai&path=%252Flcap-builder%252F
8
8
  */
9
- export declare const builderTemplateURL = "https://comp-public-1303824488.cos.ap-shanghai.myqcloud.com/lcap-builder/template_20230213.zip";
9
+ export declare const builderTemplateURL = "https://comp-public-1303824488.cos.ap-shanghai.myqcloud.com/lcap-builder/template_20230606.zip";
10
10
  /**
11
11
  * miniprogram的代码,IDE插件后续会提供端功能
12
12
  * 存放在大账号:100015939275。访问地址:https://console.cloud.tencent.com/cos/bucket?bucket=comp-public-1303824488&region=ap-shanghai&path=%252Flcap-builder%252F
13
13
  */
14
- export declare const miniprogramURL = "https://comp-public-1303824488.cos.ap-shanghai.myqcloud.com/lcap-builder/miniprogram_npm_20230213.zip";
14
+ export declare const miniprogramURL = "https://comp-public-1303824488.cos.ap-shanghai.myqcloud.com/lcap-builder/miniprogram_npm_20230606.zip";
15
15
  /**
16
16
  * miniprogram_npm存放目录。IDE插件builder用到
17
17
  */
@@ -45,12 +45,12 @@ exports.materialsDirName = 'materials'; // materials diretory of current project
45
45
  * src/template的代码,在IDE编辑器插件中构建builder
46
46
  * 存放在大账号:100015939275。访问地址:https://console.cloud.tencent.com/cos/bucket?bucket=comp-public-1303824488&region=ap-shanghai&path=%252Flcap-builder%252F
47
47
  */
48
- exports.builderTemplateURL = 'https://comp-public-1303824488.cos.ap-shanghai.myqcloud.com/lcap-builder/template_20230213.zip';
48
+ exports.builderTemplateURL = 'https://comp-public-1303824488.cos.ap-shanghai.myqcloud.com/lcap-builder/template_20230606.zip';
49
49
  /**
50
50
  * miniprogram的代码,IDE插件后续会提供端功能
51
51
  * 存放在大账号:100015939275。访问地址:https://console.cloud.tencent.com/cos/bucket?bucket=comp-public-1303824488&region=ap-shanghai&path=%252Flcap-builder%252F
52
52
  */
53
- exports.miniprogramURL = 'https://comp-public-1303824488.cos.ap-shanghai.myqcloud.com/lcap-builder/miniprogram_npm_20230213.zip';
53
+ exports.miniprogramURL = 'https://comp-public-1303824488.cos.ap-shanghai.myqcloud.com/lcap-builder/miniprogram_npm_20230606.zip';
54
54
  /**
55
55
  * miniprogram_npm存放目录。IDE插件builder用到
56
56
  */
@@ -48,7 +48,7 @@ export declare function buildWedaConfig({ output, domain, isPrivateMode, endpoin
48
48
  endpointType?: IBuildWedaApp['endpointType'];
49
49
  buildTypeList?: IBuildWedaApp['buildTypeList'];
50
50
  }): Promise<void>;
51
- export declare function buildWedaApp({ cals, subAppCalsList, dependencies, appKey, runtime, ignoreInstall, buildTypeList, mode, devTool, deployOptions, generateMpType, plugins, extraData, resourceAppId, domain, output, isBrowserMpBuilder, cdnEndpoints, isPrivateMode, endpointType, }: IBuildWedaApp, cb?: WebpackBuildCallBack): Promise<string | undefined>;
51
+ export declare function buildWedaApp({ cals, subAppCalsList, dependencies, appKey, runtime, ignoreInstall, buildTypeList, mode, devTool, deployOptions, generateMpType, plugins, extraData, resourceAppId, domain, output, isBrowserMpBuilder, cdnEndpoints, isPrivateMode, endpointType, }: IBuildWedaApp, cb?: WebpackBuildCallBack): Promise<any>;
52
52
  export declare function cleanComponentDir(): Promise<void>;
53
53
  export declare const version: any;
54
54
  export { getFiles, fileToZip, strToBuf } from '../util/generateFiles';
@@ -12,7 +12,6 @@ const common_1 = require("../types/common");
12
12
  const index_1 = require("../mp/index");
13
13
  const types_1 = require("../../types");
14
14
  const mixMode_1 = require("../mp/mixMode");
15
- const index_2 = require("../h5/index");
16
15
  const common_2 = require("../../utils/common");
17
16
  const postProcess_1 = require("../../utils/postProcess");
18
17
  const cals_1 = require("@cloudbase/cals");
@@ -62,7 +61,7 @@ async function buildWedaApp({ cals, subAppCalsList = [], dependencies = [], appK
62
61
  isComposite: false,
63
62
  compProps: {},
64
63
  }, resourceAppId = undefined, domain = '', output, isBrowserMpBuilder = false, cdnEndpoints, isPrivateMode = false, endpointType = undefined, }, cb) {
65
- var _a, _b;
64
+ var _a, _b, _c;
66
65
  if (!cals) {
67
66
  console.error('无效的应用配置');
68
67
  return;
@@ -138,6 +137,7 @@ async function buildWedaApp({ cals, subAppCalsList = [], dependencies = [], appK
138
137
  ? 'px'
139
138
  : 'rpx'),
140
139
  enablePageRoot,
140
+ enableLoading: (_c = cals === null || cals === void 0 ? void 0 : cals.extra) === null || _c === void 0 ? void 0 : _c.enableLoading,
141
141
  };
142
142
  const result = await (0, index_1.generateWxMp)({
143
143
  weapps: apps,
@@ -185,24 +185,28 @@ async function buildWedaApp({ cals, subAppCalsList = [], dependencies = [], appK
185
185
  return outDir;
186
186
  }
187
187
  else {
188
- const h5BuildDir = await (0, index_2.buildH5App)({
189
- buildContext: { ...buildContext, isMixMode: false },
190
- cals,
191
- subAppCalsList,
192
- extraData,
193
- buildTypeList,
194
- mode,
195
- devTool,
196
- runtime,
197
- deployOptions,
198
- ignoreInstall,
199
- cdnEndpoints,
200
- });
201
- await (cb === null || cb === void 0 ? void 0 : cb(null, {
202
- outDir: h5BuildDir,
203
- timeElapsed: Date.now() - startTime,
204
- }));
205
- return h5BuildDir;
188
+ // web worker build 构建时注入, H5构建目前不支持web worker,web worker build时过滤掉
189
+ if (!process.env.IS_WEB_WORKER) {
190
+ const { buildH5App } = require('../h5/index');
191
+ const h5BuildDir = await buildH5App({
192
+ buildContext: { ...buildContext, isMixMode: false },
193
+ cals,
194
+ subAppCalsList,
195
+ extraData,
196
+ buildTypeList,
197
+ mode,
198
+ devTool,
199
+ runtime,
200
+ deployOptions,
201
+ ignoreInstall,
202
+ cdnEndpoints,
203
+ });
204
+ await (cb === null || cb === void 0 ? void 0 : cb(null, {
205
+ outDir: h5BuildDir,
206
+ timeElapsed: Date.now() - startTime,
207
+ }));
208
+ return h5BuildDir;
209
+ }
206
210
  }
207
211
  }
208
212
  catch (err) {
@@ -6,7 +6,12 @@ import { BuildType } from '../types/common';
6
6
  * 该函数从 @govcloud/generate 取到需要的模版文件
7
7
  */
8
8
  export declare function generateProjectFiles(buildData: BuildAppProps): Promise<void>;
9
- export declare function generateHTML({ appId, envId, description, appBuildDir, externalResources, mode, devTool, isBuildApp, buildTypeList, cdnEndpoints, }: {
9
+ export declare function generateHTML({ appId, envId, description, appBuildDir, externalResources, mode, devTool, isBuildApp, buildTypeList, cdnEndpoints,
10
+ /**
11
+ * 由于存量兜底逻辑存在
12
+ * 默认值为 undefined 否则应为 false
13
+ */
14
+ enableLoading, }: {
10
15
  appId: string;
11
16
  envId: string;
12
17
  description?: string;
@@ -17,6 +22,7 @@ export declare function generateHTML({ appId, envId, description, appBuildDir, e
17
22
  isBuildApp: boolean;
18
23
  buildTypeList: BuildType[];
19
24
  cdnEndpoints?: ICDN_ENDPOINTS_COFIG;
25
+ enableLoading?: boolean;
20
26
  }): Promise<void>;
21
27
  export declare function handleAssets({ appBuildDir, buildTypeList, assets, }: {
22
28
  appBuildDir: string;
@@ -25,7 +25,12 @@ async function generateProjectFiles(buildData) {
25
25
  }));
26
26
  }
27
27
  exports.generateProjectFiles = generateProjectFiles;
28
- async function generateHTML({ appId, envId, description = '', appBuildDir, externalResources = [], mode, devTool, isBuildApp, buildTypeList, cdnEndpoints, }) {
28
+ async function generateHTML({ appId, envId, description = '', appBuildDir, externalResources = [], mode, devTool, isBuildApp, buildTypeList, cdnEndpoints,
29
+ /**
30
+ * 由于存量兜底逻辑存在
31
+ * 默认值为 undefined 否则应为 false
32
+ */
33
+ enableLoading = undefined, }) {
29
34
  const templatePath = path_1.default.join(config_1.appTemplateDir, 'html', 'index.html.ejs');
30
35
  const dstFilePath = path_1.default.join(appBuildDir, 'index.html');
31
36
  const packageTpl = await fs_extra_1.default.readFile(templatePath, { encoding: 'utf8' });
@@ -56,14 +61,17 @@ async function generateHTML({ appId, envId, description = '', appBuildDir, exter
56
61
  cdnEndpoints: (0, config_1.generateCdnEndpoints)(cdnEndpoints),
57
62
  /**
58
63
  * @deprecated
59
- * 临时先这么添加白名单
64
+ * 此次临时保留白名单兜底逻辑
65
+ * 当应用数据补充完成后可以祛除
60
66
  */
61
- enableStaticLoading: [
62
- 'lowcode-4gzdsu5k66946492',
63
- 'lowcode-2gay8jgh25c7b1cf',
64
- 'lowcode-4g9b78bx94404d85',
65
- 'lowcode-8gmx7bat3135e2de',
66
- ].includes(envId) && !(0, common_2.buildAsAdminPortalByBuildType)(buildTypeList),
67
+ enableLoading: !(0, common_2.buildAsAdminPortalByBuildType)(buildTypeList) && enableLoading === undefined
68
+ ? [
69
+ 'lowcode-4gzdsu5k66946492',
70
+ 'lowcode-2gay8jgh25c7b1cf',
71
+ 'lowcode-4g9b78bx94404d85',
72
+ 'lowcode-8gmx7bat3135e2de',
73
+ ].includes(envId)
74
+ : enableLoading,
67
75
  }));
68
76
  }
69
77
  exports.generateHTML = generateHTML;
@@ -6,6 +6,7 @@ const webpack_1 = require("../service/webpack");
6
6
  const generate_1 = require("./generate");
7
7
  const cals_1 = require("@cloudbase/cals");
8
8
  async function runWebpackCore({ cals, mainAppData, subAppDataList, appBuildDir, publicPath, mode = common_1.WebpackModeType.NONE, appKey, buildTypeList = [common_1.BuildType.WEB], mpConfig, assets = [], devTool = 'vite', generateMpType = common_1.GenerateMpType.APP, cdnEndpoints, }) {
9
+ var _a;
9
10
  console.time('runWebpackCore');
10
11
  console.time('webpackGenerate');
11
12
  const allAppDataList = subAppDataList.concat(mainAppData);
@@ -29,7 +30,8 @@ async function runWebpackCore({ cals, mainAppData, subAppDataList, appBuildDir,
29
30
  await (0, generate_1.generateHTML)({
30
31
  appId: mainAppData.id || appKey,
31
32
  envId: mainAppData.envId || '',
32
- description: cals.description || '',
33
+ description: cals.description /* || cals.label */ || '',
34
+ enableLoading: (_a = cals.extra) === null || _a === void 0 ? void 0 : _a.enableLoading,
33
35
  appBuildDir,
34
36
  externalResources: (cals.externalResources || []).concat(assets.map((url) => ({
35
37
  type: cals_1.EExternalResourceType.CSSUrl,
@@ -31,6 +31,10 @@ export interface IBuildContext {
31
31
  * 并设置 #page-root-id
32
32
  */
33
33
  enablePageRoot?: boolean;
34
+ /**
35
+ * 是否使用默认加载
36
+ */
37
+ enableLoading?: boolean;
34
38
  /**
35
39
  * 应用版本
36
40
  */
@@ -125,6 +125,7 @@ async function generateWxMp({ buildContext, weapps, plugins, deployOptions, opti
125
125
  },
126
126
  'common/query.ts': {},
127
127
  'common/flow.ts': {},
128
+ 'common/loading': {},
128
129
  /**
129
130
  * 调试用
130
131
  */
@@ -238,6 +238,7 @@ async function generateCompositeComponent(ctx, compositedComp, compLibCommonReso
238
238
  const compositeCtx = {
239
239
  ...ctx,
240
240
  isPage: false,
241
+ enableLoading: false,
241
242
  };
242
243
  const { materialName } = compositedComp;
243
244
  const outDir = path.join(compositeCtx.projDir, compositeCtx.rootPath || '', // 混合模式下,可能会有 rootPath
@@ -66,6 +66,16 @@ function generateWxml(ctx, widgets, docTag, wxmlDataPrefix, usingComponents, com
66
66
  _parent: null,
67
67
  },
68
68
  ];
69
+ if (ctx.enableLoading) {
70
+ usingComponents['wd-loading'] = '/common/loading/index';
71
+ xmlJson.elements.push({
72
+ type: 'element',
73
+ name: 'wd-loading',
74
+ attributes: {
75
+ ['wx:if']: '{{_isCheckingAtuh}}',
76
+ },
77
+ });
78
+ }
69
79
  }
70
80
  function createXml(widgets, parent = null, parentForNodes = []) {
71
81
  var _a, _b, _c, _d, _e, _f;
@@ -1,7 +1,7 @@
1
1
  /// <reference types="node" />
2
2
  import { OutputType } from 'jszip';
3
3
  export declare const generatedFileContents: {};
4
- export default function generateFiles(appFileData: any, srcDir: string, dstDir: string): Promise<string[]>;
4
+ export default function generateFiles(appFileData: any, srcDir: string, dstDir: string): Promise<void>;
5
5
  export declare function writeFile(outFile: string, content: string): Promise<boolean>;
6
6
  export declare function removeFile(file: string): void;
7
7
  /**
@@ -42,16 +42,21 @@ async function generateFiles(appFileData, srcDir, dstDir) {
42
42
  const fileNameList = file.split('|');
43
43
  const srcFileName = fileNameList[0];
44
44
  const outFileName = fileNameList[1] || fileNameList[0];
45
- const tplStr = await fs_extra_1.default.readFile(path_1.default.join(srcDir, srcFileName), {
46
- encoding: 'utf8',
47
- });
48
- let generatedCode = (0, lodash_1.template)(tplStr, { interpolate: /<%=([\s\S]+?)%>/ })(appFileData[file]);
49
- const outFile = path_1.default.resolve(dstDir, outFileName.replace(/\.tpl$/, ''));
50
- if (await writeFile(outFile, generatedCode)) {
51
- filesGenerated.push(outFileName);
45
+ const srcePath = path_1.default.join(srcDir, srcFileName);
46
+ if (fs_extra_1.default.lstatSync(srcePath).isDirectory()) {
47
+ (0, exports.copyRecursiveSync)(srcePath, path_1.default.join(dstDir, outFileName));
48
+ }
49
+ else {
50
+ const tplStr = await fs_extra_1.default.readFile(path_1.default.join(srcDir, srcFileName), {
51
+ encoding: 'utf8',
52
+ });
53
+ let generatedCode = (0, lodash_1.template)(tplStr, { interpolate: /<%=([\s\S]+?)%>/ })(appFileData[file]);
54
+ const outFile = path_1.default.resolve(dstDir, outFileName.replace(/\.tpl$/, ''));
55
+ if (await writeFile(outFile, generatedCode)) {
56
+ filesGenerated.push(outFileName);
57
+ }
52
58
  }
53
59
  }
54
- return filesGenerated;
55
60
  }
56
61
  exports.default = generateFiles;
57
62
  async function writeFile(outFile, content) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cloudbase/lowcode-builder",
3
- "version": "1.8.9",
3
+ "version": "1.8.10",
4
4
  "description": "云开发 Tencent CloudBase Framework Low Code Plugin,将低码配置生成完整项目并一键部署云开发资源。",
5
5
  "author": "yhsunshining@gmail.com",
6
6
  "homepage": "https://github.com/TencentCloudBase/cloudbase-framework#readme",
@@ -38,8 +38,8 @@
38
38
  "url": "https://github.com/TencentCloudBase/cloudbase-framework/issues"
39
39
  },
40
40
  "dependencies": {
41
- "@cloudbase/cals": "^1.0.9-alpha.0",
42
- "@cloudbase/lowcode-generator": "^1.8.0",
41
+ "@cloudbase/cals": "^1.0.9",
42
+ "@cloudbase/lowcode-generator": "^1.8.1",
43
43
  "axios": "^0.21.0",
44
44
  "browserfs": "^1.4.3",
45
45
  "browserify-zlib": "^0.2.0",
@@ -9,7 +9,9 @@
9
9
  content="width=device-width,initial-scale=1.0,user-scalable=no<% if(!isBuildApp) {%>,viewport-fit=cover<%}%>"
10
10
  />
11
11
  <meta name="format-detection" content="telephone=no" />
12
- <!-- <meta name="description" content="<%= desc %>" /> -->
12
+ <% if(desc){ %>
13
+ <meta name="description" content="<%= desc %>" />
14
+ <% } %>
13
15
  <link
14
16
  rel="stylesheet"
15
17
  href="<%=
@@ -389,7 +391,7 @@
389
391
 
390
392
  <body data-weui-theme="light">
391
393
  <div id="root" class="main-wrap">
392
- <% if(enableStaticLoading){ %>
394
+ <% if(enableLoading){ %>
393
395
  <style type="text/css">
394
396
  .weda-loading-container {
395
397
  position: fixed;
@@ -549,7 +551,7 @@
549
551
  crossorigin
550
552
  src="<%=
551
553
  cdnEndpoints.cdngo
552
- %>/lcap/lcap-resource-cdngo/-/0.1.4/_files/static/weda-render/main.babe263dcf07a0b2f76e.bundle.js"
554
+ %>/lcap/lcap-resource-cdngo/-/0.1.4/_files/static/weda-render/main.3df3008899037155a92c.bundle.js"
553
555
  ></script>
554
556
  </body>
555
557
  </html>
@@ -0,0 +1,30 @@
1
+ Component({
2
+ /**
3
+ * 组件的属性列表
4
+ */
5
+ properties: {
6
+ message: String
7
+ },
8
+
9
+ /**
10
+ * 组件的初始数据
11
+ */
12
+ data: {
13
+ message: '',
14
+ visible: false
15
+ },
16
+
17
+ /**
18
+ * 组件的方法列表
19
+ */
20
+ methods: {
21
+
22
+ },
23
+ lifetimes: {
24
+ attached() {
25
+ setTimeout(() => {
26
+ this.setData({ visible: true, message: '登录鉴权中...' })
27
+ }, 100)
28
+ },
29
+ },
30
+ })
@@ -0,0 +1,4 @@
1
+ {
2
+ "component": true,
3
+ "usingComponents": {}
4
+ }
@@ -0,0 +1,8 @@
1
+ <view id="loading" class="weda-loading-container" wx:if="{{visible}}">
2
+ <view class="logo">
3
+ <view class="sp sp-circle"></view>
4
+ </view>
5
+ <view class="text" id="message">
6
+ {{message}}
7
+ </view>
8
+ </view>
@@ -0,0 +1,44 @@
1
+ .weda-loading-container {
2
+ position: fixed;
3
+ left:0;
4
+ top:0;
5
+ width: 100%;
6
+ display: flex;
7
+ justify-content: center;
8
+ align-items: center;
9
+ flex-direction: column;
10
+ height:100%;
11
+ padding: 0 20px;
12
+ }
13
+ .weda-loading-container .logo {
14
+ width: 100%;
15
+ display: flex;
16
+ justify-content: center;
17
+ text-align: center;
18
+ margin-bottom: 50rpx;
19
+ }
20
+
21
+ .weda-loading-container .text {
22
+ font-size: 14px;
23
+ }
24
+
25
+ .weda-loading-container .sp{
26
+ width: 48px;
27
+ height:48px;
28
+ }
29
+
30
+ .weda-loading-container .sp-circle {
31
+ border: 6px rgba(0,82,217,0.25) solid;
32
+ border-top: 6px rgba(0,82,217,1) solid;
33
+ border-radius: 50%;
34
+ -webkit-animation: spCircRot .6s infinite linear;
35
+ animation: spCircRot .6s infinite linear;
36
+ }
37
+ @-webkit-keyframes spCircRot {
38
+ from { -webkit-transform: rotate(0deg); }
39
+ to { -webkit-transform: rotate(359deg); }
40
+ }
41
+ @keyframes spCircRot {
42
+ from { transform: rotate(0deg); }
43
+ to { transform: rotate(359deg); }
44
+ }
@@ -157,6 +157,9 @@ export function createEventHandlers(
157
157
  }
158
158
  }
159
159
  } catch (e) {
160
+ if (e.message) {
161
+ e.message = `${currentTarget?.id || ''}[${trigger}:${l.key}]: ${e.message}`;
162
+ }
160
163
  nextEventHandles[0].handlerName = l.key ? `${prefix}$${l.key}_fail` : '';
161
164
  nextEventHandles[0].event.detail = isIfAction ? event.detail : e;
162
165
  error = e;
@@ -170,12 +173,20 @@ export function createEventHandlers(
170
173
  const nextHandler = nextEventHandles[0];
171
174
 
172
175
  if (!self[nextHandler.handlerName] && error) {
173
- console.error(`Action error: [${trigger}:${l.key}]`, error);
176
+ console.error(`Action error:`, error);
174
177
  if (!looseError) {
175
- app.showToast({
176
- icon: 'error',
177
- title: `事件响应失败`,
178
- });
178
+ if (app.__internal__?.env?.type !== 'production') {
179
+ app.showModal({
180
+ title: `事件响应失败`,
181
+ content: error.message || '',
182
+ showCancel: false,
183
+ });
184
+ } else {
185
+ app.showToast({
186
+ icon: 'error',
187
+ title: `事件响应失败`,
188
+ });
189
+ }
179
190
  }
180
191
  throw error;
181
192
  } else {
@@ -213,7 +224,6 @@ export function createEventHandlers(
213
224
  return res.length ? res[0] : event.detail;
214
225
  });
215
226
  }
216
-
217
227
  };
218
228
  }
219
229
 
@@ -456,7 +466,6 @@ export function formatErrorMsg(e) {
456
466
  * 检查页面权限
457
467
  **/
458
468
  export async function checkAuth(app, appId, $page) {
459
- return true;
460
469
  const loginPage = findLoginPage(app);
461
470
  if (loginPage?.id === $page.id) {
462
471
  return true;
@@ -521,7 +530,7 @@ export function redirectToLogin(currentPage) {
521
530
  pageId: loginPage.id,
522
531
  params: {
523
532
  sourcePageId: currentPage.id,
524
- sourcePageParams: currentPage.params,
533
+ sourcePageParams: currentPage.params || currentPage.dataset?.params,
525
534
  },
526
535
  });
527
536
  } else {
@@ -86,7 +86,11 @@ export function createPage({
86
86
 
87
87
  return Component({
88
88
  _componentType: 'page',
89
- data: createInitData(widgetProps, dataBinds),
89
+ data: {
90
+ ...createInitData(widgetProps, dataBinds),
91
+ _isCheckingAtuh: false,
92
+ weDaHasLogin: false
93
+ },
90
94
  lifetimes: {
91
95
  attached() {
92
96
  this._disposers = []
@@ -108,7 +112,7 @@ export function createPage({
108
112
  const widget = getWidget($page.widgets, e.target.id);
109
113
  widget._methods = {};
110
114
  };
111
- this._disposers.push( ...this.initMergeRenderer($page.widgets));
115
+ this._disposers.push(...this.initMergeRenderer($page.widgets));
112
116
  },
113
117
  detached() {
114
118
  const $page = this._getInstance();
@@ -142,18 +146,25 @@ export function createPage({
142
146
  if (query) {
143
147
  EXTRA_API.setParams($page.uuid, query);
144
148
  }
145
- if (await checkAuth(app, app.id, $page)) {
146
- this.setData({
147
- weDaHasLogin: true,
148
- });
149
- createStateDataSourceVar($page.uuid, generateParamsParser({ app, $page }));
149
+ try {
150
+ this.setData({ _isCheckingAtuh: true })
151
+ const auth = await checkAuth(app, app.id, $page);
152
+ if(auth) {
153
+ this.setData({
154
+ weDaHasLogin: true,
155
+ });
156
+ createStateDataSourceVar($page.uuid, generateParamsParser({ app, $page }));
157
+ }
158
+ } finally {
159
+ this.setData({ _isCheckingAtuh: false })
150
160
  }
161
+
151
162
  // eslint-disable-next-line no-restricted-syntax
152
- for (const queryId in $page.dataset?.query||{}) {
163
+ for (const queryId in $page.dataset?.query || {}) {
153
164
  if ($page.dataset.query[queryId]?._schema?.trigger === 'auto') {
154
165
  try {
155
166
  $page.dataset.query[queryId].trigger();
156
- this._disposers.push(()=> $page.dataset.query[queryId].destroy())
167
+ this._disposers.push(() => $page.dataset.query[queryId].destroy())
157
168
  } catch (e) {
158
169
  console.error(`query ${queryId} 初始化失败:`, e);
159
170
  }