更新密码找回uniapp

This commit is contained in:
hero920103 committed 2026-11-16 17:22:50 +08:00
1 parent 7f9a66da0f
commit 3fdda89833
1304 files changed
+3503 -26132

No files matched your search

-7
View File
@@ -2,18 +2,12 @@ package services
import "testing"
// 这些用例只覆盖权限模块中不依赖数据库的纯函数:角色 rights 解析。
// CheckUserPermission 需要查用户/角色/菜单表,属于集成测试范围,此处不覆盖。
func TestParseMenuRights(t *testing.T) {
cases := []struct {
name string
raw string
want []uint64
}{
// 规范格式:角色保存接口 json.Marshal([]uint64) 写回的数字数组。
// 曾经只按 []string 反序列化,整体失败后退化成逗号切分,
// 首尾元素带上 [ / ] 解析不出数字,第一个和最后一个菜单被静默丢弃。
{"数字数组", "[15,36,37,263]", []uint64{15, 36, 37, 263}},
{"单元素数组", "[7]", []uint64{7}},
{"字符串数组", `["15","36"]`, []uint64{15, 36}},
@@ -39,7 +33,6 @@ func TestParseMenuRights(t *testing.T) {
}
func TestParseMenuRightsKeepsBoundaryIDs(t *testing.T) {
// 单独锁住边界元素:丢首尾是线上真实出现过的故障表现(菜单页渲染成 404)
got := ParseMenuRights("[15,36,37,38,263]")
for _, id := range []uint64{15, 263} {
if !got[id] {