hailin
4957b2ef85
feat(genex-mobile): 重构为 Clean Architecture + Riverpod
...
- 添加 flutter_riverpod ^2.5.1 依赖
- 搭建 core/error/failures.dart 和 core/usecases/usecase.dart 基础骨架
- auth feature 完整 3 层重构:
- domain: AuthUser + AuthSession 实体, IAuthRepository 接口, 全套 UseCases
- data: AuthRepositoryImpl(Strangler Fig,委托给 AuthService 保留 token 刷新逻辑)
- presentation: AuthNotifier + authProvider + currentUserProvider + isAuthenticatedProvider
- 4 个 auth 页面升级为 ConsumerStatefulWidget,使用 ref.read(authProvider.notifier)
- main.dart: ProviderScope 包裹 GenexConsumerApp,改为 ConsumerStatefulWidget
- 桥接 AuthService ValueNotifier → Riverpod authProvider(会话过期自动导航)
- 12 个 feature 全部创建 Riverpod providers(FutureProvider/NotifierProvider)
- 修复 my_coupons_page.dart 中 EmptyState/StatusTags 缺少 BuildContext 的预存在错误
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-04 20:12:50 -08:00
hailin
332a8dafe8
fix(admin-web): 补回 AdminLayout useState import
...
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-04 19:20:05 -08:00
hailin
4feea2667c
refactor(admin-web): 实现 Clean Architecture + Zustand + Redux Toolkit
...
按要求重构架构,从扁平的 React Context + useState 升级为大厂标准模式:
Clean Architecture 分层:
domain/entities/ — 业务实体 (AdminUser/User/Issuer/AppVersion)
domain/repositories/ — Repository 接口(契约层)
infrastructure/http/ — HttpClient(替代旧 api-client.ts)
infrastructure/repositories/ — Repository 实现(AuthRepository/UserRepository)
状态管理(大厂混合模式):
Zustand useAuthStore — 轻量客户端状态:登录会话 + localStorage 持久化
Zustand useUIStore — UI 偏好:sidebar 折叠状态持久化
Redux uiSlice — 全局通知队列、globalLoading
Redux usersSlice — 用户列表筛选/分页 client state
React Query — 服务端数据 fetching/缓存(保留)
更新:
providers.tsx — 加入 Redux Provider,移除旧 AuthProvider
auth-context.tsx — 向下兼容层,re-export Zustand store
api-client.ts — 向下兼容层,re-export httpClient
AdminLayout.tsx — 使用 Zustand auth/ui store
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-04 19:18:20 -08:00
hailin
96dad278ea
fix(admin-web): 修复 React #310 — useState 必须在条件 return 前调用
...
根因:expandedKeys 的 useState 调用位于 "if (!isAuthenticated) return null"
之后,违反 Rules of Hooks。认证状态变化时 hooks 调用数量不一致,
React 报 #310 "Cannot update a component while rendering a different component"。
修复:将 activeKey 计算和 expandedKeys useState 全部移至条件 return 之前,
确保每次渲染 hooks 调用顺序完全一致。
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-04 19:05:34 -08:00
hailin
300d55ff14
fix(admin-web): 部署版本守卫,彻底防止 stale bundle 崩溃
...
方案:
- next.config.ts 构建时注入 NEXT_PUBLIC_BUILD_TIME 时间戳
- 新增 /api/version 路由,返回服务器当前 build 时间戳
- DeployGuard 组件每 3 分钟轮询 /api/version,
发现版本变化立即 window.location.reload(),用户完全无感知
- global-error / admin error 边界仅做最后兜底(静默 reload)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-04 18:57:12 -08:00
hailin
36b899d7ed
fix(admin-web): 简化错误边界为静默 reload,去掉多余 UI
...
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-04 18:55:19 -08:00
hailin
f642ef1d56
fix(admin-web): 添加 global-error.tsx 修复部署后 Server Action 崩溃
...
问题:每次重新部署容器后,浏览器持有旧 bundle,Next.js App Router
内部 Server Action ID("r"/"multi")与新服务器不匹配,导致客户端抛出
未捕获异常,触发全屏 "Application error"(周期性崩溃根因)。
修复:
- 添加 src/app/global-error.tsx(根级错误边界),检测到 stale bundle
相关错误时自动调用 window.location.reload(),无感知恢复
- 添加 src/app/(admin)/error.tsx(admin 路由段错误边界),同样自动刷新
- 两个边界均提供「立即刷新」「重试」按钮,防止极端情况下自动刷新失效
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-04 18:50:22 -08:00
hailin
4878449f8c
fix(genex-mobile): WXEntryActivity 完整转发微信回调 Intent
...
用 Intent(intent) 拷贝构造完整复制原始 Intent(action / data / extras),
再通过 setClass 重定向到 MainActivity,确保 fluwx 5.x 的
WXAPiHandler.handleIntent() 能读取到完整的微信授权回调内容。
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-04 18:05:01 -08:00
hailin
5d72d9bd0b
fix(genex-mobile): 修复 WXEntryActivity fluwx 5.x 编译错误
...
fluwx 5.x 将包名从 com.jarvanmo.fluwx 改为 com.jarvan.fluwx,
并移除了 WXEntryActivity 基类,导致编译报错:
Unresolved reference 'jarvanmo'
Cycle in supertypes detected
改为「中继(relay)」模式:
- WXEntryActivity 继承 Activity(不再继承 fluwx 基类)
- onCreate 时将微信回调 Intent extras 转发给 MainActivity
- fluwx 5.x 的 FluwxPlugin 实现了 PluginRegistry.NewIntentListener,
MainActivity.onNewIntent() 会触发 FluwxPlugin 解析微信回调
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-04 18:03:16 -08:00
hailin
828770add8
fix(alipay): 适配 tobias 5.x 新 auth API,后端生成签名 authString
...
tobias 3.x+ 移除了顶层函数 aliPayAuth(appId, scope),
改为需要后端预签名的 Tobias().auth(authString)。
变更:
- alipay.provider.ts: 新增 generateMobileAuthString(scope) 方法,
用 RSA2 私钥生成符合 Alipay SDK 格式的签名授权字符串
- auth.controller.ts: 新增 GET /auth/alipay/auth-string 接口
- pubspec.yaml: tobias ^3.0.0 → ^5.0.0
- auth_service.dart: 新增 getAlipayAuthString() 方法
- welcome_page.dart: 更新支付宝登录流程,先获取 authString 再调用 tobias
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-04 09:26:30 -08:00
hailin
a27baa1181
docs: 完善 fluwx 5.x 迁移与 AdminLayout 跳转备注
...
- main.dart: 说明 fluwx 5.x 实例共享机制与迁移前后对比
- welcome_page.dart: 说明 addSubscriber/NormalAuth/WeChatAuthResponse 用法,
以及 fluwx 3.x → 5.x API 对照
- AdminLayout.tsx: 说明 useEffect 跳转的原因(React #310 错误根因)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-04 09:00:18 -08:00
hailin
2e66db08ef
fix(genex-mobile): 升级 fluwx 3.x → 5.x,适配新版 API
...
fluwx 3.x 不含 Android namespace,导致新版 AGP 构建失败。
升级至 5.x 并迁移 API:
- registerWxApi → Fluwx().registerApi()
- weChatResponseEventHandler → fluwx.addSubscriber()
- sendWeChatAuth → fluwx.authBy(NormalAuth)
- isWeChatInstalled → fluwx.isWeChatInstalled
- WXAuthResp → WeChatAuthResponse
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-04 08:42:56 -08:00
hailin
7aea49a0c9
fix(admin-web): 修复 AdminLayout 渲染期间调用 router.replace 导致 React #310 错误
...
将未登录跳转逻辑从 render 函数移至 useEffect,
避免在渲染子组件时触发父组件状态更新。
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-04 05:43:58 -08:00
hailin
91f06890a5
docs(auth): 完善三方登录模块注释 — 含申请步骤与算法说明
...
AlipayProvider:
- callGateway: 补充完整请求参数结构说明
- sign: 详细说明 RSA2 签名5步骤(字典序→拼接→SHA256WithRSA→Base64)
- chunkBase64: 说明 PEM 格式每64字符换行要求
AppleProvider:
- verifyIdentityToken: 详细说明 claims 验证逻辑和签名验证原理
- getAppleJWKS: 说明 JWKS 缓存策略和 Apple 密钥轮换机制
- jwkToPublicKeyPem: 说明 JWK→SPKI PEM 转换过程
- base64urlDecode: 说明 Base64URL 与标准 Base64 的区别
GoogleProvider:
- verifyIdToken: 说明 tokeninfo vs JWKS 本地验证的权衡,补充响应字段说明
welcome_page.dart:
- 类头注释: 补充平台配置要求和各登录方式申请前提
- _onAlipayTap: 补充 tobias v3 API 结构、result 格式解析、scope 含义、iOS/Android 配置要求
- _parseParam: 说明 URI query 解析的原因
- _onGoogleTap: 补充 signIn 返回 null 的含义、idToken 说明、Android 配置
- _onAppleTap: 补充 Apple 3 项重要限制(姓名/邮箱只在首次授权时返回)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-04 04:56:11 -08:00
hailin
1fc0fcb95e
feat(auth): 支付宝 + Google + Apple 三方登录
...
后端 (auth-service):
- 新增 AlipayProvider (RSA2签名) + AlipayService + POST /auth/alipay
- 新增 GoogleProvider (tokeninfo验证) + GoogleService + POST /auth/google
- 新增 AppleProvider (JWKS验证ES256 JWT) + AppleService + POST /auth/apple
- SocialProvider 枚举新增 ALIPAY
- .env.example 补充三方登录申请步骤文档
Flutter (genex-mobile):
- pubspec.yaml: 新增 tobias / google_sign_in / sign_in_with_apple
- auth_service.dart: loginByAlipay / loginByGoogle / loginByApple
- welcome_page.dart: Android=微信+支付宝+Google, iOS=+Apple
- AndroidManifest: 添加支付宝包名查询
- Info.plist: 支付宝 URL Scheme + alipay/alipays queries
- i18n: 4 语言补充失败提示文案
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-04 04:40:31 -08:00
hailin
2790d4c226
fix(genex-mobile): Apple 登录按钮仅在 iOS 上显示
...
Apple Sign In 是 iOS/macOS 生态专属功能,Android 用户不存在
Apple ID 账号体系,不应在 Android 上展示该入口。
使用 defaultTargetPlatform == TargetPlatform.iOS 条件渲染:
- Android: WeChat + Google(2个按钮)
- iOS: WeChat + Google + Apple(3个按钮)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-04 04:21:34 -08:00
hailin
44de21a733
docs(auth): 完善微信登录模块注释 — 含申请移动应用完整步骤
...
wechat.provider.ts:
- 补充微信开放平台申请移动应用的完整流程(企业资质、创建应用、
获取 AppID/AppSecret、启用 unionid、获取 Android 签名 MD5)
- 说明常见 errcode 含义(40029/42003/40163)
- 安全注意事项(AppSecret 保密、服务端换 token、防重放建议)
wechat.service.ts:
- 完整业务流程注释(6步,含新老用户分支逻辑)
- unionid 优先策略原理(跨 App 唯一性,防重复注册)
- 每次登录同步微信信息说明
- 自动生成账号字段说明(nickname/email/phone/password/kycLevel)
.env.example:
- 微信开放平台申请步骤(注册/认证/创建/获取/启用 unionid)
- Android 签名 MD5 获取命令
- Flutter --dart-define 构建参数说明
- Universal Links 说明
WXEntryActivity.kt:
- 包名路径规范说明(applicationId vs namespace 区别)
- AndroidManifest 配置要求
- 回调未触发的排查步骤(签名/包名/debug包名)
- 获取 Android 签名 MD5 命令
main.dart:
- registerWxApi 传参说明(--dart-define 用法)
- 未配置 WECHAT_APP_ID 时的降级行为
- Universal Links 配置说明
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-04 04:04:26 -08:00
hailin
d68d48cb95
feat(auth): 微信登录 / 注册完整实现 — social_accounts + fluwx 全链路
...
后端:
- 新增 social_accounts 表 Entity/Repository/Migration (049)
- WechatProvider: code ↔ access_token / 获取用户信息 (native https)
- WechatService: unionid 优先查找 → 自动登录/注册 → 发布事件
- POST /auth/wechat 端点 (WechatLoginDto, referralCode 支持)
- auth.module.ts 注册 SocialAccount、WechatProvider、WechatService
Flutter (genex-mobile):
- pubspec.yaml: 添加 fluwx ^3.10.0
- main.dart: registerWxApi 初始化 (WECHAT_APP_ID via --dart-define)
- AuthService: loginByWechat(code, referralCode?, deviceInfo?)
- WelcomePage: 改为 StatefulWidget,监听 weChatResponseEventHandler
微信按钮触发 sendWeChatAuth,授权成功后自动登录 → /main
未安装微信 / 登录失败均有 SnackBar 提示
- 4语言 i18n: wechatNotInstalled / wechatLoginFailed
Android:
- AndroidManifest: WXEntryActivity + queries(com.tencent.mm)
- WXEntryActivity.kt: 继承 fluwx 提供的基类,无额外代码
- proguard-rules.pro: keep WeChat SDK 类
iOS:
- Info.plist: CFBundleURLTypes (wx${WECHAT_APP_ID}) + LSApplicationQueriesSchemes
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-04 03:37:51 -08:00
hailin
9473512530
feat(auth): 邮箱注册完整实现 — Gmail SMTP + 邮件验证码全链路
...
后端 (auth-service):
- 新增 EmailVerification / EmailLog 实体 + TypeORM 映射
- Email 值对象:格式校验、小写归一化、脱敏展示
- Gmail SMTP Provider (nodemailer) + ConsoleEmailProvider (dev)
- EmailCodeService:Redis 缓存快速路径,与 SmsCodeService 对称
- EmailService:sendCode/verifyCode + 日限额 + 业务规则校验
- 新增端点:POST /auth/email/send / register-email / login-email / reset-password-email
- EMAIL_ENABLED 环境变量切换真实/控制台发送
- 数据库迁移:048_create_email_verifications.sql
前端 (genex-mobile):
- AuthService 新增 sendEmailCode / registerByEmail / loginByEmail / resetPasswordByEmail
- RegisterPage 根据 isEmail 参数自动切换 SMS/Email API 调用
- WelcomePage 邮箱注册按钮传递 isEmail:true 参数
- i18n 新增 register.errorEmailRequired(4语种)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-04 02:27:43 -08:00
hailin
a893dbdb1b
feat(genex-mobile): Token 持久化 — 登录状态跨重启保持
...
## 核心变更
### 新增 SessionStorage (lib/core/storage/session_storage.dart)
- flutter_secure_storage 封装层
- Android: EncryptedSharedPreferences(AES-256,Android Keystore 托管密钥)
- iOS: Keychain(AccessibilityFirstUnlock)
- 存储键: genex_access_token / genex_refresh_token / genex_user_json
- API: save() / load() / updateTokens() / getRefreshToken() / clear()
### 升级 ApiClient (lib/core/network/api_client.dart)
- 新增 Dio 错误拦截器(_buildAuthInterceptor)
- 401 自动触发 Token 静默刷新,成功后无感重试原始请求
- Completer 并发锁:多个 401 同时发生只执行一次刷新,其余等待结果
- 跳过重试的端点:/auth/refresh、/auth/login、/auth/register 等
- configureAuthCallbacks():注册 onTokenRefreshed / onSessionExpired 反向回调
### 升级 AuthService (lib/core/services/auth_service.dart)
- _setAuth():登录/注册后 await 写入 SecureStorage
- _clearAuth():登出/Token 过期后 await 清除 SecureStorage
- restoreSession():App 冷启动时从 SecureStorage 恢复 Token + 注册 ApiClient 回调
- refreshToken():主动刷新(正常由拦截器自动触发,无需手动调用)
### 升级 main.dart
- await AuthService.instance.restoreSession() 在 runApp 前执行
- initialRoute 动态判断:isLoggedIn → '/main',否则 '/'
- 全局 NavigatorKey(_navigatorKey)挂载到 MaterialApp
- 监听 authState ValueNotifier:Token 过期后自动导航回 '/'(pushNamedAndRemoveUntil)
## 用户体验
- 登录后关闭 App 再打开:直接进主界面,无需重新登录
- Access Token 过期:ApiClient 自动静默刷新,用户无感知
- Refresh Token 过期:清除本地会话,跳回欢迎页,提示重新登录
- 主动登出:清除 SecureStorage,跳回欢迎页
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-04 02:01:27 -08:00
hailin
1c36c849e2
docs(genex-mobile): 完善邀请分享模块注释与说明
...
SharePage:
- 文件头注释:完整功能概述、支持的分享场景、数据来源、URL格式、依赖包说明
- 类注释:生命周期描述、Widget 树结构图(ASCII)
- 状态变量:详细说明 _info/_loading/_error/_baseInviteUrl
- _inviteLink:注释已加载/未加载两种输出示例
- _loadInfo:成功/失败两条路径说明
- _showCopied:SnackBar 样式描述
- _copyCode/_copyLink:示例复制内容
- _shareNative:iOS/Android 行为说明 + 文案模板示例
- _buildHeroCard:视觉层次注释 + QR 参数说明
- _buildStatsCard:布局描述 + 数据来源注释
- _buildShareActions:三项操作的点击行为说明
ReferralService:
- 文件头:完整端点一览、推荐码格式、推荐链规则
- ReferralInfo:字段含义 + 后端响应 JSON 示例
- getMyInfo:登录要求说明
- validateCode:用途说明 + 返回值降级策略
- getDirectReferrals:分页参数范围 + 响应 JSON 示例
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-04 01:42:47 -08:00
hailin
46d2404d19
feat(genex-mobile): 邀请好友 — 分享二维码页面全链路实现
...
- 新增 SharePage:推荐码 QR 码 + 邀请进度 + 一键复制/原生分享
- ProfilePage 添加「邀请好友」渐变横幅入口
- 新增 ReferralService(getMyInfo / getDirectReferrals)
- pubspec.yaml 引入 qr_flutter ^4.1.0、share_plus ^10.0.2
- 路由 /share 注册
- i18n:4 语言新增 share.* 共 20 个翻译键(zh-CN / zh-TW / en / ja)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-04 01:28:22 -08:00
hailin
0ecf295c35
feat(referral): 推荐服务全链路实现
...
Backend:
- referral-service: 全新微服务 (NestJS + DDD + Clean Architecture)
- ReferralProfile 聚合根 (TypeORM entity)
- ReferralCode / ReferralChain 值对象
- 仓储接口 + 实现
- ReferralService 应用服务: 创建档案/验证码/查询直推
- UserRegisteredHandler: 订阅 genex.user.registered Kafka 事件
- REST: GET /referral/my, GET /referral/validate, GET /referral/direct
- 内网: POST /internal/referral/profiles
- 端口 3013 (外部 4013)
- auth-service: RegisterDto 增加 referralCode 字段
- auth-service: UserRegisteredEvent 携带 referralCode
- auth-service: EventPublisherService 实际接入 Kafka (之前是 stub)
- migrations: 047_create_referral_profiles.sql
- docker-compose: 新增 referral-service 服务块
Frontend (genex-mobile):
- 注册页添加推荐码输入框 (可选),输入时实时验证推荐码有效性
- AuthService.register() 增加 referralCode 参数
- AuthService.validateReferralCode() 新增方法
- i18n: zh_CN/zh_TW/en/ja 各新增 4 个推荐码相关 key
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-04 00:58:28 -08:00
hailin
abb358100d
fix(genex-mobile): 还原 api.gogenex.com + 增加更新检测日志
...
.cn 域名因未 ICP 备案被 ISP 拦截,继续使用 api.gogenex.com (HK IP)。
增加 [UpdateService] 和 [VersionChecker] 详细日志便于调试。
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-03 23:17:12 -08:00
hailin
12a665f2ba
fix(genex-mobile): 升级服务改用 api.gogenex.cn — 国内网络更稳定
...
.com 域名指向 HK IP 在中国大陆部分网络解析失败,
改用 .cn 国内域名确保升级检查能正常访问。
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-03 22:55:04 -08:00
hailin
286e4d8886
fix(admin-service+mobile): 修复 OTA 下载三处 Bug
...
1. MinIO 内网 hostname 导致 redirect 失效
→ 改为 admin-service 直接流式代理传输文件(streamFile)
→ MinIO 仅绑 127.0.0.1:49000,不对外暴露
2. version_checker.dart 响应解析错误
→ API 返回 {"code":0,"data":{...}} 但代码误把外层 Map 当 VersionInfo
→ 现在正确提取 responseMap["data"] 内层对象
3. VersionInfo.fromJson 在 releaseDate=null 时崩溃
→ releaseDate 改为 nullable (DateTime?),null-safe 解析
→ 同步修复 version_checker.dart 拼接绝对 downloadUrl
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-03 22:19:10 -08:00
hailin
c6c434a07a
fix(update): 修复 app 版本更新检查路径 + 解决 MinIO presigned URL 24h 过期
...
Mobile 端:
- version_checker.dart: /api/app/... → /api/v1/app/... (与 Kong 路由匹配)
Backend (admin-service):
- AppVersion 实体新增 storage_key 字段(已执行 ALTER TABLE)
- FileStorageService: uploadFile 不再返回 presigned URL,只返回 objectName
- AdminVersionController: upload 后保存 storageKey,downloadUrl 设为
/api/v1/app/version/download/{id}(稳定 API 地址,不过期)
- AppVersionController.downloadVersion: storageKey 存在时每次请求动态
生成 presigned URL(1小时有效,只需够下载完成即可)
- AppVersionService.checkUpdate: 有 storageKey 的版本统一返回 API 下载地址
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-03 21:13:13 -08:00
hailin
50d6c77dfd
fix(i18n): 补全 en.dart 注册页缺失的6个 key
...
register.hasAccount / loginNow / errorPhoneRequired /
errorCodeInvalid / errorPasswordWeak / errorTermsRequired
在英文环境下均有对应译文,不再回退显示中文
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-03 20:55:07 -08:00
hailin
04a55e3e12
fix(ui): 修复登录页中英混用 + 搜索栏溢出,更新品牌口号并支持后台配置
...
- admin-web 登录页底部 "Genex 券金融平台" → "Genex 管理后台",风格统一
- admin-web 顶部搜索栏改为弹性宽度(width:100%/maxWidth:320),修复窄屏溢出
- 全平台品牌口号统一更新为"让每一张券,自由流动"
覆盖:genex-mobile(4语言) / miniapp(3语言) / portal(zh-CN/en-US)
- backend admin-system.service: getConfig() 新增 brandConfig 字段(4语言口号)
- admin-web 系统配置页新增品牌配置卡片:支持4语言口号在线编辑并保存
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-03 20:41:37 -08:00
hailin
e7c1e33355
fix(genex-mobile): 语言偏好持久化 — 用户选择不再因重启丢失
...
修复 LocaleManager 仅用内存 ValueNotifier 存储语言选择的问题,
重启 App 后用户选的语言会丢失,回退到系统语言。
改动:
- pubspec.yaml: 添加 shared_preferences 依赖
- locale_manager.dart: 新增 init() 启动恢复 + setLocale() 写入持久化
· null = 跟随系统语言(清除 SP 记录)
· 非 null = 持久化到 SharedPreferences,重启后自动恢复
- main.dart: 启动时调用 await LocaleManager.init()
- settings_page.dart: 语言选择改用 LocaleManager.setLocale()
行为:首次安装跟随系统语言 → 用户选择后持久化 → 重启保持不变
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-03 19:39:07 -08:00
hailin
0cd5c58ecb
feat(android): APK versionCode 自动递增 — 每次编译自增,各环境独立计数
...
参考 rwadurian mobile-app 的 version.properties 方案,为 genex-mobile
和 admin-app 添加 build 时 versionCode 自动 +1 逻辑:
- build.gradle.kts: calculateNextVersionCode() 读取 version.properties,
自增后写回;versionName 格式 "pubspec版本.buildNumber"(如 1.0.0.42)
- .gitignore: 排除 /android/app/version.properties,每个构建环境
(本机、CI、服务器)各自维护独立计数器,互不干扰
- 首次编译从 1 开始,后续跨日期持续递增,保证 APK 版本始终唯一
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-03 09:09:13 -08:00
hailin
c1681085b8
feat(admin): App 版本管理 — 多应用支持 + 管理后台页面
...
为 admin-service 添加 appType 维度,支持管理 genex-mobile (用户端)
和 admin-app (发行方管理端) 两个 Flutter 应用的版本发布。
同时在 admin-web 新增完整的版本管理页面。
### 后端改动 (admin-service)
数据模型:
- 新增 AppType 枚举: GENEX_MOBILE | ADMIN_APP
- app_versions 表添加 app_type 列 (VARCHAR(20), 默认 GENEX_MOBILE)
- 重建唯一索引: (app_type, platform, version_code)
- Migration 046: ALTER TABLE + 索引重建
DDD 各层更新:
- Repository 接口/实现: 所有查询方法增加 appType 参数
- Service: checkUpdate/listVersions/createVersion 支持按 appType 过滤
重复检测范围: 同一 appType + platform 内的 versionCode 唯一
- AdminVersionController:
- GET /admin/versions 增加 ?appType= 查询参数
- POST /admin/versions body 增加 appType 字段
- POST /admin/versions/upload body 增加 appType 字段
- AppVersionController (移动端):
- GET /app/version/check 增加 ?app_type= 参数 (默认 GENEX_MOBILE)
### 前端改动 (admin-web)
新增页面 /app-versions:
- App 选择器 Tab: Genex 用户端 / 发行方管理端
- 平台过滤器: 全部 / Android / iOS
- 版本列表表格: 版本号、代码、平台、构建号、文件大小、强制更新、状态、发布日期
- 操作列: 编辑 / 启用|禁用 / 删除
- 上传对话框: 文件选择 → 自动解析包信息 → 填写表单 → 上传到 MinIO
- 编辑对话框: 更新日志、最低系统版本、强制更新、启用状态
- i18n: zh-CN / en-US / ja-JP 各 28 个新翻译键
- 侧边栏: 在「系统管理」前增加「📱 应用版本」菜单项
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-03 06:09:55 -08:00
hailin
bd6ecaa0fd
feat(portal): Genex 门户官网 — 20 页 Next.js SSG 站点
...
新增 frontend/portal/ 独立 Next.js 15 应用,作为 gogenex.com 品牌官网。
页面清单 (20 pages):
- 首页 (/) — Hero + 数据看板 + 三大优势 + 产品展示 + 信任背书 + CTA
- 关于我们 (/about) — 愿景 + 团队 + 里程碑时间线 (2025 Q1 起)
- 产品功能 (/features) — 购券流程 + 交易 + 清算 + 多端支持
- 解决方案 (/solutions) — 消费者/商户场景 + 用例故事
- 开发者 (/developers) — API 文档入口 + SDK + 区块链浏览器
- 联系我们 (/contact) — 联系表单 + 地址 + 社交
- 下载 (/download) — iOS/Android/Web/小程序 四端下载
- 职位招聘 (/careers) — 6 个岗位卡片
- 博客 (/blog) — 6 篇文章摘要
- 新闻稿 (/press) — 3 篇新闻发布
- 帮助中心 (/help) — 6 大帮助主题
- 社区 (/community) — 6 个社交渠道卡片
- 系统状态 (/status) — 6 项服务运行状态
- 服务条款 (/terms) — 完整法律条款
- 隐私政策 (/privacy) — 完整隐私声明
- Cookie 政策 (/cookie-policy)
- 风险披露 (/risk)
技术栈:
- Next.js 15 + React 18 + TypeScript + CSS Modules
- Framer Motion 滚动动画
- 复用 admin-web design-tokens.css 变量体系
- 完整 i18n (zh-CN / en-US, 800+ 翻译键)
- Docker 多阶段构建 + Nginx 反向代理配置
- SSG 静态生成,SEO 友好
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-03 05:03:53 -08:00
hailin
34b85f68ae
feat(admin-web): 登录页 + Auth Guard + API URL 切换域名
...
- 新建 /login 页面(邮箱/密码登录,对接 auth-context)
- AdminLayout 添加 auth guard:未登录自动跳转 /login
- api-client 默认 URL 从 localhost:8080 → https://api.gogenex.com
- Header 头像显示用户首字母,点击登出
- i18n 补充 header_logout (zh/en/ja)
API 联通验证(全部正常):
- POST /api/v1/auth/sms/send → 400 (手机号未注册)
- POST /api/v1/auth/login → 401 (密码错误)
- POST /api/v1/auth/register → 400 (验证码过期)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-02 02:57:45 -08:00
hailin
535f53041f
feat(deploy): Nginx反向代理 + SSL + 前端切换域名
...
部署架构:
- Nginx (跳板机 14.215.128.96) → Kong (192.168.1.222:48080)
- SSL: Let's Encrypt 证书已为 api.gogenex.com 签发
- HTTP 自动 301 → HTTPS
前端 API 地址:
- genex-mobile: https://api.gogenex.com (ApiClient + UpdateService)
- miniapp: https://api.gogenex.com (development config)
- 备案完成后切回 https://api.gogenex.cn
Namecheap DNS 新增:
- admin.gogenex.com → 154.84.135.121
- ws.gogenex.com → 154.84.135.121
备注:
- gogenex.cn 的 80/443 端口被世纪互联 ISP 拦截,需完成 ICP 备案
- admin/ws 子域名的 SSL 证书待 DNS 传播后申请
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-02 00:00:58 -08:00
hailin
8ed667bcf4
feat(联调): 前端指向远程API + 启用阿里云SMS
...
- genex-mobile ApiClient/UpdateService 指向 154.84.135.121:48080
- miniapp dev 环境指向 154.84.135.121:48080
- docker-compose 添加 ALIYUN SMS 环境变量透传
- auth-service 添加 @alicloud/dysmsapi20170525 等 SDK 依赖
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-24 00:18:05 -08:00
hailin
24400ad663
fix(admin-app): 消除UI层硬编码中文,补充i18n keys(zh/en/ja)
...
- 新增 29 个 i18n keys 到三语言文件(credit_score_unit, finance_confirm_withdraw,
redemption_failed, store_no_stores, settings_confirm_logout, coupon_status_* 等)
- 修复 10 个页面中的硬编码中文字符串:
credit_page: 分数单位、权重、空状态
finance_page: 提现对话框、SnackBar、时间格式、空状态
redemption_page: 错误消息、批量结果、空状态、时间格式
store_management_page: 门店/员工空状态
settings_page: 退出确认对话框、层级权益描述
coupon_list_page: 状态徽章(在售/待审/售罄/下架)
coupon_detail_page: 面值/发行价标签
ai_agent_page: 错误回复消息
issuer_dashboard_page: 信用分单位
- 剩余中文仅存于 /// 注释和 mock 数据数组中(将被真实API数据替换)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 23:29:10 -08:00
hailin
d9b07537a1
fix(admin-web): MarketMakerPage useApiMutation 方法名大写
...
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 22:21:42 -08:00
hailin
e8d9bdc2fb
fix(api): 修复前后端 API 对接 — 响应结构+字段名对齐
...
端到端审查发现并修复 4 类前后端不匹配问题:
## 1. 响应结构嵌套不匹配
后端返回 `{ data: { user, tokens: { accessToken, refreshToken } } }`
但 miniapp/admin-app/admin-web 均按扁平结构解析
- miniapp services/auth.ts: 新增 AuthResponse→LoginResult 映射层
- miniapp store/auth.ts: 从 `resp.tokens.accessToken` 取 token
- admin-app auth_service.dart: LoginResult.fromJson 优先从 tokens 子对象取
- admin-web auth-context.tsx: 从 `result.tokens.accessToken` 取 token
## 2. 密码登录字段名不匹配
后端 LoginDto 字段为 `identifier`, 但 admin-app 发 `email`, admin-web 发 `email`
- admin-app: `'email' → 'identifier'`
- admin-web: `{ email, password } → { identifier: email, password }`
## 3. 注册 password 字段必填 vs 前端可选
miniapp h5-register 只收集手机+验证码, 不传 password, 会触发 400 校验
- backend RegisterDto: password 改为 @IsOptional
- auth.service.ts: 未传 password 时自动生成随机密码
## 4. miniapp LoginResult 类型导出
- 导出 LoginResult 接口供外部使用
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 21:39:26 -08:00
hailin
7d00cade2f
fix(i18n): 清除前端页面中残留的硬编码中文
...
问题: 在英文/日文语言环境下,部分页面仍显示中文字符
修复内容:
## genex-mobile
- register_page.dart: `const TextSpan(text: ' 和 ')` → `context.t('register.and')`
- 4 语言文件新增 `register.and` key (和/和/and/および)
## miniapp
- login + h5-register: 移除 Toast fallback 中文 (`|| '验证码已发送'` 等)
- login + h5-register: 移除 JSX 中硬编码的《》书名号,改为 i18n 值内包含
· zh-CN: `《用户协议》`、`《隐私政策》`
· en-US: `User Agreement`、`Privacy Policy` (无括号)
· ja-JP: `「利用規約」`、`「プライバシーポリシー」`
- ai-guide 组件: 4 个推荐标签从硬编码改为 `t('ai_recommend_N')`
· 新增 12 个 i18n key (3 语言 × 4 标签)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 21:27:24 -08:00
hailin
e59c0d0527
feat(admin): SMS 管理后台 — admin 端点 + 用户管理增强 + SMS 日志页
...
Phase 8: admin-web 后台管理增强
## 后端 (auth-service)
- 新增 AdminSmsController (JWT 保护):
· GET /admin/sms/logs — 按手机号查询 SMS 发送日志
· GET /admin/sms/logs/user/:id — 按用户 ID 查询其 SMS 日志
· POST /admin/sms/unlock/:id — 手动解锁账号(清除 loginFailCount + lockedUntil)
· 手机号脱敏: 138****5678 格式
- auth.module.ts 注册 AdminSmsController
## 前端 (admin-web)
- UserManagementPage 增强:
· 新增状态列: 正常(绿) / 已冻结(红) / 已锁定(黄)
· 手机号自动掩码显示
· 冻结/解冻按钮根据状态切换
· 锁定用户显示"解锁"按钮
- 新增 SMS 日志查看页面 (SmsLogPage):
· 按手机号搜索 SMS 发送记录
· 类型、状态 badge 展示
· 路由: /users/sms-logs
- AdminLayout 侧边栏新增 "SMS 日志" 导航项
- i18n 补充 (zh-CN/en-US/ja-JP):
· 用户状态: user_active, user_frozen, user_locked, user_unlock
· SMS 日志: 17 个新 key (sms_log_*, sms_type_*, sms_status_*, nav_users_sms_logs)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 20:34:15 -08:00
hailin
c29067eee7
feat(miniapp+admin-app): 同步 SMS 认证 API 变更
...
Phase 7 — Taro miniapp + admin-app 前端同步后端 SMS 认证系统:
miniapp (Taro/React):
- auth.ts: 新增 SmsCodeType 类型,sendSmsCode 支持 type 参数
· 端点从 /auth/send-sms-code → /auth/sms/send
· 新增 loginByPassword / resetPassword API
· register 支持 password + nickname 可选参数
- store/auth.ts: sendSmsCode 同步 type 参数 + 新端点
- login/index.tsx: 发送验证码时指定 type='LOGIN'
- h5-register/index.tsx: 发送验证码时指定 type='REGISTER'
· 修复注册后 token 存储使用 config.TOKEN_KEY 而非硬编码
- i18n: 3语言新增 7 key (login_code_sent, login_error_*,
register_success, register_error_agree)
admin-app (Flutter):
- auth_service.dart: 新增 SmsCodeType 枚举
· sendSmsCode 支持 type 参数,端点同步 /auth/sms/send
· 返回 expiresIn (秒)
- issuer_login_page.dart: 发送验证码时指定 SmsCodeType.login
- i18n: 3语言新增 4 key (login_error_phone, login_error_code,
login_error_network, login_code_sent)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 20:24:47 -08:00
hailin
4b1cdf9fb3
feat(genex-mobile): Flutter 前端对接 SMS 认证 API
...
Phase 6 — Flutter 前端完整对接后端 SMS 认证系统:
新增组件:
- OtpInput: 6位验证码输入框,支持自动跳转、粘贴、错误状态
- CountdownButton: 短信验证码倒计时按钮(60s),发送失败不启动倒计时
新增服务:
- AuthService: 单例认证服务,封装全部 auth API
· sendSmsCode (REGISTER/LOGIN/RESET_PASSWORD/CHANGE_PHONE)
· register / loginByPassword / loginByPhone
· resetPassword / changePassword / changePhone
· refreshToken / logout
· ValueNotifier<AuthResult?> 状态管理
页面重写 (对接真实 API):
- LoginPage: 双 Tab (密码/验证码登录),错误提示 Banner,账户锁定展示
- RegisterPage: 三步注册流程,CountdownButton 集成,密码强度检查
- ForgotPasswordPage: 四步找回密码,验证码重发,密码一致性校验
i18n 补充 (4语言 × 13 新 key):
- login: noAccount, registerNow, networkError, errorPhoneRequired,
errorPasswordMin, errorCodeInvalid
- register: hasAccount, loginNow, errorPhoneRequired, errorCodeInvalid,
errorPasswordWeak, errorTermsRequired
- forgot: errorPasswordMismatch
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 19:23:25 -08:00
hailin
2ff8b48e50
fix(branding): 统一Logo色调与App主色调 #6C5CE7
...
旧Logo用 #9B5CF6/#D946EF 紫粉渐变,与App主色 #6C5CE7 不一致。
现统一为 Left=#6C5CE7→#7B6DEE, Right=#9B8FFF→#B8ADFF。
- 更新源SVG (genex-icon/lockup) 渐变色
- 重新生成PNG并分发至全部5个前端应用
- 修正 welcome_page EX ShaderMask 渐变色
- 替换 miniapp share-card 硬编码旧色值
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 18:12:35 -08:00
hailin
4682229a8c
fix(welcome): 品牌名严格遵循 lockup 设计规范
...
按 genex-lockup.svg 规范修正品牌名渲染:
- "GEN" = 深色 #1A103A (solid)
- "EX" = 渐变 #D946EF → #E11D89 (ShaderMask)
- fontWeight: 800, letterSpacing: -0.3
之前错误地将整个"Genex"做成全渐变,不符合品牌 VI。
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 17:18:17 -08:00
hailin
9d7a5a7266
fix(welcome): 修复欢迎页3个设计问题
...
1. Logo色与主色调不一致 — 品牌名"Genex"改用 ShaderMask 渐变
(#9B5CF6→#D946EF),与 logo icon 色系完全匹配
2. Logo到品牌名间距过大 — 24px → 12px,品牌名到slogan 8px → 6px
符合 8pt grid 美学标准(紧凑型视觉组 4-8-12px)
3. 缺少微信登录 — 新增 WeChat 社交登录按钮(绿色#07C160),
4语言i18n key: welcome.wechat
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 17:12:49 -08:00
hailin
3aeb0885a0
fix(android): 启用 core library desugaring — 修复 flutter_local_notifications 构建失败
...
flutter_local_notifications 插件需要 Java 8+ API desugaring 支持。
在 build.gradle.kts 中启用 isCoreLibraryDesugaringEnabled 并添加
desugar_jdk_libs:2.1.4 依赖。
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 17:00:46 -08:00
hailin
a92f00af25
feat(branding+fix): 中文品牌名、miniapp logo资源、编译错误修复
...
## 中文品牌名更新
- admin-app: 中文环境下 app_name → "企业券信",login_title/ai_welcome/settings_about 同步更新
- miniapp: 中文环境下 app_name → "券信",6处内联文本(share/activity/register/ai_chat等)同步更新
- genex-mobile: zh_cn + zh_tw 共12处 "Genex" → "券信"(login/register/aiChat/profile/aiFab)
- 英文/日文环境保持 "Genex" 不变
## miniapp logo 资源集成
- 新增 src/assets/images/ 目录:logo.png, logo_icon.png, logo_icon.svg, logo_full.svg
- login 页:CSS模拟logo(.logo-left/.logo-right) → <image src={logoIcon}>
- h5-share 页:💎 emoji → <img src={logoIcon}> (header + RegisterGuidePage)
- h5-activity 页:"G" 文字方块 → <image src={logoIcon}> (footer)
- h5-register 页:"G" 文字方块 → <image src={logoIcon}> (branding section)
## genex-mobile 编译错误修复
- wallet_coupons_page: EmptyState.noCoupons() + StatusTags.active/pending/expired/used() 添加 context 参数
- trading_page: StatusTags.onSale/completed/cancelled() 添加 context 参数
- message_page: EmptyState.noMessages() 添加 context 参数
- coupon_service: inner['total'] 添加 `as int?` 显式类型转换
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 16:57:30 -08:00
hailin
3a57b0fd4d
feat: 全平台API对齐 — 4个前端应用55+页面接入真实后端API
...
跨越 genex-mobile、admin-app、admin-web、miniapp 四个前端应用,
将所有页面从 mock 硬编码数据替换为真实后端 API 调用,
同时补建后端缺失的 27+ 个端点,实现前后端完整联通。
## 后端新增 (4个微服务, 27+端点)
### issuer-service — 5个新Controller, 19个新文件
- IssuerStatsController: GET /issuers/me/stats, /credit (发行商仪表盘统计+信用)
- IssuerFinanceController: GET/POST balance/stats/transactions/withdraw/reconciliation
- IssuerStoreController: CRUD /issuers/me/stores + /employees (门店+员工管理)
- RedemptionController: POST scan/manual/batch, GET history/today-stats (核销)
- CouponBatchController: POST issue/recall/price-adjust, GET operations (批量操作)
- CouponController扩展: GET /search, /:id/nearby-stores, /:id/similar
- 新实体: Employee, Redemption; Store 增加 level/parentId
- 新迁移: 032_create_stores_employees_redemptions.sql
### trading-service (Go)
- GET /api/v1/trades/my/orders — 用户订单列表(分页+状态筛选)
- POST /api/v1/trades/coupons/:id/transfer — 券转赠
### user-service
- GET/PUT /api/v1/users/me/settings — 用户偏好设置(语言/货币/通知)
### auth-service
- POST /api/v1/auth/send-sms-code — 发送短信验证码(Redis存储, 5分钟TTL)
- POST /api/v1/auth/login-phone — 手机号+验证码登录(自动注册)
### Kong 路由
- 新增5条路由: issuers/me, redemptions, coupons/batch, trades/my, trades/coupons
## genex-mobile (Flutter, 2页)
- HomePage: 接入 CouponApiService.getFeaturedCoupons() + getHoldingsSummary()
- WalletCouponsPage: 接入持仓列表API, 支持Tab状态筛选
- 修复 NotificationService/PushService 7+2个路径缺少 /api/v1/ 前缀
- 新增 CouponApiService, CouponModel, HoldingsSummaryModel
## admin-app (Flutter发行商控制台, 11页 + router + i18n)
- 修复 NotificationService 7个路径 + PushService 2个路径前缀
- 新增9个Service: auth, issuer, coupon, finance, credit, store, redemption, analytics, ai_chat
- 11页全部从 StatelessWidget→StatefulWidget, mock→API:
IssuerLoginPage(SMS登录), Dashboard(统计), CouponList(分页+筛选),
CreateCoupon(提交审核), CouponDetail(详情), Redemption(扫码/手动/批量核销),
Finance(余额/流水/对账), Credit(评分), StoreManagement(门店+员工),
AiAgent(真实AI对话), Settings(资料+登出)
- 所有页面添加 loading/error/pull-to-refresh 状态
## admin-web (Next.js 15管理后台, 24页)
- 新建API基础设施: api-client.ts(axios), auth-context.tsx, use-api.ts(react-query)
- providers.tsx 接入 QueryClientProvider + AuthProvider
- 24页全部替换 useState(mockArray) 为 useApi<T>('/api/v1/admin/...'):
Dashboard, Users, Issuers, Coupons, Trading, Risk, Finance, System,
Compliance(SAR/SEC/License/SOX/Tax/IPO), Analytics(User/Coupon/MM/Consumer),
Disputes, Chain, Reports, Merchant, Agent, Insurance
- 所有页面添加 TypeScript 接口, loading/error 状态, 'use client' 指令
- 状态比较改用原始API字符串(非t()翻译值)
## miniapp (Taro/React小程序, 20页)
- 新建API基础设施: config/index.ts, utils/request.ts(Taro.request封装), store/auth.ts
- 新增8个Service: auth, coupon, my-coupon, user, trading, wallet, notification, ai
- 20页全部替换硬编码数据为Service调用:
Home, Search, Detail, Purchase, PaymentSuccess,
MyCoupons, MyCouponDetail, Redeem, Transfer,
Profile, Orders, Messages, Wallet, Settings, KYC, AIChat,
Login, H5Share, H5Activity, H5Register
- 统一 useState+useEffect 数据获取模式, 错误处理, 加载状态
## 统计
- 新建文件: ~51个 (后端26 + 前端25)
- 修改文件: ~93个 (后端24 + 前端69)
- 新增后端端点: 27+
- 前端页面接入API: 55+ (genex-mobile 2 + admin-app 11 + admin-web 24 + miniapp 20)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-22 22:53:07 -08:00
hailin
e44e052efa
fix(branding): 重新生成全平台图标 — 基于更新后的Logo SVG v2
...
## 变更
- genex-icon.svg: viewBox 72→100, 去除圆角路径, 调整notch半径和形状尺寸
- genex-04.svg → genex-lockup.svg: 重命名, 缩放0.7x, viewBox 380→200
## 重新生成的资源 (80+ 文件)
- 3 Flutter apps × (5 Android mipmap + 15 iOS AppIcon + 3 LaunchImage + 2 assets)
- admin-web: favicon.ico/png, logo.png, logo_icon.png, icon-512.png, SVG源文件
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-22 08:00:19 -08:00
hailin
295ebcdac7
feat(branding): 全平台品牌Logo替换 — 新双色渐变券印标识
...
## 概述
将全平台(5个前端应用)的品牌Logo从旧版钻石图标统一替换为新设计的
双色渐变券印标识(紫色#9B5CF6 + 品红#D946EF),体现券金融平台定位。
## 新Logo资源
- logo/genex-icon.svg: 纯图标(72x72),用于App图标和favicon
- logo/genex-04.svg: 带品牌名(380x72),用于启动画面和品牌展示
## 替换范围
### Flutter Apps(genex-mobile / admin-app / mobile)
- Android: 5个密度mipmap ic_launcher.png (48~192px)
- iOS: 15个AppIcon尺寸 (20~1024px) + 3个LaunchImage尺寸
- assets/images/: 新增 logo.png(760x144) + logo_icon.png(192x192)
- pubspec.yaml: 新增 assets 声明
- welcome_page.dart: Icons.diamond_rounded → Image.asset('logo_icon.png')
- issuer_login_page.dart: Icons.storefront_rounded → Image.asset('logo_icon.png')
- issuer_dashboard_page.dart: 同上
- settings_page.dart: 同上
### admin-web(Next.js 15)
- public/: favicon.ico/png, logo.png, logo_icon.png, icon-512.png, SVG源文件
- layout.tsx: 更新metadata icons配置
- AdminLayout.tsx: 侧栏inline "G"文字 → <img src="/logo_icon.png">
### miniapp(Taro/React 小程序)
- login/index.tsx: "G"文字Logo → CSS双色分割旋转方块
- share-card/index.tsx: 同上 + 品牌色从#6C5CE7更新为#9B5CF6/#D946EF
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-22 04:07:46 -08:00
hailin
184a7d16db
feat: 三端集成 App升级 + 内部推送 + FCM外部推送框架 (genex-mobile/admin-app/mobile)
...
从 rwadurian/frontend/mobile-app 移植升级系统和通知系统到 Genex 三个 Flutter 客户端,
适配目标项目轻量架构(ValueNotifier 替代 Riverpod,Dio HTTP 客户端,移除 screenutil)。
## 新增核心模块 (每个 app 13 个 Dart 文件)
### 升级系统 (core/updater/)
- UpdateService: 统一升级服务单例,支持 Google Play + 自建服务器双渠道
- VersionChecker: 版本检测器,调用 GET /api/app/version/check
- DownloadManager: APK 下载管理,支持断点续传 + SHA256 校验
- ApkInstaller: APK 安装器 (Platform Channel)
- AppMarketDetector: 应用市场来源检测
- SelfHostedUpdater: 自建服务器渠道更新对话框 (i18n 化)
- GooglePlayUpdater: Google Play 应用内更新
### 通知系统 (core/services/ + core/providers/)
- NotificationService: 通知 + 公告 API 服务
- GET /notifications, /notifications/unread-count
- PUT /notifications/:id/read
- GET /announcements, /announcements/unread-count
- PUT /announcements/:id/read, /announcements/read-all
- NotificationBadgeManager: 未读徽章管理器
- ValueNotifier<int> 驱动 UI
- 30秒定时自动刷新 + 前后台切换刷新 (WidgetsBindingObserver)
### FCM 推送框架 (core/push/)
- PushService: Firebase 推送服务框架
- Firebase 代码注释保护,无配置文件时静默跳过
- 设备 token 注册 POST /device-tokens
- 待 Firebase 配置文件就绪后取消注释即可启用
### HTTP 客户端 (core/network/)
- ApiClient: Dio 封装单例,baseUrl = https://api.gogenex.cn
## Android 原生配置 (每个 app)
- AndroidManifest.xml: 添加 REQUEST_INSTALL_PACKAGES 权限 + FileProvider
- res/xml/file_paths.xml: FileProvider 路径配置
- MainActivity.kt: APK 安装器 + 应用市场检测 MethodChannel
## UI 层改造 (每个 app)
- main.dart: 异步启动,初始化 UpdateService/PushService/NotificationBadgeManager
- MainShell: 消息 Tab 徽章改为 ValueListenableBuilder 动态未读数,进入后 3 秒检查更新
- SettingsPage: StatefulWidget 化,动态版本号 (PackageInfo),点击版本号手动检查更新
- MessagePage: 移除 mock 数据,接入 NotificationService API,4 Tab 分类 + 下拉刷新 + 标记已读
## i18n 新增 (~35 keys/语言)
- update.*: 25 个升级相关 keys
- notification.*: 9 个通知相关 keys
- genex-mobile: 4 语言 (zh_CN/zh_TW/en/ja) 分文件
- admin-app: 3 语言 (zh_CN/en_US/ja_JP) 内联单文件
- mobile: 4 语言 (zh_CN/zh_TW/en/ja) 分文件
## 三端差异化配置
| App | MethodChannel 前缀 | applicationId |
|-----|-------------------|---------------|
| genex-mobile | cn.gogenex.consumer | cn.gogenex.consumer |
| admin-app | cn.gogenex.issuer | cn.gogenex.issuer |
| mobile | cn.gogenex.mobile | cn.gogenex.mobile |
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 07:02:14 -08:00
hailin
4da8a373f2
refactor: 全项目清除MVP字样,统一为正式系统用语
...
## 变更范围:21个文件,覆盖全栈
### SRS需求文档 (4个文件,20处修改)
docs/券金融平台-软件需求规格.md (7处):
- "MVP策略" → "运营策略"/"合规策略"
- "MVP阶段GNX不上交易所" → "Phase 1阶段GNX不上交易所"
- "MVP同步" → "同步发布"
- "MVP阶段优先级" → "阶段优先级"
- "Phase 1(MVP)" → "Phase 1(基础平台)"
- "基础发行与交易(MVP,仅Utility Track)" → "基础发行与交易(仅Utility Track)"
docs/券金融平台-需求规格综合评估报告.md (4处):
- "MVP分期" → "阶段分期"
- "MVP回避策略" → "合规回避策略"
- "MVP仅Utility Track" → "Phase 1仅Utility Track"
docs/闲券交易平台-架构开发需求.md (4处):
- "MVP阶段只开放" → "当前阶段只开放"
- "Phase 1(MVP)" → "Phase 1(基础平台)"
- "基础平台(MVP,仅Utility Track)" → "基础平台(仅Utility Track)"
docs/闲券平台-软件开发需求.md (5处):
- "MVP阶段用户不接触" → "当前阶段用户不接触"
- "MVP策略" → "运营策略"
- "Phase 1(MVP)" → "Phase 1(基础平台)"
- "Phase 1 — MVP" → "Phase 1 — 基础平台"
### 后端服务代码 (7个文件,13处修改)
trading-service (Go):
- admin_trade_handler.go: 3处 "for MVP"/"In MVP" 注释清除
- admin_mm_handler.go: 2处 "In MVP"/"for MVP" 注释清除
chain-indexer (Go):
- admin_chain_handler.go: 1处 "for MVP" 注释清除
compliance-service (NestJS):
- admin-compliance.service.ts: 3处 "(mock for MVP)" 注释清除
issuer-service (NestJS):
- admin-issuer.service.ts: 1处 "For MVP" 注释清除
- admin-merchant.service.ts: 2处 "For MVP" 注释清除
notification-service (NestJS):
- event-consumer.service.ts: 1处 "In MVP" 注释清除
### 前端代码 (10个文件)
mobile (5个文件):
- i18n: en/zh_cn/zh_tw/ja 4语言 "MVP版本仅支持" → "当前仅支持"
- i18n key: proMode.mvpNote → proMode.trackNote
- pro_mode_page.dart: 更新key引用
genex-mobile (5个文件):
- 同mobile,4语言+1页面引用全部更新
### 验证结果
全项目grep (?i)\bMVP\b = 0 matches,彻底清除完毕
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-12 18:13:47 -08:00
hailin
c58b2df728
feat: 小程序功能移植,新增12页面+160 i18n keys,覆盖率提升至~70%
...
新增页面:search, purchase(重写), payment-success, my-coupon-detail,
transfer, ai-chat, orders(重写), messages, wallet(只读), settings, kyc
增强:detail页新增附近门店和相似好券模块
导航:首页搜索→search, 券卡→detail→purchase, 我的券→my-coupon-detail,
个人中心菜单→wallet/messages/ai-chat/settings/kyc
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-12 04:16:33 -08:00
hailin
3cdb6a5eb9
feat: 全部前端项目完成国际化(i18n),支持中/英/日三语言
...
- miniapp (Taro/React): 11个页面/组件,~300翻译键
- admin-app (Flutter): 19个页面,475翻译键 (zh_CN/en_US/ja_JP)
- admin-web (Next.js): 25个视图+布局,2000+翻译键
- mobile (Flutter): 33+页面/组件,686翻译键 (zh_CN/zh_TW/en/ja)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-12 03:45:37 -08:00
hailin
5bc1cbe4d8
feat: 完成全量国际化(i18n),支持简中/繁中/英文/日文四语言
...
## 概述
实现 Genex Mobile 全量国际化支持,覆盖全部 UI 字符串。
支持语言:简体中文(zh_CN)、繁体中文(zh_TW)、英文(en)、日文(ja)。
共计 720+ 翻译键值对,涉及 51 个文件。
## 新增文件
- lib/app/i18n/strings/zh_cn.dart — 简体中文翻译(基础语言)
- lib/app/i18n/strings/zh_tw.dart — 繁体中文翻译
- lib/app/i18n/strings/en.dart — 英文翻译
- lib/app/i18n/strings/ja.dart — 日文翻译
- lib/app/i18n/locale_manager.dart — 全局语言/货币状态管理器
## i18n 基础架构
- AppLocalizations: 基于 Map<String, String> 的翻译查找
- AppLocalizationsDelegate: Flutter 本地化委托集成
- context.t('key') 扩展方法:便捷取用翻译文本
- 回退链:缺失 key → zh_CN → key 本身
- LocaleManager: ValueNotifier<Locale?> 响应式语言切换
- 货币绑定:根据 locale 自动匹配货币符号(CNY/TWD/USD/JPY)
## 页面级国际化(46 个文件)
### 认证模块 (auth)
- welcome_page, login_page, register_page, forgot_password_page
### 券模块 (coupons)
- home_page, market_page, search_page, coupon_detail_page
- my_coupons_page, my_coupon_detail_page, wallet_coupons_page
- order_confirm_page, payment_page, payment_success_page
- redeem_qr_page, receive_coupon_sheet
### 交易模块 (trading)
- trading_page, trading_detail_page, sell_order_page, transfer_page
### 钱包模块 (wallet)
- wallet_page, deposit_page, withdraw_page, transaction_records_page
### 用户模块 (profile)
- profile_page, settings_page, kyc_page
- payment_management_page, pro_mode_page
### 消息模块 (message)
- message_page, message_detail_page
### 商户模块 (merchant)
- merchant_home_page, merchant_ai_assistant_page
### 发行方模块 (issuer)
- issuer_main_page
### AI 模块 (ai_agent)
- agent_chat_page, ai_fab
### 公共组件 (shared/widgets)
- coupon_card, price_tag, status_tag, empty_state
- ai_confirm_dialog, kyc_badge
### 应用层 (app)
- main.dart (本地化委托/Locale解析配置)
- main_shell.dart, app_localizations.dart, pubspec.yaml
## 技术处理
- Widget getter → method(BuildContext): 需要 context 的属性转为方法
- const 默认参数 → nullable: 无法在 const 中使用 context.t(),改为可空参数在 build() 中解析
- Mock 数据保留中文:示例/演示数据将来自 API,无需国际化
- 语言选择器原生显示:中文/English/日本語 等按各语言原生名称展示
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-12 00:16:00 -08:00
hailin
b639e8c823
feat: 设置页面新增货币选择器和语言选择器
...
- 设置页面从StatelessWidget改为StatefulWidget
- 新增货币选择器bottom sheet,支持USD/CNY/EUR/GBP/JPY/HKD
- 新增语言选择器bottom sheet,支持简体中文/繁體中文/English/日本語
- 通知开关改为可交互状态
- 货币subtitle动态显示已选货币代码和符号
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-11 21:18:11 -08:00
hailin
003b571f94
refactor: 交易页面改为券+行业分类模式,移除交易对tabs
...
- market_page: 移除券/法币/数字货币/稳定币tabs,改为行业分类过滤(餐饮/购物/娱乐/出行/生活/运动)
- market_page: 新增排序栏(折扣率/价格/到期时间),二级市场改为券名+品牌+行业标签展示
- trading_detail_page: 移除SBUX/USDT交易对概念,改为券信息卡片+配置货币符号
- trading_detail_page: 新增券信息卡片(品牌/行业/信用评级/面值/到期),价格显示折扣率
- 计价货币由用户在"我的→设置"中配置,默认跟随语言
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-11 20:55:24 -08:00
hailin
d9c953149b
refactor: 重写转赠页面为混合方案
...
- 顶部两个并排入口卡片:扫码转赠 / 输入ID(邮箱/手机/接收ID)
- 最近转赠人列表:显示联系方式类型标签、脱敏联系方式、上次转赠时间
- 联系方式有效期机制:90天过期后灰显,点击提示重新验证
- 底部sheet选券流程:选方式 → 选券 → 确认转赠 → 成功
- 转赠记录摘要:显示最近转出/转入记录
- 移除旧的好友列表设计,改为地址式转赠(类似加密钱包)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-11 19:13:01 -08:00
hailin
8bbd56a86c
refactor: 我的钱包 → 持仓,统一交易所语境
...
- 首页卡片: "我的钱包" → "持仓"
- 完整页面标题: "我的钱包" → "我的持仓"
- 图标: account_balance_wallet → inventory_2 (仓位/库存)
- 更新注释和 main.dart 描述
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-11 18:58:47 -08:00
hailin
b9f36176ed
fix: 修复 wallet_coupons_page 缺少 CouponStatus 导入和错误引用
...
- 添加 coupon_card.dart 导入以获取 CouponStatus 枚举
- AppTypography.display → AppTypography.displayLarge
- AppColors.couponFood → AppColors.couponDining
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-11 18:43:37 -08:00
hailin
b1a0f29f06
refactor: 轻量化首页钱包卡片,新增完整钱包页面
...
- 首页钱包区域从重量级(stats+filter+coupon cards+actions)
精简为轻量卡片(汇总信息+4个快捷入口),点击进入完整钱包页
- 新增 wallet_coupons_page.dart:融合"我的券"全部功能
(汇总面板+4-Tab筛选+券列表+转赠/出售快捷操作+接收券)
- 分类网格从6项(3列)扩展为8项(4列x2行):
限时抢购/新券首发/折扣排行/即将到期/比价/转让市场/热门交易/全部
- HomePage 从 StatefulWidget 简化为 StatelessWidget
- main.dart 新增 /wallet/coupons 路由
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-11 18:39:22 -08:00
hailin
b63414542b
feat: Create genex-mobile app with coupon lifecycle management redesign
...
基于 frontend/mobile 创建全新的 genex-mobile 应用,重新设计为券的生命周期管理平台。
## 底部导航重构 (5 tabs → 4 tabs)
- 首页 / 交易 / 消息 / 我的
- 移除独立的"我的券"Tab,功能合并到首页券钱包中
- "市场"重命名为"交易",图标改为行情图标
## 首页改造
### 券钱包(替代原Banner轮播区域)
- 紫色渐变卡片展示"我的钱包",含券数量统计(可使用/待核销/已过期)
- 水平滚动的券迷你卡片列表,支持Tab筛选(全部/可使用/待核销/已过期)
- 快捷操作栏:接收 / 转赠 / 出售 / 核销
- 接收功能:点击弹出底部Sheet,展示接收ID和接收二维码
- 对方可通过扫码或输入ID转赠券到钱包
- 接收ID支持一键复制
### 分类网格重新设计(从商品品类改为省钱机制)
- 原8个商品分类(餐饮/购物/娱乐/出行/生活/品牌/折扣/全部)
- 改为6个省钱导向分类:限时抢购 / 新券首发 / 折扣排行 / 即将到期 / 比价 / 全部分类
- 3列×2行布局,每个入口强调"怎么省"而非"卖什么"
### 其他区域保持不变
- AI智能推荐卡片
- 精选好券列表
- AI FAB浮动按钮
## 交易页(币安交易所风格)
### 一级市场(打新申购 / Launchpad风格)
- 券发行卡片:品牌信息 / 发行价 / 面值 / 折扣 / 发行量
- 销售进度条和百分比
- 状态标签:即将开始(含倒计时)/ 申购中 / 已结束
### 二级市场(交易所行情列表)
- 交易对分类Tab:券/法币 | 券/数字货币 | 券/稳定币 | 收藏
- 行情列表:交易对名称 / 最新价格 / 24h涨跌幅(红绿色块)
- 成交量和USD等价显示
- 支持的交易对示例:SBUX/USD, NIKE/BTC, AMZN/USDT 等
### 交易对详情页(K线 + 盘口 + 下单)
- 价格头部:当前价 / 24h涨跌 / OHLC数据(高/低/开盘/成交量)
- K线图(含模拟蜡烛图渲染 + 成交量柱状图)
- 时间周期选择器:1m / 5m / 15m / 1h / 4h / 1D / 1W
- 交易深度:买卖盘口(Bid/Ask)带深度条可视化
- 下单表单:买入/卖出切换 / 限价单/市价单 / 价格数量输入 / 比例快选(25%/50%/75%/100%)
- 当前委托和历史委托列表
- 底部买入/卖出快捷按钮
## 券详情页增强
- 新增"附近可用门店"区域(LBS定位功能入口)
- 展示附近门店列表:门店名 / 距离 / 营业状态
## 技术细节
- 保持原有设计系统:紫色主色调 #6C5CE7 / Material 3 / 亮色模式
- Flutter analyze 零错误通过
- 所有新增页面使用 mock 数据,便于后续接入真实API
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-11 17:57:16 -08:00
hailin
87d54be200
fix: Remove infinite minimumSize from ElevatedButton/OutlinedButton theme
...
The theme set minimumSize: Size(double.infinity, 52) which creates
an internal ConstrainedBox(w=Infinity) inside every button. This
crashes when any button is placed in unbounded width context (Row).
Changed to Size(0, 52) — GenexButton's LayoutBuilder handles width.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-11 07:15:20 -08:00
hailin
665e494b4a
fix: Prevent GenexButton crash with unbounded width constraints
...
Use LayoutBuilder to detect whether parent provides bounded width.
When fullWidth=true in an unbounded context (e.g. Row without
Expanded), gracefully fall back to content-sized width instead of
forcing SizedBox(width: double.infinity) which triggers
"BoxConstraints forces an infinite width" assertion.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-11 07:08:09 -08:00
hailin
5abb614d03
feat: Wire all navigation callbacks across mobile and admin-app
...
Replace empty onPressed/onTap placeholder callbacks with actual
Navigator route calls so all pages are navigable during testing.
Mobile (16 pages):
- Auth flow: welcome → login/register → main shell, forgot password
- Home: search bar → /search, coupon cards → /coupon/detail, AI FAB → /ai-chat
- Market: coupon cards → /coupon/detail
- Coupon detail: buy → /order/confirm
- Order confirm: payment auth → /payment
- Payment: confirm → /payment/success (fixed route typo)
- Payment success: buttons → /main (clear stack)
- My coupons: cards → /coupon/mine/detail
- My coupon detail: transfer → /transfer, sell → /sell
- Search: result cards → /coupon/detail
- Profile: KYC → /kyc, payment → /payment/manage, wallet → /wallet,
trading → /trading, pro mode → /pro-mode, settings → /settings,
logout → / (clear stack)
- Settings: KYC → /kyc, logout → / (clear stack)
- Wallet: deposit → /wallet/deposit, withdraw → /wallet/withdraw,
records → /wallet/records
- Messages: items → /message/detail
Admin-app (13 pages):
- Dashboard: AI insight → createCoupon, credit suggestion → credit
- Coupon list: coupon cards → couponDetail, FAB → createCoupon
- Create coupon: save draft → pop back
- Settings: store mgmt, employee mgmt → storeManagement,
AI assistant → aiAgent, tier upgrade → credit, logout → login
- Financing analysis: AI recommendation → aiAgent
- Onboarding: complete → main shell
- Login: register link → onboarding
- Fix: pass BuildContext to _buildTierCard in settings_page.dart
Both apps verified building successfully (flutter build apk --debug).
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-11 06:54:22 -08:00
hailin
5f3e660b05
feat: Add Flutter build configuration for admin-app and mobile
...
- Initialize Android/iOS platform code for both Flutter apps
- admin-app: cn.gogenex.issuer (Genex发行方)
- mobile: cn.gogenex.consumer (Genex消费者端)
- Configure Android build.gradle.kts with:
- Release signing config (keystore + key.properties)
- Debug build type with .debug applicationId suffix
- Release build type with ProGuard minification
- minSdk 21, targetSdk from Flutter
- Fix Flutter 3.38 API compatibility:
- CardTheme → CardThemeData
- TabBarTheme → TabBarThemeData
- DialogTheme → DialogThemeData
- Implement missing ForgotPasswordPage for mobile
- Create cross-platform build scripts (build.sh + build.bat)
- Supports: debug/release/clean/run modes
- Supports: apk/appbundle/ios platforms
- Unified build-output/ directory for APK artifacts
- All 4 builds verified: debug + release × 2 apps
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-11 06:22:13 -08:00
hailin
d49200e876
feat: Wire all view components to Next.js App Router routes
...
- Create (admin) route group with AdminLayout wrapper
- Add page.tsx route files for all 25 view pages (dashboard, issuers,
users, trading, risk, compliance, system, disputes, coupons, finance,
chain, reports, merchant, agent, insurance, analytics sub-pages,
compliance sub-pages)
- Update AdminLayout to use Next.js usePathname/useRouter for real
URL-based navigation instead of internal state
- Add 'use client' directive to view components using useState hooks
- Fix 404 on /dashboard by creating proper App Router route structure
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-11 05:37:28 -08:00
hailin
9ce42ed5ac
chore: Switch domain from admin.gogenex.com to admin.gogenex.cn
...
使用国内 .cn 域名用于 ICP 备案,支持国内 IP 直连加速。
国际域名 gogenex.com 保留在 Namecheap 不受影响。
变更:
- deploy.sh: 默认域名/邮箱改为 admin.gogenex.cn
- nginx 配置: 重命名为 admin.gogenex.cn.conf,替换所有域名引用
- DEPLOY.md: 更新所有域名引用
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-11 05:18:22 -08:00
hailin
a2a42ebf23
docs: Add deployment guide for admin-web (DEPLOY.md)
...
完整的部署文档,涵盖:
- 环境要求与项目结构
- 3 步快速部署流程
- deploy.sh 全部命令参考 (Docker + Nginx + SSL)
- 自定义域名部署说明
- Docker 三阶段构建说明
- SSL 证书管理 (自动续期、手动续期、强制重申)
- Nginx HTTPS 配置特性说明
- 常见问题排查 (端口占用、构建失败、SSL 失败、日志查看)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-11 02:00:40 -08:00
hailin
51f4c60fe5
feat: Add Nginx + Let's Encrypt SSL support to admin-web deploy.sh
...
deploy.sh 新增 nginx 子命令,支持一键安装 Nginx 反向代理和
Let's Encrypt SSL 证书,参考 rwadurian api-gateway 的实现模式。
新增命令:
- nginx install [domain] [email]: 完整安装流程 (5步)
1. 自动安装 nginx + certbot 依赖
2. 部署 HTTP 临时配置 (含 ACME 验证路径)
3. certbot webroot 方式申请 SSL 证书
4. 部署 HTTPS 完整配置 (从 nginx/ 目录读取)
5. 配置证书自动续期钩子 (renew hook)
- nginx ssl [domain] [email]: 仅申请/续期证书
- nginx status: 查看 Nginx 服务和证书状态
- nginx reload: 重载 Nginx 配置
新增文件:
- nginx/admin.gogenex.com.conf: HTTPS 配置模板
含 HTTP→HTTPS 重定向、TLS 1.2/1.3、HSTS、Gzip、
安全头、Next.js 静态资源长缓存、反向代理到 :3000
默认域名: admin.gogenex.com
默认邮箱: admin@gogenex.com
使用方式:
1. ./deploy.sh start # 先启动 Docker 容器
2. sudo ./deploy.sh nginx install # 安装 Nginx + SSL
3. 访问 https://admin.gogenex.com
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-11 01:58:07 -08:00
hailin
29958602db
fix: Move src/pages/ to src/views/ to avoid Next.js Pages Router conflict
...
Next.js treats `src/pages/` as the Pages Router and requires every file
to have a default export. Our page components use named exports
(e.g. `export const DashboardPage`) since they are UI view components,
not Next.js route handlers.
Rename to `src/views/` so Next.js only uses the App Router (`src/app/`).
The App Router page.tsx files will import from `@/views/` as needed.
24 files moved: src/pages/**/*.tsx → src/views/**/*.tsx
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-11 01:48:23 -08:00
hailin
b2c81090f8
fix: Resolve TypeScript strict-mode error in IpoReadinessPage
...
The milestones array only had 'progress' and 'pending' status values,
causing TS to infer the status type as 'progress' | 'pending'. The
template code then compared m.status === 'done' which TS flagged as
unreachable. Fix by explicitly typing the array to include all three
possible status values: 'done' | 'progress' | 'pending'.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-11 01:46:24 -08:00
hailin
79689c5f95
fix: Make Dockerfile tolerant of missing package-lock.json
...
The initial project has no node_modules or package-lock.json yet.
Use wildcard COPY for lock file and fallback to `npm install`
when lock file doesn't exist. Once lock file is generated and
committed, it will automatically use the faster `npm ci`.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-11 01:39:14 -08:00
hailin
6b90d61199
chore: Add Next.js project config and app entry for admin-web
...
The previous deploy.sh commit included Dockerfile and docker-compose
but was missing the actual Next.js project files needed for `npm ci`
and `npm run build` to succeed. This adds the complete project skeleton.
## Project configuration files
### package.json
- Next.js 15.1.11, React 18, TypeScript 5.9
- Dependencies: @reduxjs/toolkit, @tanstack/react-query,
@tanstack/react-table, axios, recharts, zustand, dayjs, clsx
- Scripts: dev, build, start, lint, format, type-check
### next.config.ts
- output: 'standalone' — required for Docker multi-stage build
- / redirects to /dashboard
- Remote image patterns enabled
### tsconfig.json
- Strict mode, bundler module resolution
- Path alias: @/* → ./src/*
- Incremental compilation enabled
### .gitignore / .dockerignore
- Standard Next.js ignores (node_modules, .next, out, coverage)
- Docker build excludes dev files, docs, git, IDE configs
## App Router entry files
### src/app/layout.tsx — Root layout
- HTML lang="zh-CN", imports globals.css + design-tokens.css
- Wraps children with Providers (placeholder for Redux/RQ/Auth)
### src/app/providers.tsx — Client-side providers wrapper
- Placeholder for Redux Provider, React Query, Theme, Auth
### src/app/page.tsx — Root page
- Redirects to /dashboard via next.config.ts
### src/app/globals.css — Global styles
- Imports design-tokens.css, box-sizing reset
- Custom scrollbar styling with design tokens
- Selection color using primary-container
### src/app/api/health/route.ts — Health check endpoint
- GET /api/health returns { status, service, timestamp }
- Used by Docker healthcheck and load balancers
### public/favicon.ico — Placeholder favicon
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-11 01:35:19 -08:00
hailin
8042160f83
.
2026-02-11 09:30:54 +00:00
hailin
bae342f1bd
chore: Add Docker deployment config for admin-web
...
Add complete deployment toolchain for the Genex Admin Web (React + Next.js),
mirroring the proven deployment pattern from the rwadurian project.
## Files added
### deploy.sh — One-click deployment script
- Commands: build / start / stop / restart / logs / status / clean
- Auto-detects `docker compose` vs `docker-compose`
- Port conflict detection with auto-stop of old service
- Health check verification after startup
- Supports PORT env override (default: 3000)
### Dockerfile — Multi-stage production build
- Stage 1 (deps): node:20-alpine, npm ci for deterministic installs
- Stage 2 (builder): Next.js production build with telemetry disabled
- Stage 3 (runner): Minimal runtime with standalone output
- Non-root user (nextjs:nodejs) for security
- curl installed for container health checks
### docker-compose.yml — Container orchestration
- Service: genex-admin-web on genex-network bridge
- Health check: GET /api/health every 30s, 3 retries
- Auto-restart: unless-stopped policy
- Timezone: Asia/Shanghai
### .env.development — Local dev environment
- API: http://localhost:8080/api
### .env.production — Production environment
- API: https://api.gogenex.com/api
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-11 01:22:22 -08:00
hailin
e450bef7cd
feat: Complete all 4 frontend UI prototypes covering guides 00-04
...
Add 116 UI prototype files across 4 frontend applications, achieving
~95% coverage of all functional requirements from development guides.
## mobile/ (Flutter Consumer + Merchant App) — 48 files
- Auth: welcome, login, register, forgot-password
- Coupons: home, market, search, detail, my-coupons, my-coupon-detail,
order-confirm, payment, payment-success, redeem-qr
- Trading: trading, sell-order (AI pricing), transfer
- Wallet: wallet, deposit, withdraw, transaction-records
- Profile: profile, kyc (L0-L3), settings, payment-management, pro-mode
(WalletConnect, chain address, tx hash, track selection)
- AI Agent: agent-chat, ai-fab (floating button with unread count)
- Merchant: merchant-home (scanner, confirm, success, history, dashboard),
merchant-ai-assistant (redeem assist, traffic prediction, anomaly alerts)
- Message: message-list, message-detail
- Issuer: issuer-main-page
- Shared widgets: coupon-card, price-tag, credit-badge, kyc-badge,
status-tag, empty-state, skeleton-loader, confirm-sheet, genex-button,
ai-confirm-dialog (3-level risk confirmation)
- Theme: app-colors, app-typography, app-spacing, app-theme
- i18n: zh-CN, en-US, ja-JP
## admin-app/ (Flutter Issuer Console) — 27 files
- Auth: issuer-login
- Onboarding: 5-step enterprise onboarding with AI compliance check
- Dashboard: issuer-dashboard (stats, AI insight, credit/quota),
user-portrait (age/geo/preference/repurchase/AI insight)
- Coupon management: list, create (template-based, AI pricing),
detail (recall/delist), batch-operations (issue/recall/price-adjust)
- Redemption: scan-to-redeem with offline mode
- Finance: overview, reconciliation (auto-reconcile, export PDF/Excel),
financing-analysis (cost-benefit, liquidity, risk indicators, AI strategy)
- Credit: credit-scoring (4-factor, tier progress, AI suggestions),
quota-management (usage gauge, type breakdown, tier upgrade, increase requests)
- AI Agent: full conversation UI with quick actions
- Settings: account, notification, support, tier display
- Store management: hierarchy (HQ/regional/store), employee roles
- Shared: ai-suggestion-card
- Theme: app-colors, app-theme, app-typography, app-spacing
- i18n: zh-CN, en-US, ja-JP
## admin-web/ (React + Next.js Platform Admin) — 26 files
- Layout: AdminLayout with collapsible sidebar, 10 nav sections
- Dashboard: key metrics, transaction feed, system health
- Users: user management with KYC filtering, risk tags
- Issuers: issuer review with AI pre-screening, credit rating display
- Trading: real-time monitor, order book, abnormal detection
- Risk: risk dashboard, AI warnings, suspicious transactions, OFAC logs
- Compliance: SAR/CTR management, audit logs, AI report generation
- SEC Filing: S-1/10-K/10-Q/8-K tracker, filing timeline, auto-disclosure
- License management: FinCEN MSB, BitLicense, MTL (48 states), renewal alerts
- SOX compliance: ICFR/ITGC/access/change-mgmt controls, deficiency tracking
- Tax compliance: Federal + 4 states, 8 IRS forms, tax calendar
- IPO readiness: 28-item checklist (legal/financial/SOX/governance/insurance),
blocker tracking, milestone timeline, category progress, key contacts
- Finance: fee revenue, settlement queue, breakage tracking
- Disputes: case management with SLA countdown, chain evidence
- Analytics: user (DAU/MAU, cohort retention, geographic), coupon (category,
breakage, secondary market), market-maker (TVL, spread, health, risk alerts),
consumer-protection (complaints, CSAT, fund utilization, non-compliant issuers)
- Insurance: consumer protection fund, claims, IPO checklist overview
- Chain monitor: smart contract status, blockchain metrics
- Reports: platform-wide report center
- AI Agent panel: session stats, top questions, module accuracy
- Merchant redemption: stats, store ranking, real-time feed
- Design tokens: CSS custom properties (colors, typography, spacing, shadows)
- i18n: zh-CN, en-US, ja-JP
## miniapp/ (Taro Mini Program + H5) — 15 files
- Pages: home, detail, purchase, orders, my-coupons, login, redeem, profile
- H5 pages: h5-share, h5-activity (countdown, featured coupons),
h5-register (benefits, phone/SMS form, WeChat login)
- Components: coupon-card, ai-guide (recommendation bar + purchase bubble),
share-card (brand header, QR code, coupon info)
- i18n: zh-CN, en-US, ja-JP
## Design System
- Primary: #6C5CE7 (innovation purple), Material 3 style
- Consistent design tokens across all platforms
- Zero blockchain terminology — "我的券" not "NFT", "订单号" not "TX Hash"
- Utility Track MVP only; Securities Track reserved as "coming soon"
## Not included (by design)
- Data/Domain layers (API, state management, business logic) — UI prototypes only
- Securities Track full UI — MVP focuses on Utility Track
- P2 "求购" (want-to-buy) feature — marked as optional
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-11 01:16:44 -08:00