4.17更新
This commit is contained in:
parent
eb6059267d
commit
5df9a86325
@ -54,6 +54,12 @@
|
||||
<div class="content unicode" style="display: block;">
|
||||
<ul class="icon_lists dib-box">
|
||||
|
||||
<li class="dib">
|
||||
<span class="icon iconfont"></span>
|
||||
<div class="name">414126695</div>
|
||||
<div class="code-name">&#xe606;</div>
|
||||
</li>
|
||||
|
||||
<li class="dib">
|
||||
<span class="icon iconfont"></span>
|
||||
<div class="name">apikey</div>
|
||||
@ -186,9 +192,9 @@
|
||||
<pre><code class="language-css"
|
||||
>@font-face {
|
||||
font-family: 'iconfont';
|
||||
src: url('iconfont.woff2?t=1776308634739') format('woff2'),
|
||||
url('iconfont.woff?t=1776308634739') format('woff'),
|
||||
url('iconfont.ttf?t=1776308634739') format('truetype');
|
||||
src: url('iconfont.woff2?t=1776413178216') format('woff2'),
|
||||
url('iconfont.woff?t=1776413178216') format('woff'),
|
||||
url('iconfont.ttf?t=1776413178216') format('truetype');
|
||||
}
|
||||
</code></pre>
|
||||
<h3 id="-iconfont-">第二步:定义使用 iconfont 的样式</h3>
|
||||
@ -214,6 +220,15 @@
|
||||
<div class="content font-class">
|
||||
<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">
|
||||
<span class="icon iconfont icon-apikey"></span>
|
||||
<div class="name">
|
||||
@ -412,6 +427,14 @@
|
||||
<div class="content symbol">
|
||||
<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">
|
||||
<svg class="icon svg-icon" aria-hidden="true">
|
||||
<use xlink:href="#icon-apikey"></use>
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
@font-face {
|
||||
font-family: "iconfont"; /* Project id 5136943 */
|
||||
src: url('iconfont.woff2?t=1776308634739') format('woff2'),
|
||||
url('iconfont.woff?t=1776308634739') format('woff'),
|
||||
url('iconfont.ttf?t=1776308634739') format('truetype');
|
||||
src: url('iconfont.woff2?t=1776413178216') format('woff2'),
|
||||
url('iconfont.woff?t=1776413178216') format('woff'),
|
||||
url('iconfont.ttf?t=1776413178216') format('truetype');
|
||||
}
|
||||
|
||||
.iconfont {
|
||||
@ -13,6 +13,10 @@
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
}
|
||||
|
||||
.icon-a-414126695:before {
|
||||
content: "\e606";
|
||||
}
|
||||
|
||||
.icon-apikey:before {
|
||||
content: "\e617";
|
||||
}
|
||||
|
||||
File diff suppressed because one or more lines are too long
@ -5,6 +5,13 @@
|
||||
"css_prefix_text": "icon-",
|
||||
"description": "",
|
||||
"glyphs": [
|
||||
{
|
||||
"icon_id": "47386728",
|
||||
"name": "414126695",
|
||||
"font_class": "a-414126695",
|
||||
"unicode": "e606",
|
||||
"unicode_decimal": 58886
|
||||
},
|
||||
{
|
||||
"icon_id": "44608574",
|
||||
"name": "apikey",
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -14,7 +14,7 @@
|
||||
padding-right: 2rem;
|
||||
background: rgba(10, 12, 18, 0.74);
|
||||
backdrop-filter: blur(16px);
|
||||
border-bottom: 1px solid rgba(255, 255, 255, 0.06);
|
||||
|
||||
|
||||
@media (max-width: 768px) {
|
||||
padding: 0 1rem;
|
||||
@ -241,10 +241,13 @@
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-size: 13px;
|
||||
font-weight: 700;
|
||||
color: #fff;
|
||||
background: linear-gradient(135deg, rgba(139, 124, 255, 0.9), rgba(246, 184, 106, 0.72));
|
||||
// font-size: 50px;
|
||||
.iconfont{
|
||||
font-size: 28px;
|
||||
}
|
||||
// font-weight: 700;
|
||||
// color: #fff;
|
||||
// background: linear-gradient(135deg, rgba(139, 124, 255, 0.9), rgba(246, 184, 106, 0.72));
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
|
||||
@ -206,6 +206,35 @@
|
||||
width: 100%;
|
||||
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) {
|
||||
.el-table__header th {
|
||||
background-color: #1e2024;
|
||||
@ -227,6 +256,7 @@
|
||||
td {
|
||||
border-bottom: 1px solid #2a2d32;
|
||||
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 {
|
||||
font-family: Consolas, 'Courier New', monospace;
|
||||
font-size: 13px;
|
||||
|
||||
@ -29,8 +29,9 @@
|
||||
<!-- 用户信息 -->
|
||||
<div class="user-profile" :class="{ 'dropdown-open': userDropdownVisible }">
|
||||
<div class="user-trigger" @click="toggleUserDropdown">
|
||||
<div class="user-avatar">{{ userInitial }}</div>
|
||||
<div class="user-name">{{ loginStore.userInfo?.user?.name || loginStore.userInfo?.user?.username }}</div>
|
||||
<div class="user-avatar">
|
||||
<i class="iconfont icon-a-414126695"></i>
|
||||
</div>
|
||||
<svg class="dropdown-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
||||
<path d="M6 9l6 6 6-6" />
|
||||
</svg>
|
||||
@ -38,6 +39,10 @@
|
||||
|
||||
<Transition name="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">
|
||||
<span class="item-label">用户ID:</span>
|
||||
<span class="item-value">{{ loginStore.userInfo?.user?.id }}</span>
|
||||
@ -84,8 +89,8 @@ const showRechargeModal = ref(false);
|
||||
const userDropdownVisible = ref(false);
|
||||
// 余额
|
||||
const balances = ref(0);
|
||||
const userDisplayName = computed(() => loginStore.userInfo?.user?.name || loginStore.userInfo?.user?.username || '用户');
|
||||
const userInitial = computed(() => userDisplayName.value.trim().charAt(0).toUpperCase() || 'U');
|
||||
// const userDisplayName = computed(() => loginStore.userInfo?.user?.name || loginStore.userInfo?.user?.username || '用户');
|
||||
// const userInitial = computed(() => userDisplayName.value.trim().charAt(0).toUpperCase() || 'U');
|
||||
const formattedBalance = computed(() => Number(balances.value || 0).toLocaleString('zh-CN'));
|
||||
|
||||
// 切换下拉菜单
|
||||
@ -106,7 +111,6 @@ const handleLogout = () => {
|
||||
const getBalance = async () => {
|
||||
try {
|
||||
const res = await balance<BalanceResult>();
|
||||
console.log('用户余额:', res);
|
||||
if (res.status === 'ok') {
|
||||
balances.value = res.data[0].balance;
|
||||
}
|
||||
|
||||
@ -221,9 +221,6 @@ const confirmCustomAmount = () => {
|
||||
// 更新主弹窗选中金额
|
||||
selectedAmount.value = finalAmount;
|
||||
|
||||
// 打印参数 (自定义弹窗确定)
|
||||
console.log('[自定义充值] amount:', finalAmount);
|
||||
|
||||
// 关闭自定义弹窗
|
||||
closeCustomDialog();
|
||||
};
|
||||
@ -246,9 +243,6 @@ const handleConfirm = async () => {
|
||||
currency: 'CNY'
|
||||
};
|
||||
|
||||
// 打印参数 (主弹窗确认)
|
||||
console.log('[确认充值]', rechargeParams);
|
||||
|
||||
// 充值响应类型
|
||||
interface RechargeResponse {
|
||||
status: string;
|
||||
@ -258,7 +252,6 @@ interface RechargeResponse {
|
||||
|
||||
// 调用充值接口
|
||||
const res = await recharge<RechargeResponse, typeof rechargeParams>(rechargeParams);
|
||||
console.log('充值接口返回:', res);
|
||||
|
||||
// 处理充值结果
|
||||
if (res.status === 'ok') {
|
||||
|
||||
@ -439,23 +439,16 @@ const stopPolling = () => {
|
||||
* 从后端获取今日任务列表并转换为前端格式
|
||||
*/
|
||||
const loadTaskList = async () => {
|
||||
console.log('=== 开始加载任务列表 ===');
|
||||
|
||||
if (!isLoggedIn.value) {
|
||||
console.log('未登录,跳过加载');
|
||||
return;
|
||||
}
|
||||
|
||||
isLoading.value = true;
|
||||
try {
|
||||
console.log('正在调用 getTodayTask 接口...');
|
||||
// 调用任务列表接口
|
||||
const res = await getTodayTask<TaskResult>();
|
||||
|
||||
console.log('getTodayTask 响应:', res);
|
||||
|
||||
if (res.status === 'ok' && res.data?.tasks && Array.isArray(res.data.tasks)) {
|
||||
console.log('任务列表数据:', res.data.tasks);
|
||||
// 转换后端数据格式为前端期望的格式
|
||||
taskList.value = res.data.tasks.map((task) => {
|
||||
const output = task.ioinfo?.output || [];
|
||||
@ -477,8 +470,6 @@ const loadTaskList = async () => {
|
||||
} as TaskItem;
|
||||
});
|
||||
|
||||
console.log('转换后的任务列表:', taskList.value);
|
||||
|
||||
// 加载完成后,启动轮询(如果有进行中的任务)
|
||||
const hasProcessingTasks = taskList.value.some(task =>
|
||||
task.status === 'created' ||
|
||||
@ -487,14 +478,11 @@ const loadTaskList = async () => {
|
||||
task.status === 'running' ||
|
||||
task.status === 'PENDING'
|
||||
);
|
||||
console.log('是否有进行中的任务:', hasProcessingTasks);
|
||||
|
||||
if (hasProcessingTasks) {
|
||||
console.log('启动轮询...');
|
||||
startPolling();
|
||||
}
|
||||
} else {
|
||||
console.log('任务列表为空或格式错误');
|
||||
taskList.value = [];
|
||||
}
|
||||
} catch (error) {
|
||||
@ -502,7 +490,6 @@ const loadTaskList = async () => {
|
||||
taskList.value = [];
|
||||
} finally {
|
||||
isLoading.value = false;
|
||||
console.log('=== 任务列表加载完成 ===');
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@ -98,7 +98,7 @@ const setVideoRef = (index: number, el: HTMLVideoElement | null) => {
|
||||
const handleMouseEnter = (index: number) => {
|
||||
const video = videoRefs.value[index]
|
||||
if (video) {
|
||||
video.play().catch(err => console.log('播放失败:', err))
|
||||
video.play().catch(() => undefined)
|
||||
isVideoPlaying.value[index] = true
|
||||
}
|
||||
}
|
||||
|
||||
@ -308,7 +308,6 @@ const buildPriceParams = (): PriceQueryParams | null => {
|
||||
config_data: configDataForPrice,
|
||||
};
|
||||
|
||||
console.log('=== 构建价格查询参数 ===', priceParams);
|
||||
return priceParams;
|
||||
};
|
||||
|
||||
@ -397,7 +396,6 @@ const loadModels = async () => {
|
||||
const handleModelChange = (modelId: string) => {
|
||||
const selected = models.value.find(m => m.id === modelId);
|
||||
if (selected) {
|
||||
console.log('=== 切换模型 ===', selected.name);
|
||||
currentModel.value = selected;
|
||||
// 清空图片相关数据
|
||||
uploadedFiles.value = {};
|
||||
@ -454,8 +452,6 @@ const handleFileChange = (file: UploadFile, fieldName: string) => {
|
||||
const base64 = e.target?.result as string;
|
||||
uploadedFiles.value[fieldName] = base64;
|
||||
uploadedFileNames.value[fieldName] = fileName;
|
||||
|
||||
console.log('=== 上传图片 ===', { fieldName, fileName, base64Length: base64.length });
|
||||
ElMessage.success('上传成功');
|
||||
};
|
||||
reader.readAsDataURL(rawFile);
|
||||
@ -468,8 +464,6 @@ const handleFileChange = (file: UploadFile, fieldName: string) => {
|
||||
const handleRemove = (fieldName: string) => {
|
||||
uploadedFiles.value[fieldName] = '';
|
||||
uploadedFileNames.value[fieldName] = '';
|
||||
|
||||
console.log('=== 删除图片 ===', fieldName);
|
||||
ElMessage.info('已移除图片');
|
||||
};
|
||||
|
||||
@ -508,7 +502,6 @@ const buildSubmitParams = (): Record<string, unknown> => {
|
||||
Object.keys(uploadedFiles.value).forEach(key => {
|
||||
if (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;
|
||||
};
|
||||
|
||||
@ -565,8 +557,6 @@ const generate = async (): Promise<boolean> => {
|
||||
const params = buildSubmitParams();
|
||||
const res = (await imagetovideo(params)) as TextVideoResponse;
|
||||
|
||||
console.log('=== 图生视频接口响应 ===', res);
|
||||
|
||||
const taskid = res.data?.taskid || res.taskid;
|
||||
|
||||
if (res.status === 'created' || res.status === 'processing' || res.status === 'queueing' || res.status === 'CREATED') {
|
||||
@ -600,7 +590,6 @@ const generate = async (): Promise<boolean> => {
|
||||
* 重置表单(清空输入、图片、配置恢复默认)
|
||||
*/
|
||||
const resetForm = () => {
|
||||
console.log('=== 重置表单 ===');
|
||||
prompt.value = '';
|
||||
uploadedFiles.value = {};
|
||||
uploadedFileNames.value = {};
|
||||
|
||||
@ -190,7 +190,7 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, computed, watch, defineEmits } from 'vue'
|
||||
import { ref, computed, watch } from 'vue'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { Delete, ZoomIn } from '@element-plus/icons-vue'
|
||||
|
||||
@ -251,8 +251,7 @@ watch(promptText, (newText) => {
|
||||
})
|
||||
|
||||
// 统一 change 事件
|
||||
const handleChange = (value: string) => {
|
||||
console.log('selected', value)
|
||||
const handleChange = () => {
|
||||
}
|
||||
|
||||
// 处理文本输入变化
|
||||
@ -346,7 +345,6 @@ const handleVideoChange = async (file: File) => {
|
||||
const base64 = await readFileAsBase64(file)
|
||||
videoBase64.value = base64
|
||||
videoMimeType.value = file.type
|
||||
console.log('视频上传成功,Base64长度:', base64.length)
|
||||
ElMessage.success('视频上传成功')
|
||||
} catch (error) {
|
||||
console.error('视频上传失败:', error)
|
||||
@ -370,7 +368,6 @@ const handleImageChange = async (file: File) => {
|
||||
const base64 = await readFileAsBase64(file)
|
||||
imageBase64.value = base64
|
||||
imageMimeType.value = file.type
|
||||
console.log('图片上传成功,Base64长度:', base64.length)
|
||||
ElMessage.success('图片上传成功')
|
||||
} catch (error) {
|
||||
console.error('图片上传失败:', error)
|
||||
@ -400,36 +397,33 @@ const handlePreview = (type: 'video' | 'image') => {
|
||||
dialogVisible.value = true
|
||||
}
|
||||
|
||||
// 构建提交参数
|
||||
const buildSubmitParams = () => {
|
||||
const params: Record<string, any> = {
|
||||
llmid: selectModel.value,
|
||||
prompt: promptText.value,
|
||||
duration: selectedDuration.value,
|
||||
voice: selectVoice.value,
|
||||
quality: selectQuality.value,
|
||||
codec: selectCodec.value,
|
||||
ratio: selectRatio.value,
|
||||
count: selectedCount.value,
|
||||
}
|
||||
// // 构建提交参数
|
||||
// const buildSubmitParams = () => {
|
||||
// const params: Record<string, any> = {
|
||||
// llmid: selectModel.value,
|
||||
// prompt: promptText.value,
|
||||
// duration: selectedDuration.value,
|
||||
// voice: selectVoice.value,
|
||||
// quality: selectQuality.value,
|
||||
// codec: selectCodec.value,
|
||||
// ratio: selectRatio.value,
|
||||
// count: selectedCount.value,
|
||||
// }
|
||||
|
||||
// 添加视频base64
|
||||
if (videoBase64.value) {
|
||||
params.video = videoBase64.value
|
||||
params.videoMimeType = videoMimeType.value
|
||||
console.log('添加视频参数,Base64长度:', videoBase64.value.length)
|
||||
}
|
||||
// // 添加视频base64
|
||||
// if (videoBase64.value) {
|
||||
// params.video = videoBase64.value
|
||||
// params.videoMimeType = videoMimeType.value
|
||||
// }
|
||||
|
||||
// 添加图片base64
|
||||
if (imageBase64.value) {
|
||||
params.image = imageBase64.value
|
||||
params.imageMimeType = imageMimeType.value
|
||||
console.log('添加图片参数,Base64长度:', imageBase64.value.length)
|
||||
}
|
||||
// // 添加图片base64
|
||||
// if (imageBase64.value) {
|
||||
// params.image = imageBase64.value
|
||||
// params.imageMimeType = imageMimeType.value
|
||||
// }
|
||||
|
||||
console.log('提交参数:', JSON.stringify(params, null, 2))
|
||||
return params
|
||||
}
|
||||
// return params
|
||||
// }
|
||||
|
||||
// 生成视频
|
||||
const generate = async () => {
|
||||
@ -439,9 +433,8 @@ const generate = async () => {
|
||||
}
|
||||
|
||||
try {
|
||||
const params = buildSubmitParams()
|
||||
// const params = buildSubmitParams()
|
||||
// TODO: 调用实际的生成接口
|
||||
console.log('生成参数:', params)
|
||||
ElMessage.success('生成任务已提交')
|
||||
return true
|
||||
} catch (error) {
|
||||
|
||||
@ -375,24 +375,16 @@ const generate = async (): Promise<boolean> => {
|
||||
try {
|
||||
const params = buildSubmitParams();
|
||||
const res = (await textvideo(params)) as TextVideoResponse;
|
||||
|
||||
console.log('=== 文生视频接口响应 ===');
|
||||
console.log('响应状态:', res.status);
|
||||
console.log('响应数据:', res.data);
|
||||
console.log('完整响应:', res);
|
||||
|
||||
// 尝试从多个位置获取 taskid
|
||||
let taskid = res.data?.taskid || res.taskid;
|
||||
console.log('提取的 taskid:', taskid);
|
||||
|
||||
if (res.status === 'created' || res.status === 'processing' || res.status === 'queueing') {
|
||||
const statusMsg = res.status === 'created' ? '视频生成任务已提交' : (res.status === 'processing' ? '进行中' : '排队中');
|
||||
ElMessage.success(`${statusMsg},请稍后在任务列表中查看`);
|
||||
|
||||
if (taskid) {
|
||||
console.log('触发 task-created 事件, taskid:', taskid);
|
||||
emit('task-created', taskid);
|
||||
console.log('task-created 事件已发送');
|
||||
} else {
|
||||
console.warn('响应中没有 taskid,尝试使用其他方式获取');
|
||||
// 如果响应中没有 taskid,可能需要从其他字段获取
|
||||
|
||||
@ -161,29 +161,18 @@ const handleCreate = debounce(async () => {
|
||||
const emit = defineEmits<{ (e: 'task-created', taskid: string): void }>();
|
||||
|
||||
const handleTaskCreated = (taskid: string) => {
|
||||
console.log('=== VideoLeft: 接收到 task-created 事件 ===');
|
||||
console.log('taskid:', taskid);
|
||||
console.log('向上传递给父组件...');
|
||||
|
||||
emit('task-created', taskid);
|
||||
|
||||
console.log('=== VideoLeft: 重置表单 ===');
|
||||
switch (activeTab.value) {
|
||||
case 'text':
|
||||
console.log('重置文生视频表单');
|
||||
textVideoRef.value?.resetForm?.();
|
||||
break;
|
||||
case 'image':
|
||||
console.log('重置图生视频表单');
|
||||
imgVideoRef.value?.resetForm?.();
|
||||
break;
|
||||
case 'reference':
|
||||
console.log('重置参考生视频表单');
|
||||
referenceVideoRef.value?.resetForm?.();
|
||||
break;
|
||||
}
|
||||
|
||||
console.log('=== VideoLeft: handleTaskCreated 完成 ===');
|
||||
};
|
||||
|
||||
// 路由同步
|
||||
|
||||
@ -84,6 +84,7 @@ const router = createRouter({
|
||||
name: 'material-square',
|
||||
component: () => import('@/views/videoGenerate/videoGenerate.vue')
|
||||
},
|
||||
|
||||
// apikey
|
||||
{
|
||||
path: '/apikey',
|
||||
|
||||
@ -28,7 +28,8 @@ export const useLoginStore = defineStore(
|
||||
// 开户
|
||||
const openAccounts = async () => {
|
||||
const res = await openAccount();
|
||||
console.log('开户', res);
|
||||
console.log('开户',res);
|
||||
|
||||
};
|
||||
|
||||
// 清除自动登出计时器
|
||||
@ -43,7 +44,6 @@ export const useLoginStore = defineStore(
|
||||
const startAutoLogoutTimer = () => {
|
||||
clearAutoLogoutTimer();
|
||||
if (!loginTimestamp.value) {
|
||||
console.log('没有登录时间戳,不启动计时器');
|
||||
return;
|
||||
}
|
||||
|
||||
@ -51,10 +51,7 @@ export const useLoginStore = defineStore(
|
||||
const elapsed = now - loginTimestamp.value;
|
||||
const remaining = Math.max(0, 20 * 60 * 1000 - elapsed);
|
||||
|
||||
console.log('启动自动登出计时器,剩余时间(毫秒):', remaining);
|
||||
|
||||
autoLogoutTimer = setTimeout(() => {
|
||||
console.log('计时器触发,执行自动登出');
|
||||
logoutS();
|
||||
}, remaining);
|
||||
};
|
||||
@ -110,7 +107,6 @@ export const useLoginStore = defineStore(
|
||||
return doLogin({ ...params, selected_id: selectedId });
|
||||
};
|
||||
const logoutS = () => {
|
||||
console.log('自动登出触发');
|
||||
// 保存当前路径
|
||||
redirectPath.value = router.currentRoute.value.path;
|
||||
clearAutoLogoutTimer();
|
||||
@ -135,12 +131,9 @@ export const useLoginStore = defineStore(
|
||||
|
||||
// 初始化自动登出(页面刷新后调用,恢复计时器)
|
||||
const initAutoLogout = () => {
|
||||
console.log('初始化自动登出,当前登录状态:', isLoggedIn.value);
|
||||
console.log('登录时间戳:', loginTimestamp.value);
|
||||
if (isLoggedIn.value) {
|
||||
// 如果没有时间戳(可能因为持久化缺少),用当前时间作为基准
|
||||
if (!loginTimestamp.value) {
|
||||
console.log('没有登录时间戳,使用当前时间作为基准');
|
||||
loginTimestamp.value = Date.now();
|
||||
}
|
||||
startAutoLogoutTimer();
|
||||
|
||||
@ -41,7 +41,6 @@ export function deleteCookie(name: string): void {
|
||||
* 调试:打印所有可读 Cookie(非 HttpOnly)
|
||||
*/
|
||||
export function logAllCookies(): void {
|
||||
console.log('当前可读 Cookie 原始字符串:', document.cookie || '(空)');
|
||||
if (!document.cookie) return;
|
||||
const cookies = document.cookie.split('; ').reduce((acc, item) => {
|
||||
const eqIndex = item.indexOf('=');
|
||||
|
||||
@ -21,12 +21,6 @@ const shouldIncludeCredentials = (url?: string, baseURL?: string) => {
|
||||
// 添加请求拦截器
|
||||
axios.interceptors.request.use(
|
||||
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.withCredentials = shouldIncludeCredentials(config.url, config.baseURL)
|
||||
return config
|
||||
@ -122,8 +116,6 @@ export const uploadFile = async (file: File, uploadUrl: string, additionalData:
|
||||
}
|
||||
});
|
||||
|
||||
console.log("000", response.data);
|
||||
|
||||
return response.data;
|
||||
} catch (error) {
|
||||
console.error('文件上传失败:', error);
|
||||
|
||||
@ -301,6 +301,43 @@ onMounted(() => {
|
||||
</style>
|
||||
|
||||
<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 {
|
||||
background-color: #2A2D34 !important;
|
||||
border-radius: 12px !important;
|
||||
|
||||
@ -176,7 +176,6 @@ const updatePaginatedList = () => {
|
||||
const status = (order.status || '').toUpperCase();
|
||||
return status === statusFilter.value.toUpperCase();
|
||||
});
|
||||
console.log('状态筛选 - 筛选条件:', statusFilter.value, '筛选后数量:', filteredList.length);
|
||||
}
|
||||
|
||||
// 更新总数为筛选后的数量
|
||||
@ -193,7 +192,6 @@ const updatePaginatedList = () => {
|
||||
const endIndex = startIndex + pageSize.value;
|
||||
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) => {
|
||||
console.log('分页大小变化:', size);
|
||||
pageSize.value = size;
|
||||
currentPage.value = 1; // 切换每页条数通常重置为第一页
|
||||
updatePaginatedList(); // 前端分页,更新显示数据
|
||||
@ -270,7 +267,6 @@ const handleSizeChange = (size: number) => {
|
||||
* 当前页码变化
|
||||
*/
|
||||
const handleCurrentChange = (page: number) => {
|
||||
console.log('页码变化:', page);
|
||||
currentPage.value = page;
|
||||
updatePaginatedList(); // 前端分页,更新显示数据
|
||||
};
|
||||
@ -295,30 +291,18 @@ const loadOrderList = async () => {
|
||||
|
||||
isLoading.value = true;
|
||||
try {
|
||||
console.log('=== 开始加载订单列表 ===');
|
||||
|
||||
// 不传递分页参数,获取所有数据
|
||||
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) {
|
||||
const rawData = res.data.rows || [];
|
||||
allOrderList.value = rawData; // 存储所有数据
|
||||
total.value = rawData.length || 0; // 使用实际数据长度作为总数
|
||||
|
||||
console.log('=== 处理结果 ===');
|
||||
console.log('原始数据长度:', rawData.length);
|
||||
console.log('总数:', total.value);
|
||||
|
||||
// 更新当前页显示的数据
|
||||
updatePaginatedList();
|
||||
} else {
|
||||
resetOrderState();
|
||||
console.log('API返回非ok状态或无数据');
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('=== 获取消费记录失败 ===');
|
||||
|
||||
@ -27,7 +27,7 @@ import Top from '@/components/index/top.vue'
|
||||
import AI from '@/components/index/AIMode.vue'
|
||||
import StencilTabs from '@/components/index/StencilTabs.vue'
|
||||
import StencilWaterfall from '@/components/index/StencilWaterfall.vue'
|
||||
import type { StencilItem } from '@/types/home'
|
||||
// import type { StencilItem } from '@/types/home'
|
||||
|
||||
const activeTab = ref('mixed') // 默认推荐
|
||||
|
||||
@ -35,12 +35,12 @@ const handleTabChange = (tabType: string) => {
|
||||
activeTab.value = tabType
|
||||
}
|
||||
|
||||
const handleLike = (item: StencilItem) => {
|
||||
console.log('点赞', item)
|
||||
const handleLike = () => {
|
||||
|
||||
}
|
||||
|
||||
const handleMakeSame = (item: StencilItem) => {
|
||||
console.log('做同款', item)
|
||||
const handleMakeSame = () => {
|
||||
|
||||
}
|
||||
|
||||
// ===== 吸顶逻辑(示例,可根据实际滚动容器调整)=====
|
||||
|
||||
@ -201,7 +201,7 @@ const doSubmitForm = async () => {
|
||||
if (!formRef.value) return;
|
||||
if (loading.value) return;
|
||||
|
||||
await formRef.value.validate(async (valid, fields) => {
|
||||
await formRef.value.validate(async (valid) => {
|
||||
if (valid) {
|
||||
loading.value = true;
|
||||
try {
|
||||
@ -218,7 +218,6 @@ const doSubmitForm = async () => {
|
||||
loading.value = false;
|
||||
}
|
||||
} else {
|
||||
console.log('验证失败:', fields);
|
||||
ElMessage.error('请正确填写表单');
|
||||
}
|
||||
});
|
||||
|
||||
@ -13,20 +13,13 @@ import { ref } from 'vue';
|
||||
import VideoLeft from '@/components/video/VideoLeft.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 handleTaskCreated = (taskid: string) => {
|
||||
console.log('=== 任务创建事件被触发 ===');
|
||||
console.log('taskid:', taskid);
|
||||
console.log('rightResultRef.value:', rightResultRef.value);
|
||||
console.log('refreshTaskList 方法:', rightResultRef.value?.refreshTaskList);
|
||||
|
||||
const handleTaskCreated = () => {
|
||||
if (rightResultRef.value && typeof rightResultRef.value.refreshTaskList === 'function') {
|
||||
console.log('开始刷新任务列表...');
|
||||
rightResultRef.value.refreshTaskList();
|
||||
console.log('任务列表刷新完成');
|
||||
} else {
|
||||
console.error('refreshTaskList 方法不存在或不可用');
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user