Commit Graph

44 Commits (71f00ffdfd4921cc84c65bca6c27cc3cf1324d02)

Author SHA1 Message Date
veypi bd5604a425 chore: bump version to v1.1.1 7 months ago
veypi e83444df4c refactor(models): Remove TableName methods and use global table prefix
- Add DB.Prefix "vb_" to cfg.DB config for global table prefix
    - Remove TableName() methods from all models (User, Role, Permission, etc.)
    - Remove Role.Scope field and its unique index with Code
    - Let GORM auto-generate table names with configured prefix
9 months ago
veypi a7ffd15601 refactor: Remove multi-tenant org system and simplify auth
- Delete org API endpoints (add_member, create, del, get, list, member, patch, tree)
    - Delete models/org.go and remove Org/OrgMember models
    - Delete org-related test files (org_crud, org_load_middleware, org_permission, multi_tenant)
    - Delete org test scripts (03_org_permission.sh, 04_org_load_middleware.sh)
    - Simplify auth/auth.go by removing org context and role loading logic
    - Remove org claims from JWT tokens and login/register responses
    - Redesign Permission model with hierarchical level-based access control
    - Add auth/design.md with new permission system specification
    - Update user and role APIs to work without org context
9 months ago
veypi df0f7f047a refactor: Rename Config to Global and simplify app initialization
- Rename cfg.Config to cfg.Global for consistency
    - Simplify cli/main.go to use vbase.App.Run() pattern
    - Update init.go to create app with vigo.New and Init function
    - Update all references from cfg.Config to cfg.Global across api, libs, models, and tests
    - Fix VBase constructor parameter order in ui/vbase.js
    - Update ui/env.js to use new VBase('vb', '/') initialization
9 months ago
veypi f7c4f1ee86 test: improve test stability and documentation
- Add 'clean_run.sh' script to reset database and restart server for clean test environment
    - Update 'README.md' with detailed troubleshooting guide and pitfalls
    - Add '04_org_load_middleware.sh' to test LoadOrg middleware functionality
    - Update 'run_all.sh' to include new middleware test
    - Fix BASE_URL handling in 'lib.sh' and test scripts to support custom environments
    - Update '02_resource_perm.sh' to fix admin permission checks
    - Remove debug logging from 'auth.go'
9 months ago
veypi 4a57017067 refactor(cfg): Restructure database configuration and initialization flow
- Replace separate DB/DSN fields with unified config.Database struct
    - Remove cfg/db.go and move DB client to config.Database.Client()
    - Update auth to use event-driven initialization via vb.init.auth event
    - Refactor models initialization to use event system (vb.init.settings/oauth/admin)
    - Update CLI to use event.Start() instead of manual InitDB() call
    - Fix auth_test.go to use new DB config structure
    - Update agents.md documentation with new CLI flags format
9 months ago
veypi 23c7f6cb7a refactor(auth): 重构认证系统,支持多种验证方式和 OAuth 提供商管理
- 新增验证模块(api/verification),统一处理短信和邮件验证码发送
    - 新增邮件发送功能(libs/email),支持 SMTP 协议
    - 重构短信模块(libs/sms),简化阿里云和腾讯云短信接口
    - 新增 OAuth 提供商管理 API(api/oauth/providers),支持 CRUD 操作
    - 新增系统设置管理 API(api/settings),支持动态配置更新
    - 重构认证方式管理(api/auth/methods),支持启用/禁用多种登录方式
    - 删除旧的 sms_providers 和 sms API 模块,迁移至新验证体系
    - 新增数据库模型:verification、email、oauth_provider、oauth_templates、setting
    - 更新配置文档,增加新功能的使用说明
9 months ago
veypi 33eabfa013 refactor(auth): 重构权限系统,简化API并添加缓存支持
主要变更:
- 将权限域从 appKey 改为 scope,权限ID格式为 scope:resource:action
- 新增 AddRole(roleCode, roleName, policies...) 方法,支持动态添加角色
- 简化 Factory.New() 只保留 scope 参数,移除 models.AppConfig 依赖
- PermAny/PermAll 改为变长参数 ...string 形式,使用更简洁
- AuthMiddleware 添加 Redis 缓存组织成员身份和角色信息(5分钟过期)
- 移除 models.AppConfig 和 models.RoleDefinition 结构体
- 更新测试和文档

BREAKING CHANGE: Factory.New() 签名变更,需要使用新的 AddRole API
9 months ago
veypi 37acea3420 feat: 实现组织成员角色管理功能 9 months ago
veypi 800d7fd4fd feat: 重构组织详情页UI和权限控制 9 months ago
veypi 178fa755d4 refactor: 重构认证模型和数据库结构 9 months ago
veypi 5daab97008 fix bug 9 months ago
veypi 8fa01c4c52 upgrade 9 months ago
veypi 52f2ae35ab upgrade new version 9 months ago
veypi 45708ca4f0 remove old 9 months ago
veypi 6d0ec8e6ba rename to vbase 10 months ago
veypi a74ccb104f update to new vigo version 10 months ago
veypi 1880a6ce0f update router params 10 months ago
veypi 95eccc2cde update 1 year ago
veypi 69b4b7c504 change vyes-ai 1 year ago
veypi 96acf05fb6 profile 1 year ago
veypi 1a29442c1c im dead 1 year ago
veypi e83f2da265 update crud and env.js 1 year ago
veypi a5339aa589 feat: oauth demo 1 year ago
veypi 959e390126 feat: change to vigo 1 year ago
veypi d472464d8a update 2 years ago
veypi 0e8ef78957 update cli 2 years ago
veypi 71924315b4 update access 2 years ago
veypi 6277ab0c4c feat: update app resouce 2 years ago
veypi 7e7e6ed506 feat: simplify user login 2 years ago
veypi 5112f1ab7d change to new version 2 years ago
veypi 17f81f6a2a del old file 3 years ago
veypi f9065abe55 update 5 years ago
veypi 5e341aeef5 对接oa 去掉用户 5 years ago
veypi 27d5008919 file component 5 years ago
veypi 5efcf47351 添加权限角色编辑 5 years ago
veypi 4afa6f345e 命名规则统一改为驼峰式 5 years ago
veypi aae799c7fa change name of pack, add oalib 5 years ago
veypi bcbfc0380a add user role auth page 5 years ago
veypi bc3f5e0b0c home 5 years ago
veypi c74c332e6a change vue2 to vue3 5 years ago
veypi 82b64a4bb2 用户加密机制设计初步完成 5 years ago
veypi cd7029c298 更新权限和用户模型 5 years ago
veypi 3d194e935d update 5 years ago