
Security News
Inside Lodash’s Security Reset and Maintenance Reboot
Lodash 4.17.23 marks a security reset, with maintainers rebuilding governance and infrastructure to support long-term, sustainable maintenance.
@minidesign/formid
Advanced tools
如何突破模板消息的推送限制?
突破口:“1 次提交表单可下发 1 条,多次提交下发条数独立,相互不影响”
为了突破模板消息的推送限制,实现7天内任性推送,只需收集到足够的推送码,即每次提交表单时获取到的formId。一个formId代表着开发者有向当前用户推送模板消息的一次权限。
在客户端需要在一切可以点击的地方放置搜集点,使用:@minidesign/formid替代所有的点击事件节点。
- 从小程序基础库版本 2.2.1 或以上、及开发者工具 1.02.1808300 或以上开始,小程序支持使用 npm 安装第三方包
- 如果你的不支持,那么可以先下载下来,在手动拷贝到你的
components/formid文件夹下,在使用的细节上调整一下就行了。
npm install --save @minidesign/formid{
"usingComponents": {
"formid": "@minidesign/formid"
}
}
<formid bindclick="dosomething" class="your-class">xxx</formid>
统一一个地方app.js来收集formId,并保存到服务器,用于推送模板消息给用户。
App({
// ...
// minidesign config
minidesign() {
return {
log: true, // 是否打印执行日志
onGetFormId: formId => {
// 收集 form id 的地方
// Like: common.saveFormId(formId);
// 注意 一个 formId 的有效期暂为 7 天
}
};
}
});
class与stylebutton元素的class:btn-class="your-custom-button-class-name"form元素的class:form-class="your-custom-form-class-name"配置在app.js文件内的全局配置:
App({
// ...
// minidesign config
minidesign() {
return {
log: true, // 是否打印执行日志
onGetFormId: formId => {
// 收集 form id 的地方
// Like: common.saveFormId(formId);
// 注意 一个 formId 的有效期暂为 7 天
}
};
}
});
minidesign 应为一个返回object的方法。
log {Boolean} 是否打印执行日志onGetFormId {Function} 统一收集 formId 的地方,可以在这里设计保存formId的策略一般用户事件数据传输使用
<formid bindclick="dosomething" payload="{{somedata}}">Minidesign</formid>
可以取以下值(详见官方文档button的 open-type 有效值)
contact 打开客服会话,如果用户在会话中点击消息卡片后返回小程序,可以从 bindcontact 回调中获得具体信息,具体说明 1.1.0share 触发用户转发,使用前建议先阅读使用指引 1.2.0getUserInfo 获取用户信息,可以从 bindgetuserinfo 回调中获取到用户信息 1.3.0getPhoneNumber 获取用户手机号,可以从 bindgetphonenumber 回调中获取到用户信息,具体说明 1.2.0launchApp 打开 APP,可以通过 app-parameter 属性设定向 APP 传的参数具体说明 1.9.5openSetting 打开授权设置页 2.0.7feedback 打开“意见反馈”页面,用户可提交反馈内容并上传日志,开发者可以登录小程序管理后台后进入左侧菜单“客服反馈”页面获取到反馈内容 2.1.0扩展按钮长按功能,配置长按触发临界时间。
<formid
bindclick="dosomething"
payload="{{somedata}}"
longPressDuration="{{500}}"
bindtouch="ontouchstart"
bindcancel="ontouchcancel"
bindend="ontouchend"
>
Minidesign
</formid>
默认值 false
默认值false,为false时,事件将只能在引用组件的节点树上触发,不进入其他任何组件内部
默认值 false
<formid bindclick="dosomething" payload="{{somedata}}">Minidesign</formid>
Page({
dosomething({ detail }) {
const { event, payload } = detail;
// do something with event and payload.
}
});
默认值为当前标题
默认值为当前分享路径
默认值为截图
默认值为false
默认值为@minidesign/formid
FAQs
**如何突破模板消息的推送限制?**
We found that @minidesign/formid demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Lodash 4.17.23 marks a security reset, with maintainers rebuilding governance and infrastructure to support long-term, sustainable maintenance.

Security News
n8n led JavaScript Rising Stars 2025 by a wide margin, with workflow platforms seeing the largest growth across categories.

Security News
The U.S. government is rolling back software supply chain mandates, shifting from mandatory SBOMs and attestations to a risk-based approach.