From 3b03f87a02458f719e2eb4bf112a13441b427d14 Mon Sep 17 00:00:00 2001
From: ‘chensiAb’ <‘chenchenco03@163.com’>
Date: Tue, 25 Mar 2025 13:54:34 +0800
Subject: [PATCH] Merge branch 'master' of ssh://dev.zhiheiot.com:29418/mob-components

---
 _cursor.ai/rules/type-pilot.mdc |   40 ++++++++++++++++++++++++++++++++++++++++
 1 files changed, 40 insertions(+), 0 deletions(-)

diff --git a/_cursor.ai/rules/type-pilot.mdc b/_cursor.ai/rules/type-pilot.mdc
index a1f356c..96010c5 100644
--- a/_cursor.ai/rules/type-pilot.mdc
+++ b/_cursor.ai/rules/type-pilot.mdc
@@ -5,3 +5,43 @@
 ---
 
 # 数据控制器
+
+## 数据控制器空白模板
+
+```js
+/**
+ * PPageName - 页面名称
+ * @author 作者
+ */
+
+import Taro from '@tarojs/taro';
+import { Pilot } from '@components/bases/Pilot';
+import { $fetchCommon } from '@fetchers/FCommon';
+
+export class PPageName extends Pilot {
+
+    $data() {
+        return {};
+    }
+
+    $mounted() {
+        this.onLoadDataResource();
+    }
+
+    // 加载用户详情
+    onLoadDataResource() {
+        Taro.showLoading();
+        $fetchCommon.getPageDetail()
+            .then(res => {
+                Taro.hideLoading();
+                if (!res) {
+                    return;
+                }
+                // do something
+            });
+    }
+
+}
+```
+
+说明:请求异常由请求层的基类自动处理,数据控制层跳过错误的逻辑,只处理请求成功的后续业务
\ No newline at end of file

--
Gitblit v1.9.1