Sfoglia il codice sorgente

屎屎屎屎屎屎屎屎屎屎屎屎屎屎屎屎屎屎

x1ongzhu 2 anni fa
parent
commit
8ce9db013e

+ 8 - 1
.vscode/settings.json

@@ -2,5 +2,12 @@
     "i18n-ally.localesPaths": [
         "src/locales"
     ],
-    "vue-i18n.i18nPaths": "src/locales"
+    "vue-i18n.i18nPaths": "src/locales",
+    "i18n-ally.displayLanguage": "zh-CN",
+    "i18n-ally.editor.preferEditor": true,
+    "i18n-ally.fullReloadOnChanged": true,
+    "i18n-ally.localeCountryMap": {
+    
+    },
+    "i18n-ally.keystyle": "nested"
 }

BIN
src/assets/icon_fanhui.png


+ 20 - 34
src/components/common/LoginForm/index.vue

@@ -4,31 +4,40 @@
             <n-form-item ref="phoneRef" path="phone" label="">
                 <n-input v-model:value="form.phone" placeholder="请输入手机号" :allow-input="onlyAllowNumber">
                     <template #prefix>
-                        <n-icon size="24" class="input-icon">
+                        <n-icon size="24" class="text-gray-900 dark:text-gray-50 mr-3">
                             <user />
                         </n-icon>
                     </template>
                 </n-input>
             </n-form-item>
-            <n-form-item path="code" label="">
-                <div class="code-wrapper">
-                    <n-input v-model:value="form.code" placeholder="请输入验证码" :allow-input="onlyAllowNumber">
+            <n-form-item path="code" label="" class="w-100">
+                <div class="flex flex-1">
+                    <n-input
+                        class="flex-1"
+                        v-model:value="form.code"
+                        placeholder="请输入验证码"
+                        :allow-input="onlyAllowNumber"
+                    >
                         <template #prefix>
-                            <n-icon size="24" class="input-icon">
+                            <n-icon size="24" class="input-icon mr-3">
                                 <Lock />
                             </n-icon>
                         </template>
                     </n-input>
-                    <n-button :disabled="countDown > 0" type="primary" secondary @click="sendVerify">
-                        {{ countDown > 0 ? `${countDown}秒后重新发送` : '发送验证码' }}
-                    </n-button>
+                    <div class="ml-3">
+                        <n-button :disabled="countDown > 0" type="primary" secondary @click="sendVerify">
+                            {{ countDown > 0 ? `${countDown}秒后重新发送` : '发送验证码' }}
+                        </n-button>
+                    </div>
                 </div>
             </n-form-item>
-            <div class="submit">
-                <n-button @click="submit" block type="primary" size="large" :loading="loading" circle> 登录 </n-button>
+            <div class="mt-3">
+                <n-button class="h-10" @click="submit" block type="primary" size="large" :loading="loading" circle>
+                    登录
+                </n-button>
             </div>
 
-            <n-el class="agree">
+            <n-el class="agree mt-5 text-center text-xs">
                 <n-checkbox v-model:checked="agree">
                     已阅读同意
                     <span class="prim" @click.stop="">《用户服务协议》</span>和
@@ -156,32 +165,9 @@ async function submit() {
 <style lang="less" scoped>
 .input-icon {
     color: var(--n-text-color) !important;
-    margin-right: 12px;
-}
-.code-wrapper {
-    display: flex;
-    align-items: center;
-    width: 100%;
-    .n-input {
-        flex: 1 1 0;
-    }
-    .n-button {
-        margin-left: 10px;
-    }
-}
-.btn-send {
-    margin-left: 20px !important;
-}
-.submit {
-    margin-top: 10px;
-    .n-button {
-        height: 40px;
-    }
 }
 .agree {
-    margin-top: 20px;
     color: var(--text-color-3);
-    text-align: center;
     :deep(.n-checkbox) {
         font-size: 12px;
         line-height: 24px;

+ 2 - 2
src/components/common/Setting/General.vue

@@ -119,7 +119,7 @@ function handleImportButtonClick(): void {
 <template>
     <div class="p-4 space-y-5 min-h-[200px]">
         <div class="space-y-6">
-            <!-- <div class="flex items-center space-x-4">
+            <div class="flex items-center space-x-4">
                 <span class="flex-shrink-0 w-[100px]">{{ $t('setting.avatarLink') }}</span>
                 <div class="flex-1">
                     <NInput v-model:value="avatar" placeholder="" />
@@ -177,7 +177,7 @@ function handleImportButtonClick(): void {
                         {{ $t('chat.clearHistoryConfirm') }}
                     </NPopconfirm>
                 </div>
-            </div> -->
+            </div>
             <div class="flex items-center space-x-4">
                 <span class="flex-shrink-0 w-[100px]">{{ $t('setting.theme') }}</span>
                 <div class="flex flex-wrap items-center gap-4">

+ 1 - 1
src/components/common/SvgIcon/index.vue

@@ -3,7 +3,7 @@ import { computed, useAttrs } from 'vue'
 import { Icon } from '@iconify/vue'
 
 interface Props {
-    icon?: string
+    icon: string
 }
 
 defineProps<Props>()

+ 1 - 1
src/components/common/UserAvatar/index.vue

@@ -32,7 +32,7 @@ const props = defineProps({
                 {{ userInfo.name ?? 'ChenZhaoYu' }}
             </h2>
             <p class="overflow-hidden text-xs text-ellipsis whitespace-nowrap">
-                <span>到期时间:2023年05月01日</span>
+                <span>2023年05月01日到期</span>
             </p>
         </div>
     </div>

+ 98 - 0
src/locales/en-US.json

@@ -0,0 +1,98 @@
+{
+    "common": {
+        "add": "Add",
+        "addSuccess": "Add Success",
+        "edit": "Edit",
+        "editSuccess": "Edit Success",
+        "delete": "Delete",
+        "deleteSuccess": "Delete Success",
+        "save": "Save",
+        "saveSuccess": "Save Success",
+        "reset": "Reset",
+        "action": "Action",
+        "export": "Export",
+        "exportSuccess": "Export Success",
+        "import": "Import",
+        "importSuccess": "Import Success",
+        "clear": "Clear",
+        "clearSuccess": "Clear Success",
+        "yes": "Yes",
+        "no": "No",
+        "confirm": "Confirm",
+        "download": "Download",
+        "noData": "No Data",
+        "wrong": "Something went wrong, please try again later.",
+        "success": "Success",
+        "failed": "Failed",
+        "verify": "Verify",
+        "unauthorizedTips": "Unauthorized, please verify first.",
+        "tips": "Tips"
+    },
+    "chat": {
+        "newChatButton": "New Chat",
+        "placeholder": "Ask me anything...(Shift + Enter = line break, \"/\" to trigger prompts)",
+        "placeholderMobile": "Ask me anything...",
+        "copy": "Copy",
+        "copied": "Copied",
+        "copyCode": "Copy Code",
+        "clearChat": "Clear Chat",
+        "clearChatConfirm": "Are you sure to clear this chat?",
+        "exportImage": "Export Image",
+        "exportImageConfirm": "Are you sure to export this chat to png?",
+        "exportSuccess": "Export Success",
+        "exportFailed": "Export Failed",
+        "usingContext": "Context Mode",
+        "turnOnContext": "In the current mode, sending messages will carry previous chat records.",
+        "turnOffContext": "In the current mode, sending messages will not carry previous chat records.",
+        "deleteMessage": "Delete Message",
+        "deleteMessageConfirm": "Are you sure to delete this message?",
+        "deleteHistoryConfirm": "Are you sure to clear this history?",
+        "clearHistoryConfirm": "Are you sure to clear chat history?",
+        "preview": "Preview",
+        "showRawText": "Show as raw text"
+    },
+    "setting": {
+        "setting": "Setting",
+        "general": "General",
+        "advanced": "Advanced",
+        "config": "Config",
+        "avatarLink": "Avatar Link",
+        "name": "Name",
+        "description": "Description",
+        "role": "Role",
+        "temperature": "Temperature",
+        "top_p": "Top_p",
+        "resetUserInfo": "Reset UserInfo",
+        "chatHistory": "ChatHistory",
+        "theme": "Theme",
+        "language": "Language",
+        "api": "API",
+        "reverseProxy": "Reverse Proxy",
+        "timeout": "Timeout",
+        "socks": "Socks",
+        "httpsProxy": "HTTPS Proxy",
+        "balance": "API Balance",
+        "monthlyUsage": "Monthly Usage"
+    },
+    "store": {
+        "siderButton": "Prompt Store",
+        "local": "Local",
+        "online": "Online",
+        "title": "Title",
+        "description": "Description",
+        "clearStoreConfirm": "Whether to clear the data?",
+        "importPlaceholder": "Please paste the JSON data here",
+        "addRepeatTitleTips": "Title duplicate, please re-enter",
+        "addRepeatContentTips": "Content duplicate: {msg}, please re-enter",
+        "editRepeatTitleTips": "Title conflict, please revise",
+        "editRepeatContentTips": "Content conflict {msg} , please re-modify",
+        "importError": "Key value mismatch",
+        "importRepeatTitle": "Title repeatedly skipped: {msg}",
+        "importRepeatContent": "Content is repeatedly skipped: {msg}",
+        "onlineImportWarning": "Note: Please check the JSON file source!",
+        "downloadError": "Please check the network status and JSON file validity"
+    },
+    "auth": {
+        "loginPrompt": "User is not logged in. Would you like to log in now?"
+    }
+}

+ 0 - 98
src/locales/en-US.ts

@@ -1,98 +0,0 @@
-export default {
-    common: {
-        add: 'Add',
-        addSuccess: 'Add Success',
-        edit: 'Edit',
-        editSuccess: 'Edit Success',
-        delete: 'Delete',
-        deleteSuccess: 'Delete Success',
-        save: 'Save',
-        saveSuccess: 'Save Success',
-        reset: 'Reset',
-        action: 'Action',
-        export: 'Export',
-        exportSuccess: 'Export Success',
-        import: 'Import',
-        importSuccess: 'Import Success',
-        clear: 'Clear',
-        clearSuccess: 'Clear Success',
-        yes: 'Yes',
-        no: 'No',
-        confirm: 'Confirm',
-        download: 'Download',
-        noData: 'No Data',
-        wrong: 'Something went wrong, please try again later.',
-        success: 'Success',
-        failed: 'Failed',
-        verify: 'Verify',
-        unauthorizedTips: 'Unauthorized, please verify first.',
-        tips: 'Tips'
-    },
-    chat: {
-        newChatButton: 'New Chat',
-        placeholder: 'Ask me anything...(Shift + Enter = line break, "/" to trigger prompts)',
-        placeholderMobile: 'Ask me anything...',
-        copy: 'Copy',
-        copied: 'Copied',
-        copyCode: 'Copy Code',
-        clearChat: 'Clear Chat',
-        clearChatConfirm: 'Are you sure to clear this chat?',
-        exportImage: 'Export Image',
-        exportImageConfirm: 'Are you sure to export this chat to png?',
-        exportSuccess: 'Export Success',
-        exportFailed: 'Export Failed',
-        usingContext: 'Context Mode',
-        turnOnContext: 'In the current mode, sending messages will carry previous chat records.',
-        turnOffContext: 'In the current mode, sending messages will not carry previous chat records.',
-        deleteMessage: 'Delete Message',
-        deleteMessageConfirm: 'Are you sure to delete this message?',
-        deleteHistoryConfirm: 'Are you sure to clear this history?',
-        clearHistoryConfirm: 'Are you sure to clear chat history?',
-        preview: 'Preview',
-        showRawText: 'Show as raw text'
-    },
-    setting: {
-        setting: 'Setting',
-        general: 'General',
-        advanced: 'Advanced',
-        config: 'Config',
-        avatarLink: 'Avatar Link',
-        name: 'Name',
-        description: 'Description',
-        role: 'Role',
-        temperature: 'Temperature',
-        top_p: 'Top_p',
-        resetUserInfo: 'Reset UserInfo',
-        chatHistory: 'ChatHistory',
-        theme: 'Theme',
-        language: 'Language',
-        api: 'API',
-        reverseProxy: 'Reverse Proxy',
-        timeout: 'Timeout',
-        socks: 'Socks',
-        httpsProxy: 'HTTPS Proxy',
-        balance: 'API Balance',
-        monthlyUsage: 'Monthly Usage'
-    },
-    store: {
-        siderButton: 'Prompt Store',
-        local: 'Local',
-        online: 'Online',
-        title: 'Title',
-        description: 'Description',
-        clearStoreConfirm: 'Whether to clear the data?',
-        importPlaceholder: 'Please paste the JSON data here',
-        addRepeatTitleTips: 'Title duplicate, please re-enter',
-        addRepeatContentTips: 'Content duplicate: {msg}, please re-enter',
-        editRepeatTitleTips: 'Title conflict, please revise',
-        editRepeatContentTips: 'Content conflict {msg} , please re-modify',
-        importError: 'Key value mismatch',
-        importRepeatTitle: 'Title repeatedly skipped: {msg}',
-        importRepeatContent: 'Content is repeatedly skipped: {msg}',
-        onlineImportWarning: 'Note: Please check the JSON file source!',
-        downloadError: 'Please check the network status and JSON file validity'
-    },
-    auth: {
-        loginPrompt: 'User is not logged in. Would you like to log in now?'
-    }
-}

+ 3 - 3
src/locales/index.ts

@@ -1,8 +1,8 @@
 import type { App } from 'vue'
 import { createI18n } from 'vue-i18n'
-import enUS from './en-US'
-import zhCN from './zh-CN'
-import zhTW from './zh-TW'
+import enUS from './en-US.json'
+import zhCN from './zh-CN.json'
+import zhTW from './zh-TW.json'
 import { useAppStoreWithOut } from '@/store/modules/app'
 import type { Language } from '@/store/modules/app/helper'
 

+ 98 - 0
src/locales/zh-CN.json

@@ -0,0 +1,98 @@
+ {
+    "common": {
+        "add": "添加",
+        "addSuccess": "添加成功",
+        "edit": "编辑",
+        "editSuccess": "编辑成功",
+        "delete": "删除",
+        "deleteSuccess": "删除成功",
+        "save": "保存",
+        "saveSuccess": "保存成功",
+        "reset": "重置",
+        "action": "操作",
+        "export": "导出",
+        "exportSuccess": "导出成功",
+        "import": "导入",
+        "importSuccess": "导入成功",
+        "clear": "清空",
+        "clearSuccess": "清空成功",
+        "yes": "是",
+        "no": "否",
+        "confirm": "确定",
+        "download": "下载",
+        "noData": "暂无数据",
+        "wrong": "好像出错了,请稍后再试。",
+        "success": "操作成功",
+        "failed": "操作失败",
+        "verify": "验证",
+        "unauthorizedTips": "未经授权,请先进行验证。",
+        "tips": "提示"
+    },
+    "chat": {
+        "newChatButton": "新建聊天",
+        "placeholder": "来说点什么吧...(Shift + Enter = 换行,\"/\" 触发提示词)",
+        "placeholderMobile": "来说点什么...",
+        "copy": "复制",
+        "copied": "复制成功",
+        "copyCode": "复制代码",
+        "clearChat": "清空会话",
+        "clearChatConfirm": "是否清空会话?",
+        "exportImage": "保存会话到图片",
+        "exportImageConfirm": "是否将会话保存为图片?",
+        "exportSuccess": "保存成功",
+        "exportFailed": "保存失败",
+        "usingContext": "上下文模式",
+        "turnOnContext": "当前模式下, 发送消息会携带之前的聊天记录",
+        "turnOffContext": "当前模式下, 发送消息不会携带之前的聊天记录",
+        "deleteMessage": "删除消息",
+        "deleteMessageConfirm": "是否删除此消息?",
+        "deleteHistoryConfirm": "确定删除此记录?",
+        "clearHistoryConfirm": "确定清空聊天记录?",
+        "preview": "预览",
+        "showRawText": "显示原文"
+    },
+    "setting": {
+        "setting": "设置",
+        "general": "总览",
+        "advanced": "高级",
+        "config": "配置",
+        "avatarLink": "头像链接",
+        "name": "名称",
+        "description": "描述",
+        "role": "角色设定",
+        "temperature": "Temperature",
+        "top_p": "Top_p",
+        "resetUserInfo": "重置用户信息",
+        "chatHistory": "聊天记录",
+        "theme": "主题",
+        "language": "语言",
+        "api": "API",
+        "reverseProxy": "反向代理",
+        "timeout": "超时",
+        "socks": "Socks",
+        "httpsProxy": "HTTPS Proxy",
+        "balance": "API余额",
+        "monthlyUsage": "本月使用量"
+    },
+    "store": {
+        "siderButton": "提示词商店",
+        "local": "本地",
+        "online": "在线",
+        "title": "标题",
+        "description": "描述",
+        "clearStoreConfirm": "是否清空数据?",
+        "importPlaceholder": "请粘贴 JSON 数据到此处",
+        "addRepeatTitleTips": "标题重复,请重新输入",
+        "addRepeatContentTips": "内容重复:{msg},请重新输入",
+        "editRepeatTitleTips": "标题冲突,请重新修改",
+        "editRepeatContentTips": "内容冲突{msg} ,请重新修改",
+        "importError": "键值不匹配",
+        "importRepeatTitle": "标题重复跳过:{msg}",
+        "importRepeatContent": "内容重复跳过:{msg}",
+        "onlineImportWarning": "注意:请检查 JSON 文件来源!",
+        "downloadError": "请检查网络状态与 JSON 文件有效性"
+    },
+    "auth": {
+        "loginPrompt": "用户未登录,是否立即登录?"
+    }
+}

+ 0 - 98
src/locales/zh-CN.ts

@@ -1,98 +0,0 @@
-export default {
-    common: {
-        add: '添加',
-        addSuccess: '添加成功',
-        edit: '编辑',
-        editSuccess: '编辑成功',
-        delete: '删除',
-        deleteSuccess: '删除成功',
-        save: '保存',
-        saveSuccess: '保存成功',
-        reset: '重置',
-        action: '操作',
-        export: '导出',
-        exportSuccess: '导出成功',
-        import: '导入',
-        importSuccess: '导入成功',
-        clear: '清空',
-        clearSuccess: '清空成功',
-        yes: '是',
-        no: '否',
-        confirm: '确定',
-        download: '下载',
-        noData: '暂无数据',
-        wrong: '好像出错了,请稍后再试。',
-        success: '操作成功',
-        failed: '操作失败',
-        verify: '验证',
-        unauthorizedTips: '未经授权,请先进行验证。',
-        tips: '提示'
-    },
-    chat: {
-        newChatButton: '新建聊天',
-        placeholder: '来说点什么吧...(Shift + Enter = 换行,"/" 触发提示词)',
-        placeholderMobile: '来说点什么...',
-        copy: '复制',
-        copied: '复制成功',
-        copyCode: '复制代码',
-        clearChat: '清空会话',
-        clearChatConfirm: '是否清空会话?',
-        exportImage: '保存会话到图片',
-        exportImageConfirm: '是否将会话保存为图片?',
-        exportSuccess: '保存成功',
-        exportFailed: '保存失败',
-        usingContext: '上下文模式',
-        turnOnContext: '当前模式下, 发送消息会携带之前的聊天记录',
-        turnOffContext: '当前模式下, 发送消息不会携带之前的聊天记录',
-        deleteMessage: '删除消息',
-        deleteMessageConfirm: '是否删除此消息?',
-        deleteHistoryConfirm: '确定删除此记录?',
-        clearHistoryConfirm: '确定清空聊天记录?',
-        preview: '预览',
-        showRawText: '显示原文'
-    },
-    setting: {
-        setting: '设置',
-        general: '总览',
-        advanced: '高级',
-        config: '配置',
-        avatarLink: '头像链接',
-        name: '名称',
-        description: '描述',
-        role: '角色设定',
-        temperature: 'Temperature',
-        top_p: 'Top_p',
-        resetUserInfo: '重置用户信息',
-        chatHistory: '聊天记录',
-        theme: '主题',
-        language: '语言',
-        api: 'API',
-        reverseProxy: '反向代理',
-        timeout: '超时',
-        socks: 'Socks',
-        httpsProxy: 'HTTPS Proxy',
-        balance: 'API余额',
-        monthlyUsage: '本月使用量'
-    },
-    store: {
-        siderButton: '提示词商店',
-        local: '本地',
-        online: '在线',
-        title: '标题',
-        description: '描述',
-        clearStoreConfirm: '是否清空数据?',
-        importPlaceholder: '请粘贴 JSON 数据到此处',
-        addRepeatTitleTips: '标题重复,请重新输入',
-        addRepeatContentTips: '内容重复:{msg},请重新输入',
-        editRepeatTitleTips: '标题冲突,请重新修改',
-        editRepeatContentTips: '内容冲突{msg} ,请重新修改',
-        importError: '键值不匹配',
-        importRepeatTitle: '标题重复跳过:{msg}',
-        importRepeatContent: '内容重复跳过:{msg}',
-        onlineImportWarning: '注意:请检查 JSON 文件来源!',
-        downloadError: '请检查网络状态与 JSON 文件有效性'
-    },
-    auth: {
-        loginPrompt: '用户未登录,是否立即登录?'
-    }
-}

+ 94 - 0
src/locales/zh-TW.json

@@ -0,0 +1,94 @@
+{
+    "common": {
+        "add": "新增",
+        "addSuccess": "新增成功",
+        "edit": "編輯",
+        "editSuccess": "編輯成功",
+        "delete": "刪除",
+        "deleteSuccess": "刪除成功",
+        "save": "儲存",
+        "saveSuccess": "儲存成功",
+        "reset": "重設",
+        "action": "操作",
+        "export": "匯出",
+        "exportSuccess": "匯出成功",
+        "import": "匯入",
+        "importSuccess": "匯入成功",
+        "clear": "清除",
+        "clearSuccess": "清除成功",
+        "yes": "是",
+        "no": "否",
+        "confirm": "確認",
+        "download": "下載",
+        "noData": "目前無資料",
+        "wrong": "發生錯誤,請稍後再試。",
+        "success": "操作成功",
+        "failed": "操作失敗",
+        "verify": "驗證",
+        "unauthorizedTips": "未經授權,請先進行驗證。"
+    },
+    "chat": {
+        "newChatButton": "新建對話",
+        "placeholder": "來說點什麼...(Shift + Enter = 換行 \"/\" 觸發提示詞)",
+        "placeholderMobile": "來說點什麼...",
+        "copy": "複製",
+        "copied": "複製成功",
+        "copyCode": "複製代碼",
+        "clearChat": "清除對話",
+        "clearChatConfirm": "是否清空對話?",
+        "exportImage": "儲存對話為圖片",
+        "exportImageConfirm": "是否將對話儲存為圖片?",
+        "exportSuccess": "儲存成功",
+        "exportFailed": "儲存失敗",
+        "usingContext": "上下文模式",
+        "turnOnContext": "啟用上下文模式,在此模式下,發送訊息會包含之前的聊天記錄。",
+        "turnOffContext": "關閉上下文模式,在此模式下,發送訊息不會包含之前的聊天記錄。",
+        "deleteMessage": "刪除訊息",
+        "deleteMessageConfirm": "是否刪除此訊息?",
+        "deleteHistoryConfirm": "確定刪除此紀錄?",
+        "clearHistoryConfirm": "確定清除紀錄?",
+        "preview": "預覽",
+        "showRawText": "顯示原文"
+    },
+    "setting": {
+        "setting": "設定",
+        "general": "總覽",
+        "advanced": "高級",
+        "config": "設定",
+        "avatarLink": "頭貼連結",
+        "name": "名稱",
+        "description": "描述",
+        "role": "角色設定",
+        "temperature": "Temperature",
+        "top_p": "Top_p",
+        "resetUserInfo": "重設使用者資訊",
+        "chatHistory": "紀錄",
+        "theme": "主題",
+        "language": "語言",
+        "api": "API",
+        "reverseProxy": "反向代理",
+        "timeout": "逾時",
+        "socks": "Socks",
+        "httpsProxy": "HTTPS Proxy",
+        "balance": "API余額",
+        "monthlyUsage": "本月使用量"
+    },
+    "store": {
+        "siderButton": "提示詞商店",
+        "local": "本機",
+        "online": "線上",
+        "title": "標題",
+        "description": "描述",
+        "clearStoreConfirm": "是否清除資料?",
+        "importPlaceholder": "請將 JSON 資料貼在此處",
+        "addRepeatTitleTips": "標題重複,請重新輸入",
+        "addRepeatContentTips": "內容重複:{msg},請重新輸入",
+        "editRepeatTitleTips": "標題衝突,請重新修改",
+        "editRepeatContentTips": "內容衝突{msg} ,請重新修改",
+        "importError": "鍵值不符合",
+        "importRepeatTitle": "因標題重複跳過:{msg}",
+        "importRepeatContent": "因內容重複跳過:{msg}",
+        "onlineImportWarning": "注意:請檢查 JSON 檔案來源!",
+        "downloadError": "請檢查網路狀態與 JSON 檔案有效性"
+    }
+}

+ 0 - 94
src/locales/zh-TW.ts

@@ -1,94 +0,0 @@
-export default {
-    common: {
-        add: '新增',
-        addSuccess: '新增成功',
-        edit: '編輯',
-        editSuccess: '編輯成功',
-        delete: '刪除',
-        deleteSuccess: '刪除成功',
-        save: '儲存',
-        saveSuccess: '儲存成功',
-        reset: '重設',
-        action: '操作',
-        export: '匯出',
-        exportSuccess: '匯出成功',
-        import: '匯入',
-        importSuccess: '匯入成功',
-        clear: '清除',
-        clearSuccess: '清除成功',
-        yes: '是',
-        no: '否',
-        confirm: '確認',
-        download: '下載',
-        noData: '目前無資料',
-        wrong: '發生錯誤,請稍後再試。',
-        success: '操作成功',
-        failed: '操作失敗',
-        verify: '驗證',
-        unauthorizedTips: '未經授權,請先進行驗證。'
-    },
-    chat: {
-        newChatButton: '新建對話',
-        placeholder: '來說點什麼...(Shift + Enter = 換行,"/" 觸發提示詞)',
-        placeholderMobile: '來說點什麼...',
-        copy: '複製',
-        copied: '複製成功',
-        copyCode: '複製代碼',
-        clearChat: '清除對話',
-        clearChatConfirm: '是否清空對話?',
-        exportImage: '儲存對話為圖片',
-        exportImageConfirm: '是否將對話儲存為圖片?',
-        exportSuccess: '儲存成功',
-        exportFailed: '儲存失敗',
-        usingContext: '上下文模式',
-        turnOnContext: '啟用上下文模式,在此模式下,發送訊息會包含之前的聊天記錄。',
-        turnOffContext: '關閉上下文模式,在此模式下,發送訊息不會包含之前的聊天記錄。',
-        deleteMessage: '刪除訊息',
-        deleteMessageConfirm: '是否刪除此訊息?',
-        deleteHistoryConfirm: '確定刪除此紀錄?',
-        clearHistoryConfirm: '確定清除紀錄?',
-        preview: '預覽',
-        showRawText: '顯示原文'
-    },
-    setting: {
-        setting: '設定',
-        general: '總覽',
-        advanced: '高級',
-        config: '設定',
-        avatarLink: '頭貼連結',
-        name: '名稱',
-        description: '描述',
-        role: '角色設定',
-        temperature: 'Temperature',
-        top_p: 'Top_p',
-        resetUserInfo: '重設使用者資訊',
-        chatHistory: '紀錄',
-        theme: '主題',
-        language: '語言',
-        api: 'API',
-        reverseProxy: '反向代理',
-        timeout: '逾時',
-        socks: 'Socks',
-        httpsProxy: 'HTTPS Proxy',
-        balance: 'API余額',
-        monthlyUsage: '本月使用量'
-    },
-    store: {
-        siderButton: '提示詞商店',
-        local: '本機',
-        online: '線上',
-        title: '標題',
-        description: '描述',
-        clearStoreConfirm: '是否清除資料?',
-        importPlaceholder: '請將 JSON 資料貼在此處',
-        addRepeatTitleTips: '標題重複,請重新輸入',
-        addRepeatContentTips: '內容重複:{msg},請重新輸入',
-        editRepeatTitleTips: '標題衝突,請重新修改',
-        editRepeatContentTips: '內容衝突{msg} ,請重新修改',
-        importError: '鍵值不符合',
-        importRepeatTitle: '因標題重複跳過:{msg}',
-        importRepeatContent: '因內容重複跳過:{msg}',
-        onlineImportWarning: '注意:請檢查 JSON 檔案來源!',
-        downloadError: '請檢查網路狀態與 JSON 檔案有效性'
-    }
-}

+ 13 - 3
src/styles/global.less

@@ -10,11 +10,11 @@ body {
 }
 
 :root {
-    --bg2:linear-gradient(136deg, #34354F10 0%, #20223C10 100%);
+    --bg2: linear-gradient(136deg, #34354f10 0%, #20223c10 100%);
 }
 
-.dark{
-    --bg2:linear-gradient(136deg, #34354F 0%, #20223C 100%);
+.dark {
+    --bg2: linear-gradient(136deg, #34354f 0%, #20223c 100%);
 }
 
 // .n-button--primary-type {
@@ -32,3 +32,13 @@ body {
     font-family: 'AlimamaShuHeiTi';
     src: url(https://cdn.raex.vip/font/2023-03-24-10-09-25HtghnVXP.ttf);
 }
+
+.text-color-1 {
+    color: var(--text-color-1);
+}
+.text-color-2 {
+    color: var(--text-color-2);
+}
+.text-color-3 {
+    color: var(--text-color-3);
+}

+ 6 - 15
src/views/chat/components/Header/index.vue

@@ -1,6 +1,6 @@
 <script lang="ts" setup>
 import { computed, nextTick } from 'vue'
-import { HoverButton, SvgIcon, UserAvatar } from '@/components/common'
+import { HoverButton, SvgIcon } from '@/components/common'
 import { useAppStore, useChatStore } from '@/store'
 
 interface Props {
@@ -10,7 +10,6 @@ interface Props {
 interface Emit {
     (ev: 'export'): void
     (ev: 'toggleUsingContext'): void
-    (ev: 'goMine'): void
 }
 
 defineProps<Props>()
@@ -36,13 +35,10 @@ function handleExport() {
     emit('export')
 }
 
-// function toggleUsingContext() {
-//     emit('toggleUsingContext')
-// }
-
-function goMine() {
-    emit('goMine')
+function toggleUsingContext() {
+    emit('toggleUsingContext')
 }
+
 </script>
 
 <template>
@@ -63,17 +59,12 @@ function goMine() {
                 {{ currentChatHistory?.title ?? '' }}
             </h1>
             <div class="flex items-center space-x-2">
-                <!-- <HoverButton @click="toggleUsingContext">
+                <HoverButton @click="toggleUsingContext">
                     <span class="text-xl" :class="{ 'text-[#4b9e5f]': usingContext, 'text-[#a8071a]': !usingContext }">
                         <SvgIcon icon="ri:chat-history-line" />
                     </span>
-                </HoverButton> -->
-
-                <HoverButton @click="goMine">
-                    <span class="text-xl">
-                        <UserAvatar avatarType="small" />
-                    </span>
                 </HoverButton>
+
                 <HoverButton @click="handleExport">
                     <span class="text-xl text-[#4f555e] dark:text-white">
                         <SvgIcon icon="ri:download-2-line" />

+ 0 - 5
src/views/chat/index.vue

@@ -412,10 +412,6 @@ const footerClass = computed(() => {
     return classes
 })
 
-function goMine() {
-    router.push('/mine')
-}
-
 onMounted(() => {
     scrollToBottom()
     if (inputRef.value && !isMobile.value) inputRef.value?.focus()
@@ -433,7 +429,6 @@ onUnmounted(() => {
             :using-context="usingContext"
             @export="handleExport"
             @toggle-using-context="toggleUsingContext"
-            @go-mine="goMine"
         />
         <main class="flex-1 overflow-hidden">
             <div id="scrollRef" ref="scrollRef" class="h-full overflow-hidden overflow-y-auto">

+ 125 - 211
src/views/page/Home.vue

@@ -1,124 +1,105 @@
 <template>
-    <NConfigProvider>
-        <n-el class="page h-full flex flex-col" :style="{ backgroundImage: `url(${isMobile ? h5Bg : pcBg})` }">
-            <n-page-header>
-                <template #title>
-                    <span class="title">CHILLGPT </span>
-                </template>
-                <template #avatar>
-                    <n-avatar :src="logo" />
-                </template>
-                <template #extra>
+    <n-el
+        class="page h-full flex flex-col bg-cover bg-center overflow-auto"
+        :style="{ backgroundImage: `url(${isMobile ? h5Bg : pcBg})` }"
+    >
+        <n-page-header>
+            <template #title>
+                <div class="flex items-center py-3 lg:py-8 pl-4 lg:pl-52">
+                    <img style="width: 34px" :src="logo" />
+                    <span class="ml-3 text-white text-sm lg:text-lg">CHILLGPT </span>
+                </div>
+            </template>
+            <template #extra>
+                <div class="flex items-center py-3 lg:py-8 pr-4 lg:pr-52">
                     <user-avatar avatarType="small" v-if="isLogin" />
                     <template v-else>
                         <n-button v-if="!isMobile" type="primary" round @click="showLogin = true"> 登录 </n-button>
                         <n-button v-else @click="$router.push('/login')">登录</n-button>
                     </template>
-                </template>
-            </n-page-header>
+                </div>
+            </template>
+        </n-page-header>
 
-            <div class="flex-1 page-content">
-                <img src="@/assets/brand.png" class="img1" alt="" />
+        <div class="flex flex-col items-center content-center flex-1 pt-4 pb-24 lg:py-32 page-content">
+            <img src="@/assets/brand.png" class="w-4/5 max-w-3xl" alt="" />
 
-                <div class="desc">
-                    ChillGPT是人工智能技术驱动的自然语言处理工具,它能够通过理解和学习人类的语言来进行对话,还能根据聊天的上下文进行互动,真正像人类一样来聊天交流,甚至能完成撰写邮件、视频脚本、文案、翻译、代码,写论文等任务。
-                </div>
+            <div class="text-sm lg:text-lg text-white text-center mt-4 w-8/12 max-w-4xl">
+                ChillGPT是人工智能技术驱动的自然语言处理工具,它能够通过理解和学习人类的语言来进行对话,还能根据聊天的上下文进行互动,真正像人类一样来聊天交流,甚至能完成撰写邮件、视频脚本、文案、翻译、代码,写论文等任务。
+            </div>
 
+            <NConfigProvider
+                v-if="!isMobile"
+                class="w-9/12 max-w-5xl mt-8"
+                :theme-overrides="{
+                    common: { cardColor: 'transparent' },
+                    Card: {
+                        paddingMedium: '0',
+                        borderRadius: '12px',
+                        borderColor: 'rgba(255, 255, 255, 0.2)'
+                    }
+                }"
+            >
                 <n-card
-                    class="vip"
+                    class="vip rounded-xl border overflow-hidden"
                     v-if="!isMobile"
-                    title="会员权益"
-                    content-style="padding:0"
-                    header-style="text-align:center;padding:0;height:44px;line-height:44px;font-size: 16px;font-family: AlimamaShuHeiTi;color:#ffffff"
+                    :content-style="{
+                        padding: 0
+                    }"
                 >
-                    <n-grid cols="2 s:3 m:4 l:7 xl:7 2xl:7" responsive="screen">
-                        <n-grid-item>
-                            <div class="vip-item">
-                                <img src="@/assets/png-01.png" alt="" />
-                                <div class="text">
-                                    <div>无限对话</div>
-                                    <div>畅快聊天</div>
-                                </div>
-                            </div>
-                        </n-grid-item>
-                        <n-grid-item>
-                            <div class="vip-item">
-                                <img src="@/assets/png-02.png" alt="" />
-                                <div class="text">
-                                    <div>推荐奖励</div>
-                                    <div>一级经销商权限</div>
-                                </div>
-                            </div>
-                        </n-grid-item>
-                        <n-grid-item>
-                            <div class="vip-item">
-                                <img src="@/assets/png-03.png" alt="" />
-                                <div class="text">
-                                    <div>空投福利</div>
-                                    <div>高价值数字藏品</div>
-                                </div>
-                            </div>
-                        </n-grid-item>
-                        <n-grid-item>
-                            <div class="vip-item">
-                                <img src="@/assets/png-04.png" alt="" />
-                                <div class="text">
-                                    <div>全线3折购</div>
-                                    <div>Chillgpt生态</div>
-                                </div>
-                            </div>
-                        </n-grid-item>
-                        <n-grid-item>
-                            <div class="vip-item">
-                                <img src="@/assets/png-05.png" alt="" />
-                                <div class="text">
-                                    <div>测试白名单</div>
-                                    <div>第一优先级</div>
-                                </div>
-                            </div>
-                        </n-grid-item>
-                        <n-grid-item>
-                            <div class="vip-item">
-                                <img src="@/assets/png-06.png" alt="" />
-                                <div class="text">
-                                    <div>Chillgpt Pix</div>
-                                    <div>六个月免费会员</div>
-                                </div>
-                            </div>
-                        </n-grid-item>
-                        <n-grid-item>
-                            <div class="vip-item">
-                                <img src="@/assets/png-07.png" alt="" />
-                                <div class="text">
-                                    <div>可申请Chillg</div>
-                                    <div>城市级节点权限</div>
+                    <div
+                        class="flex items-center justify-center h-11 text-lg text-white"
+                        style="font-family: AlimamaShuHeiTi"
+                    >
+                        会员权益
+                    </div>
+                    <n-grid cols="2 s:5 m:7" responsive="screen" class="backdrop-blur-lg">
+                        <n-grid-item v-for="item in items" :key="item.name">
+                            <div class="flex flex-col items-center pt-5 pb-7">
+                                <img class="w-11 h-11" :src="item.img" alt="" />
+                                <div class="text text-sm text-gray-50 mt-2 text-center">
+                                    <div>{{ item.name }}</div>
+                                    <div class="mt-0.5">{{ item.desc }}</div>
                                 </div>
                             </div>
                         </n-grid-item>
                     </n-grid>
                 </n-card>
-
-                <div class="flex-1" v-else></div>
-
-                <div class="btn">
-                    <n-button type="primary" block round size="large" @click="goChat"> 立即体验 </n-button>
-                </div>
-            </div>
-
-            <n-modal v-model:show="showLogin" transform-origin="center">
-                <n-card
-                    title="登录"
-                    class="login"
-                    :border="false"
-                    header-style="text-align:center;padding:30px;font-size:24px;"
-                >
-                    <div class="login-box">
+            </NConfigProvider>
+
+            <div class="flex-1" v-else></div>
+
+            <NConfigProvider
+                :theme-overrides="{
+                    Button: {
+                        heightMedium: '44px'
+                    }
+                }"
+                class="mt-16 w-5/6 sm:w-80"
+            >
+                <n-button type="primary" block round size="large" @click="goChat"> 立即体验 </n-button>
+            </NConfigProvider>
+        </div>
+
+        <NConfigProvider
+            :theme="darkTheme"
+            :theme-overrides="{
+                Card: {
+                    borderRadius: '12px'
+                }
+            }"
+            class="w-9/12 max-w-xl"
+        >
+            <n-modal v-model:show="showLogin" transform-origin="center" class="max-w-xl" style="width: 75%">
+                <n-card :border="false">
+                    <div class="text-white text-2xl text-center font-bold py-8">登录</div>
+                    <div class="max-w-sm my-5 mx-auto pb-16">
                         <login-form @success="onLogin"></login-form>
                     </div>
                 </n-card>
             </n-modal>
-        </n-el>
-    </NConfigProvider>
+        </NConfigProvider>
+    </n-el>
 </template>
 
 <script setup lang="ts">
@@ -142,12 +123,56 @@ import { useRouter } from 'vue-router'
 import { ref, computed } from 'vue'
 import { UserAvatar, LoginForm } from '@/components/common'
 import { useBasicLayout } from '@/hooks/useBasicLayout'
+import imgItem01 from '@/assets/png-01.png'
+import imgItem02 from '@/assets/png-02.png'
+import imgItem03 from '@/assets/png-03.png'
+import imgItem04 from '@/assets/png-04.png'
+import imgItem05 from '@/assets/png-05.png'
+import imgItem06 from '@/assets/png-06.png'
+import imgItem07 from '@/assets/png-07.png'
 
 const { isMobile } = useBasicLayout()
 
 const router = useRouter()
 const userStore = useUserStore()
 const showLogin = ref(false)
+const items = [
+    {
+        name: '无限对话',
+        desc: '畅快聊天',
+        img: imgItem01
+    },
+    {
+        name: '推荐奖励',
+        desc: '一级经销商权限',
+        img: imgItem02
+    },
+    {
+        name: '空投福利',
+        desc: '高价值数字藏品',
+        img: imgItem03
+    },
+    {
+        name: '全线3折购',
+        desc: 'Chillgpt生态',
+        img: imgItem04
+    },
+    {
+        name: '测试白名单',
+        desc: '第一优先级',
+        img: imgItem05
+    },
+    {
+        name: 'Chillgpt Pix',
+        desc: '六个月免费会员',
+        img: imgItem06
+    },
+    {
+        name: '可申请Chillg',
+        desc: '城市级节点权限',
+        img: imgItem07
+    }
+]
 
 const isLogin = computed(() => {
     return !!userStore.userInfo.id
@@ -172,120 +197,9 @@ function goChat() {
 </script>
 
 <style lang="less" scoped>
-.page {
-    background-size: cover;
-    background-position: center;
-    overflow: auto;
-}
-
-:deep(.n-page-header) {
-    padding: 30px 200px;
-
-    .n-avatar {
-        background-color: transparent;
-    }
-}
-
 :deep(.n-page-header-wrapper) {
     position: sticky;
     top: 0;
     z-index: 20;
 }
-
-.page-content {
-    .f-col();
-    align-items: center;
-    justify-content: center;
-    padding: 130px 0;
-
-    .img1 {
-        width: 80vw;
-        max-width: 760px;
-    }
-
-    .desc {
-        font-size: 18px;
-        color: #ffffff;
-        line-height: 28px;
-        margin-top: 16px;
-        width: 90vw;
-        max-width: 959px;
-        text-align: center;
-    }
-
-    .vip {
-        width: 70vw;
-        max-width: 668px;
-        background-color: transparent;
-        border-radius: 12px;
-        border: 1px solid rgba(255, 255, 255, 0.2);
-        margin-top: 30px;
-        overflow: hidden;
-    }
-
-    .btn {
-        width: 53.3vw;
-        max-width: 300px;
-        min-width: 200px;
-        margin-top: 70px;
-        .n-button {
-            height: 44px;
-        }
-    }
-}
-
-@media screen and(max-width:1024px) {
-    :deep(.n-page-header) {
-        padding: 10px 16px;
-        .n-page-header__title {
-            font-size: 16px;
-        }
-    }
-
-    .page-content {
-        padding: 16px 0 100px;
-        justify-content: flex-start;
-        .desc {
-            font-size: 12px;
-            color: #ffffff;
-            line-height: 24px;
-        }
-    }
-}
-
-.n-grid {
-    backdrop-filter: blur(16px);
-}
-
-.vip-item {
-    .f-col();
-    align-items: center;
-    padding: 18px 0 28px;
-    img {
-        width: 44px;
-        height: 44px;
-    }
-    .text {
-        font-size: 11px;
-        color: #fcf7fe;
-        line-height: 12px;
-        margin-top: 8px;
-        text-align: center;
-        div + div {
-            margin-top: 2px;
-        }
-    }
-}
-
-.login {
-    width: 560px;
-    // background: #0a0b21;
-    border-radius: 12px;
-}
-
-.login-box {
-    width: 334px;
-    margin: 20px auto 0;
-    padding-bottom: 60px;
-}
 </style>

+ 6 - 42
src/views/page/Login.vue

@@ -1,16 +1,14 @@
 <template>
-    <n-el class="page">
-        <n-el class="back" @click="$router.go(-1)">
-            <n-icon size="24">
+    <n-el class="px-12 py-20">
+        <n-el class="py-3 px-5 fixed top-0 left-0" @click="$router.go(-1)">
+            <n-icon size="24" class="text-gray-900 dark:text-white">
                 <ChevronLeft />
             </n-icon>
         </n-el>
-        <n-el class="title">
-            <n-el class="text1">登陆ChillGPT</n-el>
-            <n-el class="text2">未注册手机验证后自动注册登录</n-el>
-        </n-el>
+        <n-el class="text-2xl font-bold text-gray-900 dark:text-white">登陆ChillGPT</n-el>
+        <n-el class="text-xs mt-2 text-gray-400 dark:text-gray-500">未注册手机验证后自动注册登录</n-el>
 
-        <div class="login-wrapper">
+        <div class="py-9">
             <login-form @success="onLogin"></login-form>
         </div>
     </n-el>
@@ -27,37 +25,3 @@ function onLogin() {
     router.replace({ name: 'Chat' })
 }
 </script>
-
-<style lang="less" scoped>
-.page {
-    padding: 80px 48px;
-}
-.title {
-    .text1 {
-        font-size: 24px;
-        font-weight: bold;
-        line-height: 30px;
-        color: var(--text-color-1);
-    }
-
-    .text2 {
-        font-size: 12px;
-        line-height: 24px;
-        margin-top: 8px;
-        color: var(--text-color-3);
-    }
-}
-
-.back {
-    font-size: 0;
-    position: fixed;
-    top: 0;
-    left: 0;
-    padding: 12px 20px;
-    color: var(--text-color-1);
-}
-
-.login-wrapper {
-    padding: 38px 0;
-}
-</style>