Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[migrate] replace Azure Blob with CloudFlare R2 for File Cache #376

Merged
merged 3 commits into from
Jan 5, 2025

Conversation

TechQuery
Copy link
Member

@TechQuery TechQuery commented Dec 29, 2024

PR-376 PR-376 PR-376 Powered by Pull Request Badge

  1. [migrate] replace Azure Blob with CloudFlare R2 for File Cache (优化上传文件路径 KYS-service#9)
  2. [optimize] redirect Cache File based on Lark file tokens & extensions
  3. [optimize] use Lark Image component for all pages
  4. [fix] Member e-mail format

[optimize] redirect Cache File based on Lark file tokens & extensions

Signed-off-by: TechQuery <shiy2008@gmail.com>
@TechQuery TechQuery added the enhancement Some improvements label Dec 29, 2024
luojiyin1987
luojiyin1987 previously approved these changes Dec 29, 2024
Comment on lines +9 to +21
export const DefaultImage = process.env.NEXT_PUBLIC_LOGO!;

export function fileURLOf(field: TableCellValue, cache = false) {
if (!(field instanceof Array) || !field[0]) return field + '';

const { file_token, type } = field[0] as TableCellMedia;

let URI = `/api/Lark/file/${file_token}`;

if (cache) URI += '.' + MIME.getExtension(type);

return URI;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

可读性提高了。

Signed-off-by: TechQuery <shiy2008@gmail.com>
Signed-off-by: South Drifted <shiy2008@gmail.com>
@TechQuery TechQuery force-pushed the file-cache-migration branch from 67b43ed to 04c3f8b Compare January 5, 2025 16:24
@TechQuery TechQuery marked this pull request as ready for review January 5, 2025 16:24
@TechQuery TechQuery merged commit 4e2ae7d into main Jan 5, 2025
3 checks passed
@TechQuery TechQuery deleted the file-cache-migration branch January 5, 2025 16:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Some improvements
Projects
Development

Successfully merging this pull request may close these issues.

2 participants