Compare commits

...

4 Commits

Author SHA1 Message Date
wangjia 2d84bda99a chore: release server-v1.0.58
Deploy Server / release-deploy-server (push) Successful in 48s
RefreshTokens 续登路径补发首次试用,修复自动续登老用户授权停留「未激活」。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Y2Wdwo7SmgBJU37cBrkhPK
2026-06-18 19:14:25 +08:00
wangjia e3c8350d03 chore(deploy): 接入 Ed25519 license 签发密钥到 production.env 渲染
render-env.sh 修正 Bitwarden 条目名为「jiu db password」,SECRET_KEYS
加入 LICENSE_ED25519_PRIVATE_KEY;模板补公钥(明文可提交)与私钥占位。
修复未激活门店因生产缺少签发私钥而无法自动发放试用授权的问题。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Y2Wdwo7SmgBJU37cBrkhPK
2026-06-18 08:57:30 +08:00
wangjia a8e29a641a feat(client): 退出登录归入用户名下拉菜单
侧栏底部用户名行改为可点击的 PopupMenuButton,点击弹出账号菜单,
退出登录移入其中;移除原用户名行直接打开门店信息面板的入口。
设备管理保持在侧栏导航不变。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Y2Wdwo7SmgBJU37cBrkhPK
2026-06-18 08:57:30 +08:00
wangjia e3e8cf7037 chore: release client-v1.0.58
Deploy Client / build-client-web (push) Successful in 40s
Deploy Client / build-windows (push) Successful in 1m56s
Deploy Client / build-macos (push) Successful in 2m13s
Deploy Client / build-android (push) Successful in 1m35s
Deploy Client / build-ios (push) Successful in 3m0s
Deploy Client / release-deploy-client (push) Successful in 1m19s
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Y2Wdwo7SmgBJU37cBrkhPK
2026-06-18 08:01:50 +08:00
6 changed files with 59 additions and 63 deletions
+5
View File
@@ -5,6 +5,11 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [1.0.58] - 2026-06-18
### 修复
- 恢复 Windows 桌面版的自动构建与发布:上一版因构建环境问题未能产出 Windows 安装包,本版已修复,Windows 用户可正常下载安装
## [1.0.57] - 2026-06-17
### 新功能
+5
View File
@@ -5,6 +5,11 @@
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [1.0.58] - 2026-06-18
### 修复
- 修复已登录用户授权长期停留在「未激活」的问题:此前仅全新登录才会自动发放 30 天试用,靠本地令牌自动续登的老用户始终拿不到,现在续登时也会补发
## [1.0.57] - 2026-06-18
### 新功能
+5
View File
@@ -419,6 +419,11 @@ func (s *AuthService) RefreshTokens(refreshToken string) (*TokenPair, error) {
Update("last_seen_at", time.Now())
}
// 自动续登(refresh)路径同样补发首次试用:老用户用本地 refresh token 自动登录、
// 从不走 Login(),否则永远停留在「未激活」。须在 issueTokens 之前,使新 JWT 的
// lic_exp 带上试用到期日。
s.ensureTrialOnFirstUse(user.ShopID)
return s.issueTokens(user.ID, user.ShopID, user.Role, claims.SID)
}
+40 -61
View File
@@ -300,68 +300,37 @@ class _AppShellState extends ConsumerState<AppShell> {
}).toList(),
),
),
// 当前登录账号(顶栏移下来的用户名):点击弹门店/账号/版本面板
// 当前登录账号:点击弹下拉菜单(退出登录)
if (user != null) ...[
const Divider(height: 1, color: Colors.white24),
SizedBox(
height: 48,
child: Material(
color: Colors.transparent,
child: InkWell(
onTap: () => _showShopPanel(context, user,
version: appVersion),
hoverColor: Colors.white.withAlpha(13),
splashColor: Colors.white.withAlpha(26),
child: Row(
children: [
SizedBox(
width: _sidebarExpanded ? 16 : 3),
Expanded(
child: Row(
mainAxisAlignment: _sidebarExpanded
? MainAxisAlignment.start
: MainAxisAlignment.center,
children: [
const Icon(Icons.person_outline,
color: Colors.white60,
size: 20),
if (_sidebarExpanded) ...[
const SizedBox(width: 12),
Expanded(
child: Text(
user.username,
style: const TextStyle(
color: Colors.white70,
fontSize: 14),
overflow:
TextOverflow.ellipsis,
),
),
],
],
),
),
],
),
),
),
),
],
// 退出登录(侧栏底部常驻;统一为左侧导航唯一退出入口)
const Divider(height: 1, color: Colors.white24),
SizedBox(
height: 48,
child: Material(
color: Colors.transparent,
child: InkWell(
onTap: () {
PopupMenuButton<String>(
tooltip: '账号菜单',
position: PopupMenuPosition.over,
offset: const Offset(0, -8),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(6)),
color: Colors.white,
elevation: 8,
onSelected: (v) {
if (v == 'logout') {
ref
.read(authStateProvider.notifier)
.logout();
context.go('/login');
},
hoverColor: Colors.white.withAlpha(13),
splashColor: Colors.white.withAlpha(26),
}
},
itemBuilder: (context) => const [
PopupMenuItem<String>(
value: 'logout',
padding: EdgeInsets.zero,
child: _HoverMenuItem(
icon: Icons.logout,
label: '退出登录',
),
),
],
child: SizedBox(
height: 48,
child: Row(
children: [
SizedBox(width: _sidebarExpanded ? 16 : 3),
@@ -371,14 +340,24 @@ class _AppShellState extends ConsumerState<AppShell> {
? MainAxisAlignment.start
: MainAxisAlignment.center,
children: [
const Icon(Icons.logout,
const Icon(Icons.person_outline,
color: Colors.white60, size: 20),
if (_sidebarExpanded) ...[
const SizedBox(width: 12),
const Text('退出登录',
style: TextStyle(
Expanded(
child: Text(
user.username,
style: const TextStyle(
color: Colors.white70,
fontSize: 14)),
fontSize: 14),
overflow: TextOverflow.ellipsis,
),
),
const Icon(
Icons.keyboard_arrow_up,
color: Colors.white38,
size: 18),
const SizedBox(width: 12),
],
],
),
@@ -387,7 +366,7 @@ class _AppShellState extends ConsumerState<AppShell> {
),
),
),
),
],
const SizedBox(height: 8),
],
),
+2
View File
@@ -6,6 +6,8 @@ JWT_SECRET=CHANGE_ME_RANDOM_32CHARS
JWT_ACCESS_EXPIRE_MIN=60
JWT_REFRESH_EXPIRE_H=168
LICENSE_HMAC_SECRET=CHANGE_ME_RANDOM_32CHARS
LICENSE_ED25519_PUBLIC_KEY=zFkRV0E+oMjHbixiBamf2ZAq+n7En2V7EJRIurgtVxo=
LICENSE_ED25519_PRIVATE_KEY=CHANGE_ME_ED25519_PRIVATE_FROM_BITWARDEN
STORAGE_UPLOAD_DIR=/opt/jiu/images
STORAGE_BASE_URL=https://jiu.51yanmei.com/images
STORAGE_PUBLIC_URL=https://jiu.51yanmei.com
+2 -2
View File
@@ -15,8 +15,8 @@ set -euo pipefail
# ---- 可配置项 ----
RBW="${RBW_BIN:-/opt/homebrew/bin/rbw}"
BW_ITEM="${JIU_BW_ITEM:-DB_PASSWORD}" # 存放 jiu 密钥字段的 Bitwarden 条目
SECRET_KEYS="DATABASE_DSN JWT_SECRET LICENSE_HMAC_SECRET DB_PASSWORD"
BW_ITEM="${JIU_BW_ITEM:-jiu db password}" # 存放 jiu 密钥字段的 Bitwarden 条目
SECRET_KEYS="DATABASE_DSN JWT_SECRET LICENSE_HMAC_SECRET LICENSE_ED25519_PRIVATE_KEY DB_PASSWORD"
EC2_HOST="${EC2_HOST:-18.136.60.128}"
EC2_USER="${EC2_USER:-ec2-user}"