From 32d2e292be458cdbb25ca2ab9db42a04da30a496 Mon Sep 17 00:00:00 2001 From: Tevin <tingquanren@163.com> Date: Tue, 18 Mar 2025 10:25:32 +0800 Subject: [PATCH] 知识库规则文档调整 --- _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