feat(userManagement): 添加用户上限 10 位校验

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
17792275749
2026-09-01 16:57:19 +08:00
co-authored by Claude Sonnet 4.6
parent b90c79df9f
commit 85523109f6
@@ -383,6 +383,10 @@ Page({
/** 添加用户 */ /** 添加用户 */
onTapAddUser() { onTapAddUser() {
if (this.data.memberCount >= 10) {
wx.showToast({ title: '最多添加10位用户', icon: 'none' })
return
}
const sn = targetDevice?.sn || '' const sn = targetDevice?.sn || ''
wx.navigateTo({ url: `/pages/addUser/addUser?sn=${encodeURIComponent(sn)}` }) wx.navigateTo({ url: `/pages/addUser/addUser?sn=${encodeURIComponent(sn)}` })
}, },
@@ -419,6 +423,10 @@ Page({
/** 一键添加本人:仅调接口把当前登录用户添加为设备成员,不下发设备 */ /** 一键添加本人:仅调接口把当前登录用户添加为设备成员,不下发设备 */
onTapAddSelf() { onTapAddSelf() {
if (this.data.memberCount >= 10) {
wx.showToast({ title: '最多添加10位用户', icon: 'none' })
return
}
const userInfo = wx.getStorageSync('userInfo') as Record<string, any> | null const userInfo = wx.getStorageSync('userInfo') as Record<string, any> | null
if (!userInfo?.userId) { if (!userInfo?.userId) {
wx.showToast({ title: '请先完善个人信息', icon: 'none' }) wx.showToast({ title: '请先完善个人信息', icon: 'none' })