diff --git a/package.json b/package.json index 9a1517f..cbe5b3c 100644 --- a/package.json +++ b/package.json @@ -23,6 +23,7 @@ "oh-vue-icons": "^1.0.0-rc3", "pinia": "^2.1.7", "pinia-plugin-persistedstate": "^3.2.3", + "ua-parser-js": "^1.0.38", "uuid": "^10.0.0", "v-viewer": "^3.0.13", "viewerjs": "^1.11.6", @@ -33,6 +34,7 @@ "@tsconfig/node20": "^20.1.4", "@types/ali-oss": "^6.16.11", "@types/node": "^20.14.5", + "@types/ua-parser-js": "^0.7.39", "@types/uuid": "^10.0.0", "@vitejs/plugin-vue": "^5.0.5", "@vitejs/plugin-vue-jsx": "^4.0.0", diff --git a/public/logo.png b/public/logo.png new file mode 100644 index 0000000..8c0897a Binary files /dev/null and b/public/logo.png differ diff --git a/src/App.vue b/src/App.vue index 1ad1271..bab5a9e 100644 --- a/src/App.vue +++ b/src/App.vue @@ -5,6 +5,8 @@ import Background from './layout/background' import GLobalModal from './GlobalModal' import SettingsButton from './settings/SettingsButton' import SettingsOverlay from './settings/SettingsOverlay' +import Sider from './layout/sider' +import LoginModal from './user/LoginModal' import { computed } from 'vue' const settings = useSettingsStore() const blockSize = computed(() => settings.state.blockSize + 'rem') @@ -19,6 +21,8 @@ const blockRadius = computed(() => settings.state.blockRadius + 'rem') + + diff --git a/src/config.ts b/src/config.ts index 06871f7..4dcbc19 100644 --- a/src/config.ts +++ b/src/config.ts @@ -8,3 +8,9 @@ export const ossKeyUrl = import.meta.env.PROD export const ossBase = import.meta.env.PROD ? 'http://btab.oss-cn-hangzhou.aliyuncs.com' : 'http://btab.oss-cn-hangzhou.aliyuncs.com' + +export const apiBase = import.meta.env.PROD + ? 'http://192.168.110.28:8300' + : 'http://192.168.110.28:8300' + +export const cdnBase = import.meta.env.PROD ? apiBase : apiBase diff --git a/src/db.ts b/src/db.ts index f58dae8..441bf47 100644 --- a/src/db.ts +++ b/src/db.ts @@ -1,45 +1,8 @@ import { createInstance, INDEXEDDB } from 'localforage' -import { reactive, toRaw, watch, type WatchStopHandle } from 'vue' -const db = createInstance({ +export default createInstance({ driver: INDEXEDDB, name: 'fatfox', version: 1.0, storeName: 'fat_fox_key_value_pairs' }) - -export function useForageStore( - name: string, - defaultData: T, - partialWrite: (res: T) => T = (res) => res -) { - const state = reactive(defaultData) - const writeWatch = () => - watch( - state, - (d) => { - db.setItem(name, partialWrite(toRaw(d) as T)) - }, - { deep: true } - ) - let stopWatch: WatchStopHandle = () => {} - const refresh = () => { - stopWatch() - state.loading = true - db.getItem<{ data: T }>(name).then((res) => { - if (res?.data) { - Object.assign(state, res.data) - } - state.loading = false - stopWatch = writeWatch() - }) - } - refresh() - document.addEventListener('visibilitychange', () => { - if (document.visibilityState === 'visible') { - refresh() - } - }) -} - -export default db diff --git a/src/layout/header/search/SearchPage.tsx b/src/layout/header/search/SearchPage.tsx index 9f93a88..693fa9d 100644 --- a/src/layout/header/search/SearchPage.tsx +++ b/src/layout/header/search/SearchPage.tsx @@ -1,17 +1,7 @@ -import { defineComponent, reactive, ref } from 'vue' -import zhCN from 'ant-design-vue/es/locale/zh_CN' -import { - Button, - Checkbox, - ConfigProvider, - Divider, - Form, - Input, - message, - Modal -} from 'ant-design-vue' -import useSearchConfigStore, { type SearchInfo } from './useSearchConfigStore' -import { EditOutlined, DeleteOutlined, PlusOutlined, CheckOutlined } from '@ant-design/icons-vue' +import { defineComponent, ref } from 'vue' +import { Button, Checkbox, Divider, message, Modal } from 'ant-design-vue' +import useSearchConfigStore from './useSearchConfigStore' +import { EditOutlined, DeleteOutlined, PlusOutlined } from '@ant-design/icons-vue' import asyncLoader from '@/utils/asyncLoader' const SearchAdder = asyncLoader(() => import('./SearchAdder')) const SearchItem = defineComponent({ @@ -125,69 +115,61 @@ export default defineComponent(() => { const showAdder = ref<{ [key: string]: any } | null | undefined>(undefined) return () => (
e.stopPropagation()} > - -

管理搜索引擎

-
- 默认 - 自定义 +

管理搜索引擎

+
+ 默认 + 自定义 +
+