diff --git a/Yi.Abp.Net8/module/ai-hub/Yi.Framework.AiHub.Application/Services/AiAccountService.cs b/Yi.Abp.Net8/module/ai-hub/Yi.Framework.AiHub.Application/Services/AiAccountService.cs index 28b0c1f2..83ec7b10 100644 --- a/Yi.Abp.Net8/module/ai-hub/Yi.Framework.AiHub.Application/Services/AiAccountService.cs +++ b/Yi.Abp.Net8/module/ai-hub/Yi.Framework.AiHub.Application/Services/AiAccountService.cs @@ -13,6 +13,7 @@ using Yi.Framework.Rbac.Application.Contracts.IServices; using Yi.Framework.Rbac.Domain.Shared.Dtos; using Yi.Framework.SqlSugarCore.Abstractions; using Yi.Framework.AiHub.Domain.Extensions; +using Yi.Framework.AiHub.Domain.Shared.Enums; namespace Yi.Framework.AiHub.Application.Services; @@ -58,7 +59,7 @@ public class AiAccountService : ApplicationService if (output.IsVip) { var recharges = await _rechargeRepository._DbQueryable - .Where(x => x.UserId == userId) + .Where(x => x.UserId == userId && x.RechargeType == RechargeTypeEnum.Vip) .ToListAsync(); if (recharges.Any()) diff --git a/Yi.Ai.Vue3/src/components/userPersonalCenter/components/UserManagement.vue b/Yi.Ai.Vue3/src/components/userPersonalCenter/components/UserManagement.vue index efe5d286..e55a8a17 100644 --- a/Yi.Ai.Vue3/src/components/userPersonalCenter/components/UserManagement.vue +++ b/Yi.Ai.Vue3/src/components/userPersonalCenter/components/UserManagement.vue @@ -36,6 +36,40 @@ const userVipStatus = computed(() => { return isUserVip(); }); +// VIP到期时间 +const vipExpireTime = computed(() => { + return userStore.userInfo?.vipExpireTime || null; +}); + +// 计算距离VIP到期还有多少天 +const vipRemainingDays = computed(() => { + if (!vipExpireTime.value) return null; + const expireDate = new Date(vipExpireTime.value); + const now = new Date(); + const diffTime = expireDate.getTime() - now.getTime(); + const diffDays = Math.ceil(diffTime / (1000 * 60 * 60 * 24)); + return diffDays; +}); + +// VIP到期状态文本 +const vipExpireStatusText = computed(() => { + if (!userVipStatus.value) return ''; + if (!vipExpireTime.value) return '永久VIP'; + if (vipRemainingDays.value === null) return ''; + if (vipRemainingDays.value < 0) return '已过期'; + if (vipRemainingDays.value === 0) return '今日到期'; + return `${vipRemainingDays.value}天后到期`; +}); + +// VIP到期状态标签类型 +const vipExpireTagType = computed(() => { + if (!vipExpireTime.value) return 'success'; + if (vipRemainingDays.value === null) return 'info'; + if (vipRemainingDays.value < 0) return 'danger'; + if (vipRemainingDays.value <= 7) return 'warning'; + return 'success'; +}); + // 格式化日期 function formatDate(dateString: string | null) { if (!dateString) @@ -161,6 +195,28 @@ function bindWechat() { 注册时间 + +
+
+ + +
+
+ VIP到期时间 + + {{ vipExpireStatusText }} + +
+
diff --git a/Yi.Ai.Vue3/src/config/version.ts b/Yi.Ai.Vue3/src/config/version.ts index 777da068..e2f34f91 100644 --- a/Yi.Ai.Vue3/src/config/version.ts +++ b/Yi.Ai.Vue3/src/config/version.ts @@ -6,7 +6,7 @@ */ // 主版本号 - 修改此处即可同步更新所有地方的版本显示 -export const APP_VERSION = '3.6.1'; +export const APP_VERSION = '3.7.0'; // 应用名称 export const APP_NAME = '意心AI'; diff --git a/Yi.Ai.Vue3/src/layouts/components/Header/index.vue b/Yi.Ai.Vue3/src/layouts/components/Header/index.vue index dd99fc29..786e69ba 100644 --- a/Yi.Ai.Vue3/src/layouts/components/Header/index.vue +++ b/Yi.Ai.Vue3/src/layouts/components/Header/index.vue @@ -127,6 +127,9 @@ function toggleMobileMenu() { AI智能体 + + AI接口 + @@ -137,8 +140,11 @@ function toggleMobileMenu() { + + 模型库 + 模型排行榜 @@ -272,14 +278,20 @@ function toggleMobileMenu() { AI智能体 + + AI接口 + + + 模型库 + 模型排行榜 diff --git a/Yi.Ai.Vue3/src/pages/chat/api/index.vue b/Yi.Ai.Vue3/src/pages/chat/api/index.vue new file mode 100644 index 00000000..c33cf290 --- /dev/null +++ b/Yi.Ai.Vue3/src/pages/chat/api/index.vue @@ -0,0 +1,335 @@ + + + + + diff --git a/Yi.Ai.Vue3/src/pages/chat/index.vue b/Yi.Ai.Vue3/src/pages/chat/index.vue index 65e2ce38..a758d427 100644 --- a/Yi.Ai.Vue3/src/pages/chat/index.vue +++ b/Yi.Ai.Vue3/src/pages/chat/index.vue @@ -15,6 +15,7 @@ const navItems = [ { name: 'image', label: 'AI图片', icon: 'Picture', path: '/chat/image' }, { name: 'video', label: 'AI视频', icon: 'VideoCamera', path: '/chat/video' }, { name: 'monitor', label: 'AI智能体', icon: 'Monitor', path: '/chat/agent' }, + { name: 'ChatLineRound', label: 'AI接口', icon: 'ChatLineRound', path: '/chat/api' }, ]; // 当前激活的菜单 diff --git a/Yi.Ai.Vue3/src/routers/modules/staticRouter.ts b/Yi.Ai.Vue3/src/routers/modules/staticRouter.ts index 39337a03..b59b922a 100644 --- a/Yi.Ai.Vue3/src/routers/modules/staticRouter.ts +++ b/Yi.Ai.Vue3/src/routers/modules/staticRouter.ts @@ -77,6 +77,14 @@ export const layoutRouter: RouteRecordRaw[] = [ title: '意心Ai-AI智能体', }, }, + { + path: 'api', + name: 'chatApi', + component: () => import('@/pages/chat/api/index.vue'), + meta: { + title: '意心Ai-AI接口', + }, + }, ], }, diff --git a/Yi.Ai.Vue3/src/styles/dark-theme.scss b/Yi.Ai.Vue3/src/styles/dark-theme.scss index 82b30894..c8d01305 100644 --- a/Yi.Ai.Vue3/src/styles/dark-theme.scss +++ b/Yi.Ai.Vue3/src/styles/dark-theme.scss @@ -2062,4 +2062,7 @@ .marked-markdown.theme-light .code-block-wrapper .code-block-body .line-numbers{ @include dark-theme-div; } + .url-box{ + @include dark-theme-div; + } } diff --git a/Yi.Ai.Vue3/types/components.d.ts b/Yi.Ai.Vue3/types/components.d.ts index f139484a..2e45c353 100644 --- a/Yi.Ai.Vue3/types/components.d.ts +++ b/Yi.Ai.Vue3/types/components.d.ts @@ -18,6 +18,7 @@ declare module 'vue' { DeepThinking: typeof import('./../src/components/DeepThinking/index.vue')['default'] Demo: typeof import('./../src/components/FontAwesomeIcon/demo.vue')['default'] ElAlert: typeof import('element-plus/es')['ElAlert'] + ElAside: typeof import('element-plus/es')['ElAside'] ElAvatar: typeof import('element-plus/es')['ElAvatar'] ElButton: typeof import('element-plus/es')['ElButton'] ElCard: typeof import('element-plus/es')['ElCard']