增加用户中心、用户注册登录

This commit is contained in:
jiangh277
2025-12-26 15:12:49 +08:00
parent 1eb1dafe1e
commit 07e011febd
43 changed files with 2006 additions and 611 deletions

View File

@@ -1,9 +1,12 @@
// src/pages/gallery/components/GridView.tsx
// src/pages/gallery\components\GridView.tsx
import { ImageItem } from '@/pages/gallery/typings';
import { DeleteOutlined, DownloadOutlined, EyeOutlined, MoreOutlined } from '@ant-design/icons';
import { DeleteOutlined, DownloadOutlined, EyeOutlined, MoreOutlined, LoadingOutlined } from '@ant-design/icons';
import { Button, Checkbox, Dropdown, Menu, Spin } from 'antd';
import React, { FC, useCallback } from 'react';
import React, { FC, useCallback, useState, useEffect } from 'react';
import useAuthImageUrls from '@/components/Hooks/useAuthImageUrls';
import { fetchImage } from '@/services/file/api';
import '../index.css';
import { getAuthization } from '@/utils/userUtils';
interface GridViewProps {
imageList: ImageItem[];
@@ -78,13 +81,13 @@ const GridView: FC<GridViewProps> = ({
);
// 根据视图模式确定图像 URL
const getImageUrl = (instanceId: string) => {
// 小图模式使用低分辨率图像
if (viewMode === 'small') {
return `/file/image-low-res/${instanceId}`;
const getImageUrl = (instanceId: string, isHighRes?: boolean) => {
// 小图模式使用低分辨率图像,除非明确要求高清
if (viewMode === 'small' && !isHighRes) {
return `/file/image-low-res/${instanceId}?Authorization=${getAuthization()}`;
}
// 其他模式使用原图
return `/file/image/${instanceId}`;
return `/file/image/${instanceId}?Authorization=${getAuthization()}`;
};
return (
@@ -106,10 +109,14 @@ const GridView: FC<GridViewProps> = ({
style={{
width: imageSize.width,
height: imageSize.height,
backgroundImage: `url(${getImageUrl(item.instanceId)})`,
backgroundImage: `url(${getImageUrl(item.instanceId, false)})`,
backgroundSize: 'cover',
backgroundPosition: 'center',
backgroundRepeat: 'no-repeat',
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
position: 'relative',
}}
onClick={() => !batchMode && onPreview(index)}
/>
@@ -132,4 +139,4 @@ const GridView: FC<GridViewProps> = ({
);
};
export default GridView;
export default GridView;