
Security News
TeamPCP and BreachForums Launch $1,000 Contest for Supply Chain Attacks
TeamPCP and BreachForums are promoting a Shai-Hulud supply chain attack contest with a $1,000 prize for the biggest package compromise.
@tntd/user-status-modal
Advanced tools
noOperate长时间未操作;停留在页面(30分钟)后未进行任何页面操作(例如点击、滚动、鼠标移动)等,弹窗提示用户。multiUser多终端用户登录;当前账号在其他设备中登录,弹窗提示用户。npm install @tntd/user-status-modal --save
| 参数 | 作用 |
|---|---|
| lang | 国际化`cn |
| locale | 用于自定义语言包,支持覆盖默认语言包 |
| modalShowEvent | 显示弹窗时回调。结合当前业务:如果未传此回调方法但传dispatch函数,默认执行 dispatch({ type: "login/signOut" }); |
| modalCloseEvent | 关闭弹窗回调。结合当前业务:如果未传此回调方法但传dispatch函数,默认执行 dispatch({ type: "login/goLogin" }); |
| noOperateTime | 停留页面时间设置,noOperate场景中可按照实际情况设置,默认30分钟 |
| showModal | multiUser多终端登录时可以根据用户传递控制是否显示弹窗,默认弹窗 |
| childrenDom | 自定义弹窗内容 |
| closeModal | 子组件暴露closeModal方法可供调用方关闭弹窗 |
// 长时间未操作
<NoOperate
locale={createOtp({
cn: {
noOperateContent: 'No has realizado ninguna operación durante mucho tiempo, el sistema se ha cerrado automáticamente',
otherLoginContent: 'La cuenta actual está conectada en otros dispositivos',
warnMsg: 'Haz clic en aceptar para iniciar sesión nuevamente',
submit: 'Aceptar'
}
})}
lang="cn"
noOperateTime="100" // 静置时间
modalShowEvent={() => {
// 弹窗回调
console.log(1);
}}
modalCloseEvent={() => {
// 点击弹窗确定回调
console.log(2);
}}
ref={noOperateRef}
childrenDom={
<div>
<p>dsada</p>
<p>dsada</p>
<button
onClick={() => {
noOperateRef?.current?.closeModal();
}}>
hahah
</button>
</div>
}
/>;
// 多用户登录
<MultiUser
locale={createOtp({
cn: {
noOperateContent: 'No has realizado ninguna operación durante mucho tiempo, el sistema se ha cerrado automáticamente',
otherLoginContent: 'La cuenta actual está conectada en otros dispositivos',
warnMsg: 'Haz clic en aceptar para iniciar sesión nuevamente',
submit: 'Aceptar'
}
})}
lang="cn"
showModal={multiUserModal}
modalShowEvent={() => {
// 弹窗回调
console.log(1)
}}
modalCloseEvent={() => {
// 点击弹窗确定回调
console.log(2)
}}
/>
FAQs
We found that @tntd/user-status-modal demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 14 open source maintainers 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
TeamPCP and BreachForums are promoting a Shai-Hulud supply chain attack contest with a $1,000 prize for the biggest package compromise.

Security News
Packagist urges PHP projects to update Composer after a GitHub token format change exposed some GitHub Actions tokens in CI logs.

Research
GemStuffer abuses RubyGems as an exfiltration channel, packaging scraped UK council portal data into junk gems published from new accounts.