fix: 修复试用用户欢迎弹窗不显示的问题

- 修复 userService 中 null 值未正确赋值的问题
- 优化欢迎弹窗判断逻辑:null=长期有效,undefined=无效
- 添加测试命令 resetWelcomeModal 用于清除弹窗标记
This commit is contained in:
Roe-xin
2026-03-03 19:06:02 +08:00
parent 2cce8f94c9
commit 76817675f1
2 changed files with 17 additions and 6 deletions

View File

@ -162,10 +162,14 @@ export async function getUserInfo(token: string): Promise<UserInfo | null> {
console.log('[UserService] 从 getInfo 接口获取到 isPluginTrial: true');
}
// 获取试用到期时间
if (response.enterpriseTrialExpires) {
// 获取试用到期时间null 表示长期有效)
if (response.enterpriseTrialExpires !== undefined) {
userInfo.pluginTrialExpiresAt = response.enterpriseTrialExpires;
console.log('[UserService] 试用到期时间:', new Date(response.enterpriseTrialExpires).toLocaleString());
if (response.enterpriseTrialExpires === null) {
console.log('[UserService] 试用长期有效');
} else {
console.log('[UserService] 试用到期时间:', new Date(response.enterpriseTrialExpires).toLocaleString());
}
}
return userInfo;