From 72772b4d5ef4aabdda77009b69561e7e498d3d32 Mon Sep 17 00:00:00 2001 From: mei Date: Sat, 30 Nov 2024 12:39:32 +0800 Subject: [PATCH] update --- .env.example | 3 ++- app/layout.tsx | 6 +++++- app/page.tsx | 4 ++-- app/s/[shortCode]/page.tsx | 4 ++-- auto.sh | 4 +++- env.d.ts | 6 ++++++ 6 files changed, 20 insertions(+), 7 deletions(-) create mode 100644 env.d.ts diff --git a/.env.example b/.env.example index 9a4cc7b..6ff2656 100644 --- a/.env.example +++ b/.env.example @@ -1 +1,2 @@ -NEXT_PUBLIC_BASE_URL=https://u.mei.lv \ No newline at end of file +NEXT_PUBLIC_BASE_URL=https://example.net +NEXT_PUBLIC_ADMIN_EMAIL=example@example.com \ No newline at end of file diff --git a/app/layout.tsx b/app/layout.tsx index acce447..fe34cb2 100755 --- a/app/layout.tsx +++ b/app/layout.tsx @@ -14,8 +14,12 @@ const geistMono = localFont({ }); export const metadata: Metadata = { - title: "Url Shortener", + title: "URL Shortener", description: "缩短你的长链接!", + keywords: ['短链接', '长链接', '缩短URL', '缩短长链接', '长链接缩短', '短链', 'Url Shortener'], + authors: [{ name: 'mei' }], + creator: 'mei', + publisher: 'mei', }; export default function RootLayout({ diff --git a/app/page.tsx b/app/page.tsx index 54c5e58..b058d17 100755 --- a/app/page.tsx +++ b/app/page.tsx @@ -11,8 +11,8 @@ export default function Home() {

注册时填写优惠码 cat ,享更多优惠!

违规举报:{' '} - - i@mei.lv + + ${process.env.NEXT_PUBLIC_ADMIN_EMAIL}

diff --git a/app/s/[shortCode]/page.tsx b/app/s/[shortCode]/page.tsx index 5547545..f8b6091 100755 --- a/app/s/[shortCode]/page.tsx +++ b/app/s/[shortCode]/page.tsx @@ -183,8 +183,8 @@ export default function RedirectPage({ params }: { params: { shortCode: string }

违规举报:{' '} - - i@mei.lv + + ${process.env.NEXT_PUBLIC_ADMIN_EMAIL}

diff --git a/auto.sh b/auto.sh index de96b57..854773b 100644 --- a/auto.sh +++ b/auto.sh @@ -42,6 +42,7 @@ while true; do break done echo -e "\e[32m您输入的域名是: $DomainName\033[0m" +read -p "您的邮箱: " email if [ -z "$InstallDir" ]; then InstallDir="/opt/url-shortener" fi @@ -69,7 +70,8 @@ if [ $? -ne 0 ]; then echo -e "\e[31m下载 docker-compose.yaml 文件失败,请检查网络连接\033[0m" exit 1 fi -echo "NEXT_PUBLIC_BASE_URL=$DomainName" > "$InstallDir/short-url/.env" +echo "NEXT_PUBLIC_BASE_URL=$DomainName +NEXT_PUBLIC_ADMIN_EAMIL=$email" > "$InstallDir/short-url/.env" if [ $? -ne 0 ]; then echo -e "\e[31m创建 .env 文件失败\033[0m" exit 1 diff --git a/env.d.ts b/env.d.ts new file mode 100644 index 0000000..f16b5c3 --- /dev/null +++ b/env.d.ts @@ -0,0 +1,6 @@ +declare namespace NodeJS { + interface ProcessEnv { + NEXT_PUBLIC_ADMIN_EMAIL: string; + NEXT_PUBLIC_ADMIN_EMAIL: string; + } +} \ No newline at end of file