From b449d87252f0f72e2811780b1c5b6f9c902ef754 Mon Sep 17 00:00:00 2001 From: sijinhui Date: Thu, 9 May 2024 11:23:47 +0800 Subject: [PATCH] opt cdn --- app/components/emoji.tsx | 3 ++- app/components/reward.tsx | 2 +- app/layout.tsx | 15 +++++++++++++-- app/store/prompt.ts | 5 +++-- app/styles/globals.scss | 14 +++++++------- public/site.webmanifest | 6 +++--- 6 files changed, 29 insertions(+), 16 deletions(-) diff --git a/app/components/emoji.tsx b/app/components/emoji.tsx index 9321b5afd..b3d55a896 100644 --- a/app/components/emoji.tsx +++ b/app/components/emoji.tsx @@ -14,7 +14,8 @@ export function getEmojiUrl(unified: string, style: EmojiStyle) { // Old CDN broken, so I had to switch to this one // Author: https://github.com/H0llyW00dzZ // return `https://fastly.jsdelivr.net/npm/emoji-datasource-apple/img/${style}/64/${unified}.png`; - return `https://cdn.bootcdn.net/ajax/libs/emoji-datasource-apple/15.1.2/img/${style}/64/${unified}.png`; + // return `https://cdn.bootcdn.net/ajax/libs/emoji-datasource-apple/15.1.2/img/${style}/64/${unified}.png`; + return `https://cdn.staticfile.net/emoji-datasource-apple/15.0.1/img/${style}/64/${unified}.png`; } export function AvatarPicker(props: { diff --git a/app/components/reward.tsx b/app/components/reward.tsx index 757e09e46..a182ae9b4 100644 --- a/app/components/reward.tsx +++ b/app/components/reward.tsx @@ -27,7 +27,7 @@ export function RewardPage() { style={{ position: "absolute", top: 0, left: 0, right: 0, bottom: 0 }} > 打赏 - - + + + {children} diff --git a/app/store/prompt.ts b/app/store/prompt.ts index d18fdc32c..00cb36aaf 100644 --- a/app/store/prompt.ts +++ b/app/store/prompt.ts @@ -159,8 +159,9 @@ export const usePromptStore = createPersistStore( onRehydrateStorage(state) { // const PROMPT_URL = "https://cos.xiaosi.cc/next/public/prompts.json"; - const PROMPT_URL = "./prompts.json"; - const GPT_PROMPT_URL = "./prompt_library.json"; + const PROMPT_URL = "https://oss.xiaosi.cc/chat/public/prompts.json"; + const GPT_PROMPT_URL = + "https://oss.xiaosi.cc/chat/public/prompt_library.json"; type PromptList = Array<[string, string]>; diff --git a/app/styles/globals.scss b/app/styles/globals.scss index 1bdaf28cf..266c08a02 100644 --- a/app/styles/globals.scss +++ b/app/styles/globals.scss @@ -381,17 +381,17 @@ pre { // url('//lib.baomitu.com/fonts/noto-sans/noto-sans-regular.svg#NotoSans') format('svg'); /* Legacy iOS */ //} -/* https://cos.xiaosi.cc/fonts/noto-sans/noto-sans-regular.svg */ +/* https://oss.xiaosi.cc/fonts/noto-sans/noto-sans-regular.svg */ @font-face { font-family: 'Noto Sans'; font-style: normal; font-weight: normal; /* regular; */ - src: url('https://cos.xiaosi.cc/fonts/noto-sans/noto-sans-regular.eot'); /* IE9 Compat Modes */ + src: url('https://oss.xiaosi.cc/fonts/noto-sans/noto-sans-regular.eot'); /* IE9 Compat Modes */ src: local('Noto Sans'), local('NotoSans-Normal'), - url('https://cos.xiaosi.cc/fonts/noto-sans/noto-sans-regular.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */ - url('https://cos.xiaosi.cc/fonts/noto-sans/noto-sans-regular.woff2') format('woff2'), /* Super Modern Browsers */ - url('https://cos.xiaosi.cc/fonts/noto-sans/noto-sans-regular.woff') format('woff'), /* Modern Browsers */ - url('https://cos.xiaosi.cc/fonts/noto-sans/noto-sans-regular.ttf') format('truetype'), /* Safari, Android, iOS */ - url('https://cos.xiaosi.cc/fonts/noto-sans/noto-sans-regular.svg#NotoSans') format('svg'); /* Legacy iOS */ + url('https://oss.xiaosi.cc/fonts/noto-sans/noto-sans-regular.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */ + url('https://oss.xiaosi.cc/fonts/noto-sans/noto-sans-regular.woff2') format('woff2'), /* Super Modern Browsers */ + url('https://oss.xiaosi.cc/fonts/noto-sans/noto-sans-regular.woff') format('woff'), /* Modern Browsers */ + url('https://oss.xiaosi.cc/fonts/noto-sans/noto-sans-regular.ttf') format('truetype'), /* Safari, Android, iOS */ + url('https://oss.xiaosi.cc/fonts/noto-sans/noto-sans-regular.svg#NotoSans') format('svg'); /* Legacy iOS */ } diff --git a/public/site.webmanifest b/public/site.webmanifest index 233c8e384..a71b87453 100644 --- a/public/site.webmanifest +++ b/public/site.webmanifest @@ -3,12 +3,12 @@ "short_name": "NextChat", "icons": [ { - "src": "https://cos.xiaosi.cc/next/public/android-chrome-192x192.png", + "src": "https://oss.xiaosi.cc/chat/public/android-chrome-192x192.png!webp", "sizes": "192x192", "type": "image/png" }, { - "src": "https://cos.xiaosi.cc/next/public/android-chrome-512x512.png", + "src": "https://oss.xiaosi.cc/chat/public/android-chrome-512x512.png!webp", "sizes": "512x512", "type": "image/png" } @@ -17,4 +17,4 @@ "theme_color": "#ffffff", "background_color": "#ffffff", "display": "standalone" -} \ No newline at end of file +}