4.17更新

This commit is contained in:
hrx 2026-04-17 17:41:38 +08:00
parent eb6059267d
commit 5df9a86325
26 changed files with 173 additions and 152 deletions

View File

@ -54,6 +54,12 @@
<div class="content unicode" style="display: block;"> <div class="content unicode" style="display: block;">
<ul class="icon_lists dib-box"> <ul class="icon_lists dib-box">
<li class="dib">
<span class="icon iconfont">&#xe606;</span>
<div class="name">414126695</div>
<div class="code-name">&amp;#xe606;</div>
</li>
<li class="dib"> <li class="dib">
<span class="icon iconfont">&#xe617;</span> <span class="icon iconfont">&#xe617;</span>
<div class="name">apikey</div> <div class="name">apikey</div>
@ -186,9 +192,9 @@
<pre><code class="language-css" <pre><code class="language-css"
>@font-face { >@font-face {
font-family: 'iconfont'; font-family: 'iconfont';
src: url('iconfont.woff2?t=1776308634739') format('woff2'), src: url('iconfont.woff2?t=1776413178216') format('woff2'),
url('iconfont.woff?t=1776308634739') format('woff'), url('iconfont.woff?t=1776413178216') format('woff'),
url('iconfont.ttf?t=1776308634739') format('truetype'); url('iconfont.ttf?t=1776413178216') format('truetype');
} }
</code></pre> </code></pre>
<h3 id="-iconfont-">第二步:定义使用 iconfont 的样式</h3> <h3 id="-iconfont-">第二步:定义使用 iconfont 的样式</h3>
@ -214,6 +220,15 @@
<div class="content font-class"> <div class="content font-class">
<ul class="icon_lists dib-box"> <ul class="icon_lists dib-box">
<li class="dib">
<span class="icon iconfont icon-a-414126695"></span>
<div class="name">
414126695
</div>
<div class="code-name">.icon-a-414126695
</div>
</li>
<li class="dib"> <li class="dib">
<span class="icon iconfont icon-apikey"></span> <span class="icon iconfont icon-apikey"></span>
<div class="name"> <div class="name">
@ -412,6 +427,14 @@
<div class="content symbol"> <div class="content symbol">
<ul class="icon_lists dib-box"> <ul class="icon_lists dib-box">
<li class="dib">
<svg class="icon svg-icon" aria-hidden="true">
<use xlink:href="#icon-a-414126695"></use>
</svg>
<div class="name">414126695</div>
<div class="code-name">#icon-a-414126695</div>
</li>
<li class="dib"> <li class="dib">
<svg class="icon svg-icon" aria-hidden="true"> <svg class="icon svg-icon" aria-hidden="true">
<use xlink:href="#icon-apikey"></use> <use xlink:href="#icon-apikey"></use>

View File

@ -1,8 +1,8 @@
@font-face { @font-face {
font-family: "iconfont"; /* Project id 5136943 */ font-family: "iconfont"; /* Project id 5136943 */
src: url('iconfont.woff2?t=1776308634739') format('woff2'), src: url('iconfont.woff2?t=1776413178216') format('woff2'),
url('iconfont.woff?t=1776308634739') format('woff'), url('iconfont.woff?t=1776413178216') format('woff'),
url('iconfont.ttf?t=1776308634739') format('truetype'); url('iconfont.ttf?t=1776413178216') format('truetype');
} }
.iconfont { .iconfont {
@ -13,6 +13,10 @@
-moz-osx-font-smoothing: grayscale; -moz-osx-font-smoothing: grayscale;
} }
.icon-a-414126695:before {
content: "\e606";
}
.icon-apikey:before { .icon-apikey:before {
content: "\e617"; content: "\e617";
} }

File diff suppressed because one or more lines are too long

View File

@ -5,6 +5,13 @@
"css_prefix_text": "icon-", "css_prefix_text": "icon-",
"description": "", "description": "",
"glyphs": [ "glyphs": [
{
"icon_id": "47386728",
"name": "414126695",
"font_class": "a-414126695",
"unicode": "e606",
"unicode_decimal": 58886
},
{ {
"icon_id": "44608574", "icon_id": "44608574",
"name": "apikey", "name": "apikey",

Binary file not shown.

View File

@ -14,7 +14,7 @@
padding-right: 2rem; padding-right: 2rem;
background: rgba(10, 12, 18, 0.74); background: rgba(10, 12, 18, 0.74);
backdrop-filter: blur(16px); backdrop-filter: blur(16px);
border-bottom: 1px solid rgba(255, 255, 255, 0.06);
@media (max-width: 768px) { @media (max-width: 768px) {
padding: 0 1rem; padding: 0 1rem;
@ -241,10 +241,13 @@
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
font-size: 13px; // font-size: 50px;
font-weight: 700; .iconfont{
color: #fff; font-size: 28px;
background: linear-gradient(135deg, rgba(139, 124, 255, 0.9), rgba(246, 184, 106, 0.72)); }
// font-weight: 700;
// color: #fff;
// background: linear-gradient(135deg, rgba(139, 124, 255, 0.9), rgba(246, 184, 106, 0.72));
flex-shrink: 0; flex-shrink: 0;
} }

View File

@ -206,6 +206,35 @@
width: 100%; width: 100%;
background: transparent; background: transparent;
:deep(.el-table) {
--el-table-bg-color: #1e2024;
--el-table-tr-bg-color: #1e2024;
--el-table-row-hover-bg-color: #25282e;
--el-table-current-row-bg-color: #25282e;
--el-table-header-bg-color: #1e2024;
--el-table-fixed-box-shadow: none;
--el-table-border-color: #2a2d32;
--el-table-text-color: rgba(255, 255, 255, 0.88);
--el-table-header-text-color: rgba(255, 255, 255, 0.75);
--el-bg-color: #1e2024;
--el-fill-color-lighter: #1a1c20;
background: transparent;
// Hide Element Plus default bottom divider on dark backgrounds.
&::before {
background-color: transparent;
}
}
:deep(.el-table__inner-wrapper),
:deep(.el-table__header-wrapper),
:deep(.el-table__body-wrapper),
:deep(.el-table__fixed),
:deep(.el-table__fixed-right),
:deep(.el-table__fixed-right-patch) {
background: #1e2024 !important;
}
:deep(.el-table__header-wrapper) { :deep(.el-table__header-wrapper) {
.el-table__header th { .el-table__header th {
background-color: #1e2024; background-color: #1e2024;
@ -227,6 +256,7 @@
td { td {
border-bottom: 1px solid #2a2d32; border-bottom: 1px solid #2a2d32;
color: rgba(255, 255, 255, 0.88); color: rgba(255, 255, 255, 0.88);
background-color: #1e2024;
} }
} }
} }
@ -237,6 +267,15 @@
} }
} }
:deep(.el-table__cell) {
background-color: transparent;
}
:deep(.el-table__fixed-right::before),
:deep(.el-table__fixed::before) {
background-color: #2a2d32 !important;
}
.key-mask { .key-mask {
font-family: Consolas, 'Courier New', monospace; font-family: Consolas, 'Courier New', monospace;
font-size: 13px; font-size: 13px;

View File

@ -29,8 +29,9 @@
<!-- 用户信息 --> <!-- 用户信息 -->
<div class="user-profile" :class="{ 'dropdown-open': userDropdownVisible }"> <div class="user-profile" :class="{ 'dropdown-open': userDropdownVisible }">
<div class="user-trigger" @click="toggleUserDropdown"> <div class="user-trigger" @click="toggleUserDropdown">
<div class="user-avatar">{{ userInitial }}</div> <div class="user-avatar">
<div class="user-name">{{ loginStore.userInfo?.user?.name || loginStore.userInfo?.user?.username }}</div> <i class="iconfont icon-a-414126695"></i>
</div>
<svg class="dropdown-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"> <svg class="dropdown-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path d="M6 9l6 6 6-6" /> <path d="M6 9l6 6 6-6" />
</svg> </svg>
@ -38,6 +39,10 @@
<Transition name="dropdown"> <Transition name="dropdown">
<div v-if="userDropdownVisible" class="user-dropdown"> <div v-if="userDropdownVisible" class="user-dropdown">
<div class="dropdown-item user-id">
<span class="item-label">用户名:</span>
<span class="item-value">{{ loginStore.userInfo?.user?.name || loginStore.userInfo?.user?.username }}</span>
</div>
<div class="dropdown-item user-id"> <div class="dropdown-item user-id">
<span class="item-label">用户ID:</span> <span class="item-label">用户ID:</span>
<span class="item-value">{{ loginStore.userInfo?.user?.id }}</span> <span class="item-value">{{ loginStore.userInfo?.user?.id }}</span>
@ -84,8 +89,8 @@ const showRechargeModal = ref(false);
const userDropdownVisible = ref(false); const userDropdownVisible = ref(false);
// 余额 // 余额
const balances = ref(0); const balances = ref(0);
const userDisplayName = computed(() => loginStore.userInfo?.user?.name || loginStore.userInfo?.user?.username || '用户'); // const userDisplayName = computed(() => loginStore.userInfo?.user?.name || loginStore.userInfo?.user?.username || '用户');
const userInitial = computed(() => userDisplayName.value.trim().charAt(0).toUpperCase() || 'U'); // const userInitial = computed(() => userDisplayName.value.trim().charAt(0).toUpperCase() || 'U');
const formattedBalance = computed(() => Number(balances.value || 0).toLocaleString('zh-CN')); const formattedBalance = computed(() => Number(balances.value || 0).toLocaleString('zh-CN'));
// 切换下拉菜单 // 切换下拉菜单
@ -106,7 +111,6 @@ const handleLogout = () => {
const getBalance = async () => { const getBalance = async () => {
try { try {
const res = await balance<BalanceResult>(); const res = await balance<BalanceResult>();
console.log('用户余额:', res);
if (res.status === 'ok') { if (res.status === 'ok') {
balances.value = res.data[0].balance; balances.value = res.data[0].balance;
} }

View File

@ -221,9 +221,6 @@ const confirmCustomAmount = () => {
// 更新主弹窗选中金额 // 更新主弹窗选中金额
selectedAmount.value = finalAmount; selectedAmount.value = finalAmount;
// 打印参数 (自定义弹窗确定)
console.log('[自定义充值] amount:', finalAmount);
// 关闭自定义弹窗 // 关闭自定义弹窗
closeCustomDialog(); closeCustomDialog();
}; };
@ -246,9 +243,6 @@ const handleConfirm = async () => {
currency: 'CNY' currency: 'CNY'
}; };
// 打印参数 (主弹窗确认)
console.log('[确认充值]', rechargeParams);
// 充值响应类型 // 充值响应类型
interface RechargeResponse { interface RechargeResponse {
status: string; status: string;
@ -258,7 +252,6 @@ interface RechargeResponse {
// 调用充值接口 // 调用充值接口
const res = await recharge<RechargeResponse, typeof rechargeParams>(rechargeParams); const res = await recharge<RechargeResponse, typeof rechargeParams>(rechargeParams);
console.log('充值接口返回:', res);
// 处理充值结果 // 处理充值结果
if (res.status === 'ok') { if (res.status === 'ok') {

View File

@ -439,23 +439,16 @@ const stopPolling = () => {
* 从后端获取今日任务列表并转换为前端格式 * 从后端获取今日任务列表并转换为前端格式
*/ */
const loadTaskList = async () => { const loadTaskList = async () => {
console.log('=== 开始加载任务列表 ===');
if (!isLoggedIn.value) { if (!isLoggedIn.value) {
console.log('未登录,跳过加载');
return; return;
} }
isLoading.value = true; isLoading.value = true;
try { try {
console.log('正在调用 getTodayTask 接口...');
// 调用任务列表接口 // 调用任务列表接口
const res = await getTodayTask<TaskResult>(); const res = await getTodayTask<TaskResult>();
console.log('getTodayTask 响应:', res);
if (res.status === 'ok' && res.data?.tasks && Array.isArray(res.data.tasks)) { if (res.status === 'ok' && res.data?.tasks && Array.isArray(res.data.tasks)) {
console.log('任务列表数据:', res.data.tasks);
// 转换后端数据格式为前端期望的格式 // 转换后端数据格式为前端期望的格式
taskList.value = res.data.tasks.map((task) => { taskList.value = res.data.tasks.map((task) => {
const output = task.ioinfo?.output || []; const output = task.ioinfo?.output || [];
@ -477,8 +470,6 @@ const loadTaskList = async () => {
} as TaskItem; } as TaskItem;
}); });
console.log('转换后的任务列表:', taskList.value);
// 加载完成后,启动轮询(如果有进行中的任务) // 加载完成后,启动轮询(如果有进行中的任务)
const hasProcessingTasks = taskList.value.some(task => const hasProcessingTasks = taskList.value.some(task =>
task.status === 'created' || task.status === 'created' ||
@ -487,14 +478,11 @@ const loadTaskList = async () => {
task.status === 'running' || task.status === 'running' ||
task.status === 'PENDING' task.status === 'PENDING'
); );
console.log('是否有进行中的任务:', hasProcessingTasks);
if (hasProcessingTasks) { if (hasProcessingTasks) {
console.log('启动轮询...');
startPolling(); startPolling();
} }
} else { } else {
console.log('任务列表为空或格式错误');
taskList.value = []; taskList.value = [];
} }
} catch (error) { } catch (error) {
@ -502,7 +490,6 @@ const loadTaskList = async () => {
taskList.value = []; taskList.value = [];
} finally { } finally {
isLoading.value = false; isLoading.value = false;
console.log('=== 任务列表加载完成 ===');
} }
}; };

View File

@ -98,7 +98,7 @@ const setVideoRef = (index: number, el: HTMLVideoElement | null) => {
const handleMouseEnter = (index: number) => { const handleMouseEnter = (index: number) => {
const video = videoRefs.value[index] const video = videoRefs.value[index]
if (video) { if (video) {
video.play().catch(err => console.log('播放失败:', err)) video.play().catch(() => undefined)
isVideoPlaying.value[index] = true isVideoPlaying.value[index] = true
} }
} }

View File

@ -308,7 +308,6 @@ const buildPriceParams = (): PriceQueryParams | null => {
config_data: configDataForPrice, config_data: configDataForPrice,
}; };
console.log('=== 构建价格查询参数 ===', priceParams);
return priceParams; return priceParams;
}; };
@ -397,7 +396,6 @@ const loadModels = async () => {
const handleModelChange = (modelId: string) => { const handleModelChange = (modelId: string) => {
const selected = models.value.find(m => m.id === modelId); const selected = models.value.find(m => m.id === modelId);
if (selected) { if (selected) {
console.log('=== 切换模型 ===', selected.name);
currentModel.value = selected; currentModel.value = selected;
// 清空图片相关数据 // 清空图片相关数据
uploadedFiles.value = {}; uploadedFiles.value = {};
@ -454,8 +452,6 @@ const handleFileChange = (file: UploadFile, fieldName: string) => {
const base64 = e.target?.result as string; const base64 = e.target?.result as string;
uploadedFiles.value[fieldName] = base64; uploadedFiles.value[fieldName] = base64;
uploadedFileNames.value[fieldName] = fileName; uploadedFileNames.value[fieldName] = fileName;
console.log('=== 上传图片 ===', { fieldName, fileName, base64Length: base64.length });
ElMessage.success('上传成功'); ElMessage.success('上传成功');
}; };
reader.readAsDataURL(rawFile); reader.readAsDataURL(rawFile);
@ -468,8 +464,6 @@ const handleFileChange = (file: UploadFile, fieldName: string) => {
const handleRemove = (fieldName: string) => { const handleRemove = (fieldName: string) => {
uploadedFiles.value[fieldName] = ''; uploadedFiles.value[fieldName] = '';
uploadedFileNames.value[fieldName] = ''; uploadedFileNames.value[fieldName] = '';
console.log('=== 删除图片 ===', fieldName);
ElMessage.info('已移除图片'); ElMessage.info('已移除图片');
}; };
@ -508,7 +502,6 @@ const buildSubmitParams = (): Record<string, unknown> => {
Object.keys(uploadedFiles.value).forEach(key => { Object.keys(uploadedFiles.value).forEach(key => {
if (uploadedFiles.value[key]) { if (uploadedFiles.value[key]) {
baseParams[key] = uploadedFiles.value[key]; baseParams[key] = uploadedFiles.value[key];
console.log('提交字段:', key, 'Base64长度:', uploadedFiles.value[key].length);
} }
}); });
@ -524,7 +517,6 @@ const buildSubmitParams = (): Record<string, unknown> => {
} }
}); });
console.log('=== 构建提交参数 ===', baseParams);
return baseParams; return baseParams;
}; };
@ -565,8 +557,6 @@ const generate = async (): Promise<boolean> => {
const params = buildSubmitParams(); const params = buildSubmitParams();
const res = (await imagetovideo(params)) as TextVideoResponse; const res = (await imagetovideo(params)) as TextVideoResponse;
console.log('=== 图生视频接口响应 ===', res);
const taskid = res.data?.taskid || res.taskid; const taskid = res.data?.taskid || res.taskid;
if (res.status === 'created' || res.status === 'processing' || res.status === 'queueing' || res.status === 'CREATED') { if (res.status === 'created' || res.status === 'processing' || res.status === 'queueing' || res.status === 'CREATED') {
@ -600,7 +590,6 @@ const generate = async (): Promise<boolean> => {
* 重置表单(清空输入、图片、配置恢复默认) * 重置表单(清空输入、图片、配置恢复默认)
*/ */
const resetForm = () => { const resetForm = () => {
console.log('=== 重置表单 ===');
prompt.value = ''; prompt.value = '';
uploadedFiles.value = {}; uploadedFiles.value = {};
uploadedFileNames.value = {}; uploadedFileNames.value = {};

View File

@ -190,7 +190,7 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { ref, computed, watch, defineEmits } from 'vue' import { ref, computed, watch } from 'vue'
import { ElMessage } from 'element-plus' import { ElMessage } from 'element-plus'
import { Delete, ZoomIn } from '@element-plus/icons-vue' import { Delete, ZoomIn } from '@element-plus/icons-vue'
@ -251,8 +251,7 @@ watch(promptText, (newText) => {
}) })
// 统一 change 事件 // 统一 change 事件
const handleChange = (value: string) => { const handleChange = () => {
console.log('selected', value)
} }
// 处理文本输入变化 // 处理文本输入变化
@ -346,7 +345,6 @@ const handleVideoChange = async (file: File) => {
const base64 = await readFileAsBase64(file) const base64 = await readFileAsBase64(file)
videoBase64.value = base64 videoBase64.value = base64
videoMimeType.value = file.type videoMimeType.value = file.type
console.log('视频上传成功,Base64长度:', base64.length)
ElMessage.success('视频上传成功') ElMessage.success('视频上传成功')
} catch (error) { } catch (error) {
console.error('视频上传失败:', error) console.error('视频上传失败:', error)
@ -370,7 +368,6 @@ const handleImageChange = async (file: File) => {
const base64 = await readFileAsBase64(file) const base64 = await readFileAsBase64(file)
imageBase64.value = base64 imageBase64.value = base64
imageMimeType.value = file.type imageMimeType.value = file.type
console.log('图片上传成功,Base64长度:', base64.length)
ElMessage.success('图片上传成功') ElMessage.success('图片上传成功')
} catch (error) { } catch (error) {
console.error('图片上传失败:', error) console.error('图片上传失败:', error)
@ -400,36 +397,33 @@ const handlePreview = (type: 'video' | 'image') => {
dialogVisible.value = true dialogVisible.value = true
} }
// 构建提交参数 // // 构建提交参数
const buildSubmitParams = () => { // const buildSubmitParams = () => {
const params: Record<string, any> = { // const params: Record<string, any> = {
llmid: selectModel.value, // llmid: selectModel.value,
prompt: promptText.value, // prompt: promptText.value,
duration: selectedDuration.value, // duration: selectedDuration.value,
voice: selectVoice.value, // voice: selectVoice.value,
quality: selectQuality.value, // quality: selectQuality.value,
codec: selectCodec.value, // codec: selectCodec.value,
ratio: selectRatio.value, // ratio: selectRatio.value,
count: selectedCount.value, // count: selectedCount.value,
} // }
// 添加视频base64 // // 添加视频base64
if (videoBase64.value) { // if (videoBase64.value) {
params.video = videoBase64.value // params.video = videoBase64.value
params.videoMimeType = videoMimeType.value // params.videoMimeType = videoMimeType.value
console.log('添加视频参数,Base64长度:', videoBase64.value.length) // }
}
// 添加图片base64 // // 添加图片base64
if (imageBase64.value) { // if (imageBase64.value) {
params.image = imageBase64.value // params.image = imageBase64.value
params.imageMimeType = imageMimeType.value // params.imageMimeType = imageMimeType.value
console.log('添加图片参数,Base64长度:', imageBase64.value.length) // }
}
console.log('提交参数:', JSON.stringify(params, null, 2)) // return params
return params // }
}
// 生成视频 // 生成视频
const generate = async () => { const generate = async () => {
@ -439,9 +433,8 @@ const generate = async () => {
} }
try { try {
const params = buildSubmitParams() // const params = buildSubmitParams()
// TODO: 调用实际的生成接口 // TODO: 调用实际的生成接口
console.log('生成参数:', params)
ElMessage.success('生成任务已提交') ElMessage.success('生成任务已提交')
return true return true
} catch (error) { } catch (error) {

View File

@ -375,24 +375,16 @@ const generate = async (): Promise<boolean> => {
try { try {
const params = buildSubmitParams(); const params = buildSubmitParams();
const res = (await textvideo(params)) as TextVideoResponse; const res = (await textvideo(params)) as TextVideoResponse;
console.log('=== 文生视频接口响应 ===');
console.log('响应状态:', res.status);
console.log('响应数据:', res.data);
console.log('完整响应:', res);
// 尝试从多个位置获取 taskid // 尝试从多个位置获取 taskid
let taskid = res.data?.taskid || res.taskid; let taskid = res.data?.taskid || res.taskid;
console.log('提取的 taskid:', taskid);
if (res.status === 'created' || res.status === 'processing' || res.status === 'queueing') { if (res.status === 'created' || res.status === 'processing' || res.status === 'queueing') {
const statusMsg = res.status === 'created' ? '视频生成任务已提交' : (res.status === 'processing' ? '进行中' : '排队中'); const statusMsg = res.status === 'created' ? '视频生成任务已提交' : (res.status === 'processing' ? '进行中' : '排队中');
ElMessage.success(`${statusMsg},请稍后在任务列表中查看`); ElMessage.success(`${statusMsg},请稍后在任务列表中查看`);
if (taskid) { if (taskid) {
console.log('触发 task-created 事件, taskid:', taskid);
emit('task-created', taskid); emit('task-created', taskid);
console.log('task-created 事件已发送');
} else { } else {
console.warn('响应中没有 taskid,尝试使用其他方式获取'); console.warn('响应中没有 taskid,尝试使用其他方式获取');
// 如果响应中没有 taskid,可能需要从其他字段获取 // 如果响应中没有 taskid,可能需要从其他字段获取

View File

@ -161,29 +161,18 @@ const handleCreate = debounce(async () => {
const emit = defineEmits<{ (e: 'task-created', taskid: string): void }>(); const emit = defineEmits<{ (e: 'task-created', taskid: string): void }>();
const handleTaskCreated = (taskid: string) => { const handleTaskCreated = (taskid: string) => {
console.log('=== VideoLeft: 接收到 task-created 事件 ===');
console.log('taskid:', taskid);
console.log('向上传递给父组件...');
emit('task-created', taskid); emit('task-created', taskid);
console.log('=== VideoLeft: 重置表单 ===');
switch (activeTab.value) { switch (activeTab.value) {
case 'text': case 'text':
console.log('重置文生视频表单');
textVideoRef.value?.resetForm?.(); textVideoRef.value?.resetForm?.();
break; break;
case 'image': case 'image':
console.log('重置图生视频表单');
imgVideoRef.value?.resetForm?.(); imgVideoRef.value?.resetForm?.();
break; break;
case 'reference': case 'reference':
console.log('重置参考生视频表单');
referenceVideoRef.value?.resetForm?.(); referenceVideoRef.value?.resetForm?.();
break; break;
} }
console.log('=== VideoLeft: handleTaskCreated 完成 ===');
}; };
// 路由同步 // 路由同步

View File

@ -84,6 +84,7 @@ const router = createRouter({
name: 'material-square', name: 'material-square',
component: () => import('@/views/videoGenerate/videoGenerate.vue') component: () => import('@/views/videoGenerate/videoGenerate.vue')
}, },
// apikey // apikey
{ {
path: '/apikey', path: '/apikey',

View File

@ -28,7 +28,8 @@ export const useLoginStore = defineStore(
// 开户 // 开户
const openAccounts = async () => { const openAccounts = async () => {
const res = await openAccount(); const res = await openAccount();
console.log('开户', res); console.log('开户',res);
}; };
// 清除自动登出计时器 // 清除自动登出计时器
@ -43,7 +44,6 @@ export const useLoginStore = defineStore(
const startAutoLogoutTimer = () => { const startAutoLogoutTimer = () => {
clearAutoLogoutTimer(); clearAutoLogoutTimer();
if (!loginTimestamp.value) { if (!loginTimestamp.value) {
console.log('没有登录时间戳,不启动计时器');
return; return;
} }
@ -51,10 +51,7 @@ export const useLoginStore = defineStore(
const elapsed = now - loginTimestamp.value; const elapsed = now - loginTimestamp.value;
const remaining = Math.max(0, 20 * 60 * 1000 - elapsed); const remaining = Math.max(0, 20 * 60 * 1000 - elapsed);
console.log('启动自动登出计时器,剩余时间(毫秒):', remaining);
autoLogoutTimer = setTimeout(() => { autoLogoutTimer = setTimeout(() => {
console.log('计时器触发,执行自动登出');
logoutS(); logoutS();
}, remaining); }, remaining);
}; };
@ -110,7 +107,6 @@ export const useLoginStore = defineStore(
return doLogin({ ...params, selected_id: selectedId }); return doLogin({ ...params, selected_id: selectedId });
}; };
const logoutS = () => { const logoutS = () => {
console.log('自动登出触发');
// 保存当前路径 // 保存当前路径
redirectPath.value = router.currentRoute.value.path; redirectPath.value = router.currentRoute.value.path;
clearAutoLogoutTimer(); clearAutoLogoutTimer();
@ -135,12 +131,9 @@ export const useLoginStore = defineStore(
// 初始化自动登出(页面刷新后调用,恢复计时器) // 初始化自动登出(页面刷新后调用,恢复计时器)
const initAutoLogout = () => { const initAutoLogout = () => {
console.log('初始化自动登出,当前登录状态:', isLoggedIn.value);
console.log('登录时间戳:', loginTimestamp.value);
if (isLoggedIn.value) { if (isLoggedIn.value) {
// 如果没有时间戳(可能因为持久化缺少),用当前时间作为基准 // 如果没有时间戳(可能因为持久化缺少),用当前时间作为基准
if (!loginTimestamp.value) { if (!loginTimestamp.value) {
console.log('没有登录时间戳,使用当前时间作为基准');
loginTimestamp.value = Date.now(); loginTimestamp.value = Date.now();
} }
startAutoLogoutTimer(); startAutoLogoutTimer();

View File

@ -41,7 +41,6 @@ export function deleteCookie(name: string): void {
* 调试:打印所有可读 Cookie(非 HttpOnly) * 调试:打印所有可读 Cookie(非 HttpOnly)
*/ */
export function logAllCookies(): void { export function logAllCookies(): void {
console.log('当前可读 Cookie 原始字符串:', document.cookie || '(空)');
if (!document.cookie) return; if (!document.cookie) return;
const cookies = document.cookie.split('; ').reduce((acc, item) => { const cookies = document.cookie.split('; ').reduce((acc, item) => {
const eqIndex = item.indexOf('='); const eqIndex = item.indexOf('=');

View File

@ -21,12 +21,6 @@ const shouldIncludeCredentials = (url?: string, baseURL?: string) => {
// 添加请求拦截器 // 添加请求拦截器
axios.interceptors.request.use( axios.interceptors.request.use(
function (config) { function (config) {
// console.log('=== 请求拦截器 ===')
// console.log('请求 URL:', config)
// console.log('请求方法:', config.method)
// console.log('请求参数 (params):', config.params)
// console.log('请求数据 (data):', config.data)
// console.log('请求头:', config.headers)
config.baseURL = apiBaseURL config.baseURL = apiBaseURL
config.withCredentials = shouldIncludeCredentials(config.url, config.baseURL) config.withCredentials = shouldIncludeCredentials(config.url, config.baseURL)
return config return config
@ -122,8 +116,6 @@ export const uploadFile = async (file: File, uploadUrl: string, additionalData:
} }
}); });
console.log("000", response.data);
return response.data; return response.data;
} catch (error) { } catch (error) {
console.error('文件上传失败:', error); console.error('文件上传失败:', error);

View File

@ -301,6 +301,43 @@ onMounted(() => {
</style> </style>
<style lang='less'> <style lang='less'>
.apikey-table.el-table {
--el-table-bg-color: #1e2024;
--el-table-tr-bg-color: #1e2024;
--el-table-row-hover-bg-color: #25282e;
--el-table-current-row-bg-color: #25282e;
--el-table-header-bg-color: #1e2024;
--el-table-border-color: #2a2d32;
--el-table-text-color: rgba(255, 255, 255, 0.88);
--el-table-header-text-color: rgba(255, 255, 255, 0.75);
--el-table-fixed-box-shadow: none;
background: #1e2024;
}
.apikey-table.el-table::before,
.apikey-table .el-table__inner-wrapper::before,
.apikey-table .el-table__fixed-right-patch {
background-color: transparent !important;
}
.apikey-table .el-table__header-wrapper,
.apikey-table .el-table__body-wrapper,
.apikey-table .el-table__inner-wrapper,
.apikey-table .el-table__fixed,
.apikey-table .el-table__fixed-right,
.apikey-table td.el-table__cell,
.apikey-table th.el-table__cell {
background: #1e2024 !important;
}
.apikey-table .el-table__row--striped td.el-table__cell {
background: #1a1c20 !important;
}
.apikey-table .el-table__row:hover td.el-table__cell {
background: #25282e !important;
}
.custom-select-popup { .custom-select-popup {
background-color: #2A2D34 !important; background-color: #2A2D34 !important;
border-radius: 12px !important; border-radius: 12px !important;

View File

@ -176,7 +176,6 @@ const updatePaginatedList = () => {
const status = (order.status || '').toUpperCase(); const status = (order.status || '').toUpperCase();
return status === statusFilter.value.toUpperCase(); return status === statusFilter.value.toUpperCase();
}); });
console.log('状态筛选 - 筛选条件:', statusFilter.value, '筛选后数量:', filteredList.length);
} }
// 更新总数为筛选后的数量 // 更新总数为筛选后的数量
@ -193,7 +192,6 @@ const updatePaginatedList = () => {
const endIndex = startIndex + pageSize.value; const endIndex = startIndex + pageSize.value;
orderList.value = filteredList.slice(startIndex, endIndex); orderList.value = filteredList.slice(startIndex, endIndex);
console.log('前端分页 - 从索引', startIndex, '到', endIndex, '显示', orderList.value.length, '条数据', '总数:', total.value);
}; };
// ==================== 事件处理 ==================== // ==================== 事件处理 ====================
@ -260,7 +258,6 @@ const getStatusClass = (status: string): string => {
* 每页条数变化 * 每页条数变化
*/ */
const handleSizeChange = (size: number) => { const handleSizeChange = (size: number) => {
console.log('分页大小变化:', size);
pageSize.value = size; pageSize.value = size;
currentPage.value = 1; // 切换每页条数通常重置为第一页 currentPage.value = 1; // 切换每页条数通常重置为第一页
updatePaginatedList(); // 前端分页,更新显示数据 updatePaginatedList(); // 前端分页,更新显示数据
@ -270,7 +267,6 @@ const handleSizeChange = (size: number) => {
* 当前页码变化 * 当前页码变化
*/ */
const handleCurrentChange = (page: number) => { const handleCurrentChange = (page: number) => {
console.log('页码变化:', page);
currentPage.value = page; currentPage.value = page;
updatePaginatedList(); // 前端分页,更新显示数据 updatePaginatedList(); // 前端分页,更新显示数据
}; };
@ -295,30 +291,18 @@ const loadOrderList = async () => {
isLoading.value = true; isLoading.value = true;
try { try {
console.log('=== 开始加载订单列表 ===');
// 不传递分页参数,获取所有数据 // 不传递分页参数,获取所有数据
const res = await consumptionRecord<any, any>({}); const res = await consumptionRecord<any, any>({});
console.log('=== API响应 ===');
console.log('完整响应:', res);
console.log('响应状态:', res.status);
console.log('响应数据:', res.data);
if (res.status === 'ok' && res.data) { if (res.status === 'ok' && res.data) {
const rawData = res.data.rows || []; const rawData = res.data.rows || [];
allOrderList.value = rawData; // 存储所有数据 allOrderList.value = rawData; // 存储所有数据
total.value = rawData.length || 0; // 使用实际数据长度作为总数 total.value = rawData.length || 0; // 使用实际数据长度作为总数
console.log('=== 处理结果 ===');
console.log('原始数据长度:', rawData.length);
console.log('总数:', total.value);
// 更新当前页显示的数据 // 更新当前页显示的数据
updatePaginatedList(); updatePaginatedList();
} else { } else {
resetOrderState(); resetOrderState();
console.log('API返回非ok状态或无数据');
} }
} catch (error) { } catch (error) {
console.error('=== 获取消费记录失败 ==='); console.error('=== 获取消费记录失败 ===');

View File

@ -27,7 +27,7 @@ import Top from '@/components/index/top.vue'
import AI from '@/components/index/AIMode.vue' import AI from '@/components/index/AIMode.vue'
import StencilTabs from '@/components/index/StencilTabs.vue' import StencilTabs from '@/components/index/StencilTabs.vue'
import StencilWaterfall from '@/components/index/StencilWaterfall.vue' import StencilWaterfall from '@/components/index/StencilWaterfall.vue'
import type { StencilItem } from '@/types/home' // import type { StencilItem } from '@/types/home'
const activeTab = ref('mixed') // 默认推荐 const activeTab = ref('mixed') // 默认推荐
@ -35,12 +35,12 @@ const handleTabChange = (tabType: string) => {
activeTab.value = tabType activeTab.value = tabType
} }
const handleLike = (item: StencilItem) => { const handleLike = () => {
console.log('点赞', item)
} }
const handleMakeSame = (item: StencilItem) => { const handleMakeSame = () => {
console.log('做同款', item)
} }
// ===== 吸顶逻辑(示例,可根据实际滚动容器调整)===== // ===== 吸顶逻辑(示例,可根据实际滚动容器调整)=====

View File

@ -201,7 +201,7 @@ const doSubmitForm = async () => {
if (!formRef.value) return; if (!formRef.value) return;
if (loading.value) return; if (loading.value) return;
await formRef.value.validate(async (valid, fields) => { await formRef.value.validate(async (valid) => {
if (valid) { if (valid) {
loading.value = true; loading.value = true;
try { try {
@ -218,7 +218,6 @@ const doSubmitForm = async () => {
loading.value = false; loading.value = false;
} }
} else { } else {
console.log('验证失败:', fields);
ElMessage.error('请正确填写表单'); ElMessage.error('请正确填写表单');
} }
}); });

View File

@ -13,20 +13,13 @@ import { ref } from 'vue';
import VideoLeft from '@/components/video/VideoLeft.vue'; import VideoLeft from '@/components/video/VideoLeft.vue';
import RightResult from '@/components/RightResult/RightResult.vue'; import RightResult from '@/components/RightResult/RightResult.vue';
const videoLeftRef = ref<InstanceType<typeof VideoLeft> | null>(null); // const videoLeftRef = ref<InstanceType<typeof VideoLeft> | null>(null);
const rightResultRef = ref<InstanceType<typeof RightResult> | null>(null); const rightResultRef = ref<InstanceType<typeof RightResult> | null>(null);
// 处理任务创建事件,刷新任务列表 // 处理任务创建事件,刷新任务列表
const handleTaskCreated = (taskid: string) => { const handleTaskCreated = () => {
console.log('=== 任务创建事件被触发 ===');
console.log('taskid:', taskid);
console.log('rightResultRef.value:', rightResultRef.value);
console.log('refreshTaskList 方法:', rightResultRef.value?.refreshTaskList);
if (rightResultRef.value && typeof rightResultRef.value.refreshTaskList === 'function') { if (rightResultRef.value && typeof rightResultRef.value.refreshTaskList === 'function') {
console.log('开始刷新任务列表...');
rightResultRef.value.refreshTaskList(); rightResultRef.value.refreshTaskList();
console.log('任务列表刷新完成');
} else { } else {
console.error('refreshTaskList 方法不存在或不可用'); console.error('refreshTaskList 方法不存在或不可用');
} }