├── .drone.yml ├── .env.all ├── .env.development ├── .env.docker ├── .env.production ├── .eslintrc.cjs ├── .github └── workflows │ └── deploy.yml ├── .gitignore ├── .prettierrc.json ├── .vscode └── extensions.json ├── Dockerfile ├── README.md ├── cf.sh ├── entrypoint.sh ├── env.d.ts ├── index.html ├── nginx.conf ├── package.json ├── pnpm-lock.yaml ├── public ├── favicon.ico └── img │ ├── comment.svg │ ├── dian.svg │ └── zan.svg ├── src ├── App.vue ├── api │ └── fetch.ts ├── auto-imports.d.ts ├── components.d.ts ├── components │ ├── Comment.vue │ ├── CommentInput.vue │ ├── Drauu.vue │ ├── LeftNav.vue │ ├── Markdown-input.vue │ ├── MeAll.vue │ ├── Memo.vue │ ├── MemoInput.vue │ ├── Mine.vue │ ├── RightNav.vue │ ├── Statistics.vue │ ├── Top10Tag.vue │ ├── settings │ │ ├── DevConfig.vue │ │ ├── Import.vue │ │ ├── SysConfig.vue │ │ ├── TagManage.vue │ │ └── UserConfig.vue │ └── themes │ │ ├── FriendsCommentInput.vue │ │ ├── FriendsMemo.vue │ │ └── FriendsMemoInput.vue ├── directives │ └── directives.ts ├── event │ └── event.ts ├── global.d.ts ├── layouts │ └── default.vue ├── main.ts ├── pages │ ├── defaultIndex.vue │ ├── friendsIndex.vue │ ├── index.vue │ ├── login.vue │ ├── me.vue │ ├── memo │ │ └── [id].vue │ ├── register.vue │ ├── search.vue │ └── settings.vue ├── style.css └── types │ ├── comment.ts │ ├── config.ts │ ├── memo.ts │ ├── tag.ts │ ├── token.ts │ └── user.ts ├── tsconfig.app.json ├── tsconfig.json ├── tsconfig.node.json ├── uno.config.ts ├── vite.config.ts └── yarn.lock /.drone.yml: -------------------------------------------------------------------------------- 1 | kind: pipeline 2 | type: docker 3 | name: mblog-front 4 | trigger: 5 | branch: 6 | - prod 7 | event: 8 | - push 9 | 10 | steps: 11 | - name: docker build 12 | image: plugins/docker 13 | environment: 14 | DOCKER_BUILDKIT: 1 15 | settings: 16 | registry: 192.168.2.33:47382 17 | insecure: true 18 | repo: 192.168.2.33:47382/kingwrcy/mblog-front 19 | tags: latest 20 | cache_from: 192.168.2.33:47382/kingwrcy/mblog-front:latest 21 | username: 22 | from_secret: docker_username 23 | password: 24 | from_secret: docker_password 25 | 26 | - name: start service 27 | image: appleboy/drone-ssh 28 | settings: 29 | host: 30 | - 192.168.2.33 31 | username: root 32 | key: 33 | from_secret: ds920_private_key 34 | port: 22 35 | command_timeout: 2m 36 | script: 37 | - cd /volume1/docker/drone/mblog-front/ 38 | - chmod +x ./startup.sh 39 | - ./startup.sh 40 | -------------------------------------------------------------------------------- /.env.all: -------------------------------------------------------------------------------- 1 | VITE_BASE_URL= 2 | VITE_MBLOG_VERSION=REPLACE_VERSION_HERE 3 | -------------------------------------------------------------------------------- /.env.development: -------------------------------------------------------------------------------- 1 | VITE_BASE_URL=https://web.kingwrcy.cn:62024/memo 2 | VITE_MBLOG_VERSION=v1.0.2 -------------------------------------------------------------------------------- /.env.docker: -------------------------------------------------------------------------------- 1 | VITE_BASE_URL=REPLACE_URL_HERE 2 | VITE_MBLOG_VERSION=REPLACE_VERSION_HERE 3 | -------------------------------------------------------------------------------- /.env.production: -------------------------------------------------------------------------------- 1 | VITE_BASE_URL=https://web.kingwrcy.cn:62024/memo 2 | VITE_MBLOG_VERSION=REPLACE_VERSION_HERE -------------------------------------------------------------------------------- /.eslintrc.cjs: -------------------------------------------------------------------------------- 1 | /* eslint-env node */ 2 | require('@rushstack/eslint-patch/modern-module-resolution') 3 | 4 | module.exports = { 5 | root: true, 6 | extends: [ 7 | 'plugin:vue/vue3-essential', 8 | 'eslint:recommended', 9 | '@vue/eslint-config-typescript', 10 | '@vue/eslint-config-prettier/skip-formatting' 11 | ], 12 | parserOptions: { 13 | ecmaVersion: 'latest' 14 | }, 15 | rules: { 16 | 'vue/multi-word-component-names': 'off' 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /.github/workflows/deploy.yml: -------------------------------------------------------------------------------- 1 | name: deploy Docker image 2 | on: 3 | push: 4 | tags: 5 | - 'v*' 6 | jobs: 7 | build: 8 | runs-on: ubuntu-latest 9 | steps: 10 | - uses: actions/checkout@v3 11 | - name: Extract Version 12 | id: version_step 13 | run: | 14 | echo "##[set-output name=version;]VERSION=${GITHUB_REF#$"refs/tags/v"}" 15 | echo "##[set-output name=version_tag;]kingwrcy/mblog-front:${GITHUB_REF#$"refs/tags/v"}" 16 | echo "##[set-output name=latest_tag;]kingwrcy/mblog-front:latest" 17 | - name: Set up QEMU 18 | uses: docker/setup-qemu-action@v2 19 | - name: Set up Docker Buildx 20 | uses: docker/setup-buildx-action@v2 21 | 22 | - name: Login to DockerHub 23 | uses: docker/login-action@v2 24 | with: 25 | username: ${{ secrets.DOCKER_USER_NAME }} 26 | password: ${{ secrets.DOCKER_ACCESS_TOKEN }} 27 | 28 | - name: PrepareReg Names 29 | id: read-docker-image-identifiers 30 | run: | 31 | echo VERSION_TAG=$(echo ${{ steps.version_step.outputs.version_tag }} | tr '[:upper:]' '[:lower:]') >> $GITHUB_ENV 32 | echo LASTEST_TAG=$(echo ${{ steps.version_step.outputs.latest_tag }} | tr '[:upper:]' '[:lower:]') >> $GITHUB_ENV 33 | 34 | - name: Build and push Docker images 35 | id: docker_build 36 | uses: docker/build-push-action@v4 37 | with: 38 | push: true 39 | context: . 40 | tags: | 41 | ${{env.VERSION_TAG}} 42 | ${{env.LASTEST_TAG}} 43 | build-args: | 44 | ${{steps.version_step.outputs.version}} 45 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | pnpm-debug.log* 8 | lerna-debug.log* 9 | 10 | node_modules 11 | .DS_Store 12 | dist 13 | dist-ssr 14 | coverage 15 | *.local 16 | 17 | /cypress/videos/ 18 | /cypress/screenshots/ 19 | 20 | # Editor directories and files 21 | .vscode/* 22 | !.vscode/extensions.json 23 | .idea 24 | *.suo 25 | *.ntvs* 26 | *.njsproj 27 | *.sln 28 | *.sw? 29 | -------------------------------------------------------------------------------- /.prettierrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json.schemastore.org/prettierrc", 3 | "arrowParens": "always", 4 | "bracketSameLine": false, 5 | "bracketSpacing": true, 6 | "embeddedLanguageFormatting": "auto", 7 | "htmlWhitespaceSensitivity": "css", 8 | "insertPragma": false, 9 | "jsxSingleQuote": false, 10 | "printWidth": 120, 11 | "proseWrap": "preserve", 12 | "quoteProps": "as-needed", 13 | "requirePragma": false, 14 | "semi": false, 15 | "singleAttributePerLine": false, 16 | "singleQuote": true, 17 | "tabWidth": 2, 18 | "trailingComma": "es5", 19 | "useTabs": false, 20 | "vueIndentScriptAndStyle": false 21 | } 22 | -------------------------------------------------------------------------------- /.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | "recommendations": ["Vue.volar", "Vue.vscode-typescript-vue-plugin"] 3 | } 4 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM node:18-alpine as build-stage 2 | 3 | ARG VERSION 4 | WORKDIR /app 5 | RUN corepack enable 6 | 7 | COPY package.json yarn.lock ./ 8 | RUN --mount=type=cache,id=yarn-store,target=/root/.yarn-store \ 9 | yarn install --registry=https://registry.npm.taobao.org 10 | 11 | COPY . . 12 | RUN sed -i 's#REPLACE_VERSION_HERE#'"$VERSION"'#g' /app/.env.docker 13 | 14 | RUN yarn build-only --mode=docker 15 | 16 | FROM nginx:stable-alpine as production-stage 17 | 18 | COPY --from=build-stage /app/dist /usr/share/nginx/html 19 | COPY --from=build-stage /app/nginx.conf /etc/nginx/conf.d/default.conf 20 | 21 | COPY entrypoint.sh /usr/share/nginx 22 | 23 | EXPOSE 80 24 | 25 | RUN chmod +x /usr/share/nginx/entrypoint.sh 26 | 27 | CMD /usr/share/nginx/entrypoint.sh -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## mblog-front 2 | 3 | **个人微博平台前端** 4 | 5 | 部署和说明参见[mblog-backend](https://github.com/kingwrcy/mblog-backend) 6 | -------------------------------------------------------------------------------- /cf.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | git fetch --prune --unshallow 4 | VERSION=$(git describe --tags --abbrev=0) 5 | sed -i 's#REPLACE_VERSION_HERE#'"$VERSION"'#g' .env.production 6 | yarn build-only -------------------------------------------------------------------------------- /entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | sed -i 's#REPLACE_URL_HERE#'"$MBLOG_SERVER_URL"'#g' `grep 'REPLACE_URL_HERE' -rl /usr/share/nginx/html` 4 | 5 | nginx -g 'daemon off;' -------------------------------------------------------------------------------- /env.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | /// 3 | 4 | declare module 'layouts-generated' { 5 | import type { RouteRecordRaw } from 'vue-router' 6 | export function setupLayouts(routes: RouteRecordRaw[]): RouteRecordRaw[] 7 | } 8 | 9 | declare module 'virtual:generated-layouts' { 10 | import type { RouteRecordRaw } from 'vue-router' 11 | export function setupLayouts(routes: RouteRecordRaw[]): RouteRecordRaw[] 12 | } 13 | 14 | declare global { 15 | interface Window { 16 | hello: any 17 | } 18 | } 19 | declare module 'marked-mangle' 20 | declare module 'marked-gfm-heading-id' 21 | declare module '@vueuse/integrations/useDrauu' 22 | declare module '@vueuse/motion' 23 | -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | MBlog 9 | 10 | 11 |
12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /nginx.conf: -------------------------------------------------------------------------------- 1 | server { 2 | listen 80; 3 | server_name localhost; 4 | location / { 5 | root /usr/share/nginx/html; 6 | index index.html index.htm; 7 | try_files $uri $uri/ /index.html; 8 | } 9 | error_page 500 502 503 504 /50x.html; 10 | location = /50x.html { 11 | root /usr/share/nginx/html; 12 | } 13 | } -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "mblog-front", 3 | "version": "0.0.0", 4 | "private": true, 5 | "scripts": { 6 | "dev": "vite --host=127.0.0.1 --port=3333", 7 | "devallinone": "vite --host=127.0.0.1 --port=3333 --mode=all", 8 | "build": "run-p type-check build-only", 9 | "preview": "vite preview", 10 | "build-only": "vite build", 11 | "type-check": "vue-tsc --noEmit", 12 | "lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore", 13 | "format": "prettier --write src/", 14 | "build-cf": "sh ./cf.sh" 15 | }, 16 | "dependencies": { 17 | "@vueuse/core": "^10.1.2", 18 | "@vueuse/integrations": "^10.1.2", 19 | "@vueuse/motion": "^2.0.0-beta.12", 20 | "axios": "^1.4.0", 21 | "dayjs": "^1.11.7", 22 | "drauu": "^0.3.2", 23 | "emoji-picker-element": "^1.17.0", 24 | "marked": "^5.0.1", 25 | "marked-gfm-heading-id": "^3.0.3", 26 | "marked-mangle": "^1.0.1", 27 | "pinia": "^2.0.35", 28 | "vue": "^3.2.47", 29 | "vue-router": "^4.1.6" 30 | }, 31 | "devDependencies": { 32 | "@iconify-json/carbon": "^1.1.16", 33 | "@rushstack/eslint-patch": "^1.2.0", 34 | "@tsconfig/node18": "^2.0.0", 35 | "@types/marked": "^4.3.0", 36 | "@types/node": "^20.1.0", 37 | "@unocss/preset-icons": "^0.58.7", 38 | "@unocss/reset": "^0.58.7", 39 | "@vitejs/plugin-vue": "^4.2.1", 40 | "@vue/eslint-config-prettier": "^7.1.0", 41 | "@vue/eslint-config-typescript": "^11.0.3", 42 | "@vue/tsconfig": "^0.3.2", 43 | "eslint": "^8.39.0", 44 | "eslint-plugin-vue": "^9.11.0", 45 | "naive-ui": "^2.34.3", 46 | "npm-run-all": "^4.1.5", 47 | "prettier": "^2.8.8", 48 | "sass": "^1.62.1", 49 | "typescript": "~5.0.4", 50 | "unocss": "^0.58.7", 51 | "unplugin-auto-import": "^0.15.3", 52 | "unplugin-vue-components": "^0.24.1", 53 | "vite": "^4.3.4", 54 | "vite-plugin-pages": "^0.29.0", 55 | "vite-plugin-pwa": "^0.16.1", 56 | "vite-plugin-vue-layouts": "^0.8.0", 57 | "vue-tsc": "^1.6.4" 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mblog-backend/front/825a6034c5100cb0899d0c74b059432a20da7d77/public/favicon.ico -------------------------------------------------------------------------------- /public/img/comment.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/img/dian.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/img/zan.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/App.vue: -------------------------------------------------------------------------------- 1 | 22 | 23 | 28 | -------------------------------------------------------------------------------- /src/api/fetch.ts: -------------------------------------------------------------------------------- 1 | import { createFetch } from '@vueuse/core' 2 | import { createDiscreteApi } from 'naive-ui' 3 | const { message } = createDiscreteApi(['message']) 4 | 5 | export const useMyFetch = createFetch({ 6 | baseUrl: import.meta.env.VITE_BASE_URL, 7 | options: { 8 | async beforeFetch({ options }) { 9 | const userinfo = useStorage('userinfo', { token: '' }) 10 | if (userinfo.value.token && options.headers) { 11 | options.headers = { 12 | token: userinfo.value.token, 13 | } 14 | } 15 | return { options } 16 | }, 17 | async afterFetch(ctx) { 18 | if (ctx.response.status !== 200 || ctx.data.code !== 0) { 19 | if (ctx.data.code === 3) { 20 | localStorage.clear() 21 | } 22 | return Promise.reject(new Error(ctx.data?.msg || '系统异常')) 23 | } 24 | return Promise.resolve({ data: ctx.data.data }) 25 | }, 26 | async onFetchError(ctx) { 27 | message.error(ctx.data?.msg || '系统异常') 28 | return Promise.resolve(ctx) 29 | }, 30 | }, 31 | fetchOptions: { 32 | mode: 'cors', 33 | }, 34 | }) 35 | -------------------------------------------------------------------------------- /src/auto-imports.d.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | /* prettier-ignore */ 3 | // @ts-nocheck 4 | // Generated by unplugin-auto-import 5 | export {} 6 | declare global { 7 | const EffectScope: typeof import('vue')['EffectScope'] 8 | const MemoVisibility: typeof import('./types/memo')['MemoVisibility'] 9 | const asyncComputed: typeof import('@vueuse/core')['asyncComputed'] 10 | const autoResetRef: typeof import('@vueuse/core')['autoResetRef'] 11 | const changedMemoBus: typeof import('./event/event')['changedMemoBus'] 12 | const closeDrawerBus: typeof import('./event/event')['closeDrawerBus'] 13 | const commetSavedBus: typeof import('./event/event')['commetSavedBus'] 14 | const computed: typeof import('vue')['computed'] 15 | const computedAsync: typeof import('@vueuse/core')['computedAsync'] 16 | const computedEager: typeof import('@vueuse/core')['computedEager'] 17 | const computedInject: typeof import('@vueuse/core')['computedInject'] 18 | const computedWithControl: typeof import('@vueuse/core')['computedWithControl'] 19 | const controlledComputed: typeof import('@vueuse/core')['controlledComputed'] 20 | const controlledRef: typeof import('@vueuse/core')['controlledRef'] 21 | const createApp: typeof import('vue')['createApp'] 22 | const createDiscreteApi: typeof import('naive-ui')['createDiscreteApi'] 23 | const createEventHook: typeof import('@vueuse/core')['createEventHook'] 24 | const createGlobalState: typeof import('@vueuse/core')['createGlobalState'] 25 | const createInjectionState: typeof import('@vueuse/core')['createInjectionState'] 26 | const createReactiveFn: typeof import('@vueuse/core')['createReactiveFn'] 27 | const createReusableTemplate: typeof import('@vueuse/core')['createReusableTemplate'] 28 | const createSharedComposable: typeof import('@vueuse/core')['createSharedComposable'] 29 | const createTemplatePromise: typeof import('@vueuse/core')['createTemplatePromise'] 30 | const createUnrefFn: typeof import('@vueuse/core')['createUnrefFn'] 31 | const customRef: typeof import('vue')['customRef'] 32 | const debouncedRef: typeof import('@vueuse/core')['debouncedRef'] 33 | const debouncedWatch: typeof import('@vueuse/core')['debouncedWatch'] 34 | const defineAsyncComponent: typeof import('vue')['defineAsyncComponent'] 35 | const defineComponent: typeof import('vue')['defineComponent'] 36 | const eagerComputed: typeof import('@vueuse/core')['eagerComputed'] 37 | const editMemoBus: typeof import('./event/event')['editMemoBus'] 38 | const effectScope: typeof import('vue')['effectScope'] 39 | const extendRef: typeof import('@vueuse/core')['extendRef'] 40 | const getCurrentInstance: typeof import('vue')['getCurrentInstance'] 41 | const getCurrentScope: typeof import('vue')['getCurrentScope'] 42 | const getVisbilityDesc: typeof import('./types/memo')['getVisbilityDesc'] 43 | const getVisbilitys: typeof import('./types/memo')['getVisbilitys'] 44 | const h: typeof import('vue')['h'] 45 | const ignorableWatch: typeof import('@vueuse/core')['ignorableWatch'] 46 | const inject: typeof import('vue')['inject'] 47 | const isDefined: typeof import('@vueuse/core')['isDefined'] 48 | const isProxy: typeof import('vue')['isProxy'] 49 | const isReactive: typeof import('vue')['isReactive'] 50 | const isReadonly: typeof import('vue')['isReadonly'] 51 | const isRef: typeof import('vue')['isRef'] 52 | const makeDestructurable: typeof import('@vueuse/core')['makeDestructurable'] 53 | const markRaw: typeof import('vue')['markRaw'] 54 | const nextTick: typeof import('vue')['nextTick'] 55 | const onActivated: typeof import('vue')['onActivated'] 56 | const onBeforeMount: typeof import('vue')['onBeforeMount'] 57 | const onBeforeRouteLeave: typeof import('vue-router')['onBeforeRouteLeave'] 58 | const onBeforeRouteUpdate: typeof import('vue-router')['onBeforeRouteUpdate'] 59 | const onBeforeUnmount: typeof import('vue')['onBeforeUnmount'] 60 | const onBeforeUpdate: typeof import('vue')['onBeforeUpdate'] 61 | const onClickOutside: typeof import('@vueuse/core')['onClickOutside'] 62 | const onDeactivated: typeof import('vue')['onDeactivated'] 63 | const onErrorCaptured: typeof import('vue')['onErrorCaptured'] 64 | const onKeyStroke: typeof import('@vueuse/core')['onKeyStroke'] 65 | const onLongPress: typeof import('@vueuse/core')['onLongPress'] 66 | const onMounted: typeof import('vue')['onMounted'] 67 | const onRenderTracked: typeof import('vue')['onRenderTracked'] 68 | const onRenderTriggered: typeof import('vue')['onRenderTriggered'] 69 | const onScopeDispose: typeof import('vue')['onScopeDispose'] 70 | const onServerPrefetch: typeof import('vue')['onServerPrefetch'] 71 | const onStartTyping: typeof import('@vueuse/core')['onStartTyping'] 72 | const onUnmounted: typeof import('vue')['onUnmounted'] 73 | const onUpdated: typeof import('vue')['onUpdated'] 74 | const pausableWatch: typeof import('@vueuse/core')['pausableWatch'] 75 | const provide: typeof import('vue')['provide'] 76 | const reactify: typeof import('@vueuse/core')['reactify'] 77 | const reactifyObject: typeof import('@vueuse/core')['reactifyObject'] 78 | const reactive: typeof import('vue')['reactive'] 79 | const reactiveComputed: typeof import('@vueuse/core')['reactiveComputed'] 80 | const reactiveOmit: typeof import('@vueuse/core')['reactiveOmit'] 81 | const reactivePick: typeof import('@vueuse/core')['reactivePick'] 82 | const readonly: typeof import('vue')['readonly'] 83 | const ref: typeof import('vue')['ref'] 84 | const refAutoReset: typeof import('@vueuse/core')['refAutoReset'] 85 | const refDebounced: typeof import('@vueuse/core')['refDebounced'] 86 | const refDefault: typeof import('@vueuse/core')['refDefault'] 87 | const refThrottled: typeof import('@vueuse/core')['refThrottled'] 88 | const refWithControl: typeof import('@vueuse/core')['refWithControl'] 89 | const reloadMemosBus: typeof import('./event/event')['reloadMemosBus'] 90 | const resolveComponent: typeof import('vue')['resolveComponent'] 91 | const resolveRef: typeof import('@vueuse/core')['resolveRef'] 92 | const resolveUnref: typeof import('@vueuse/core')['resolveUnref'] 93 | const searchMemosBus: typeof import('./event/event')['searchMemosBus'] 94 | const shallowReactive: typeof import('vue')['shallowReactive'] 95 | const shallowReadonly: typeof import('vue')['shallowReadonly'] 96 | const shallowRef: typeof import('vue')['shallowRef'] 97 | const syncRef: typeof import('@vueuse/core')['syncRef'] 98 | const syncRefs: typeof import('@vueuse/core')['syncRefs'] 99 | const templateRef: typeof import('@vueuse/core')['templateRef'] 100 | const themeChangeBus: typeof import('./event/event')['themeChangeBus'] 101 | const throttledRef: typeof import('@vueuse/core')['throttledRef'] 102 | const throttledWatch: typeof import('@vueuse/core')['throttledWatch'] 103 | const toRaw: typeof import('vue')['toRaw'] 104 | const toReactive: typeof import('@vueuse/core')['toReactive'] 105 | const toRef: typeof import('vue')['toRef'] 106 | const toRefs: typeof import('vue')['toRefs'] 107 | const toggleDrauuBus: typeof import('./event/event')['toggleDrauuBus'] 108 | const triggerRef: typeof import('vue')['triggerRef'] 109 | const tryOnBeforeMount: typeof import('@vueuse/core')['tryOnBeforeMount'] 110 | const tryOnBeforeUnmount: typeof import('@vueuse/core')['tryOnBeforeUnmount'] 111 | const tryOnMounted: typeof import('@vueuse/core')['tryOnMounted'] 112 | const tryOnScopeDispose: typeof import('@vueuse/core')['tryOnScopeDispose'] 113 | const tryOnUnmounted: typeof import('@vueuse/core')['tryOnUnmounted'] 114 | const unref: typeof import('vue')['unref'] 115 | const unrefElement: typeof import('@vueuse/core')['unrefElement'] 116 | const until: typeof import('@vueuse/core')['until'] 117 | const useActiveElement: typeof import('@vueuse/core')['useActiveElement'] 118 | const useAnimate: typeof import('@vueuse/core')['useAnimate'] 119 | const useArrayDifference: typeof import('@vueuse/core')['useArrayDifference'] 120 | const useArrayEvery: typeof import('@vueuse/core')['useArrayEvery'] 121 | const useArrayFilter: typeof import('@vueuse/core')['useArrayFilter'] 122 | const useArrayFind: typeof import('@vueuse/core')['useArrayFind'] 123 | const useArrayFindIndex: typeof import('@vueuse/core')['useArrayFindIndex'] 124 | const useArrayFindLast: typeof import('@vueuse/core')['useArrayFindLast'] 125 | const useArrayIncludes: typeof import('@vueuse/core')['useArrayIncludes'] 126 | const useArrayJoin: typeof import('@vueuse/core')['useArrayJoin'] 127 | const useArrayMap: typeof import('@vueuse/core')['useArrayMap'] 128 | const useArrayReduce: typeof import('@vueuse/core')['useArrayReduce'] 129 | const useArraySome: typeof import('@vueuse/core')['useArraySome'] 130 | const useArrayUnique: typeof import('@vueuse/core')['useArrayUnique'] 131 | const useAsyncQueue: typeof import('@vueuse/core')['useAsyncQueue'] 132 | const useAsyncState: typeof import('@vueuse/core')['useAsyncState'] 133 | const useAttrs: typeof import('vue')['useAttrs'] 134 | const useBase64: typeof import('@vueuse/core')['useBase64'] 135 | const useBattery: typeof import('@vueuse/core')['useBattery'] 136 | const useBluetooth: typeof import('@vueuse/core')['useBluetooth'] 137 | const useBreakpoints: typeof import('@vueuse/core')['useBreakpoints'] 138 | const useBroadcastChannel: typeof import('@vueuse/core')['useBroadcastChannel'] 139 | const useBrowserLocation: typeof import('@vueuse/core')['useBrowserLocation'] 140 | const useCached: typeof import('@vueuse/core')['useCached'] 141 | const useClipboard: typeof import('@vueuse/core')['useClipboard'] 142 | const useCloned: typeof import('@vueuse/core')['useCloned'] 143 | const useColorMode: typeof import('@vueuse/core')['useColorMode'] 144 | const useConfirmDialog: typeof import('@vueuse/core')['useConfirmDialog'] 145 | const useCounter: typeof import('@vueuse/core')['useCounter'] 146 | const useCssModule: typeof import('vue')['useCssModule'] 147 | const useCssVar: typeof import('@vueuse/core')['useCssVar'] 148 | const useCssVars: typeof import('vue')['useCssVars'] 149 | const useCurrentElement: typeof import('@vueuse/core')['useCurrentElement'] 150 | const useCycleList: typeof import('@vueuse/core')['useCycleList'] 151 | const useDark: typeof import('@vueuse/core')['useDark'] 152 | const useDateFormat: typeof import('@vueuse/core')['useDateFormat'] 153 | const useDebounce: typeof import('@vueuse/core')['useDebounce'] 154 | const useDebounceFn: typeof import('@vueuse/core')['useDebounceFn'] 155 | const useDebouncedRefHistory: typeof import('@vueuse/core')['useDebouncedRefHistory'] 156 | const useDeviceMotion: typeof import('@vueuse/core')['useDeviceMotion'] 157 | const useDeviceOrientation: typeof import('@vueuse/core')['useDeviceOrientation'] 158 | const useDevicePixelRatio: typeof import('@vueuse/core')['useDevicePixelRatio'] 159 | const useDevicesList: typeof import('@vueuse/core')['useDevicesList'] 160 | const useDialog: typeof import('naive-ui')['useDialog'] 161 | const useDisplayMedia: typeof import('@vueuse/core')['useDisplayMedia'] 162 | const useDocumentVisibility: typeof import('@vueuse/core')['useDocumentVisibility'] 163 | const useDraggable: typeof import('@vueuse/core')['useDraggable'] 164 | const useDropZone: typeof import('@vueuse/core')['useDropZone'] 165 | const useElementBounding: typeof import('@vueuse/core')['useElementBounding'] 166 | const useElementByPoint: typeof import('@vueuse/core')['useElementByPoint'] 167 | const useElementHover: typeof import('@vueuse/core')['useElementHover'] 168 | const useElementSize: typeof import('@vueuse/core')['useElementSize'] 169 | const useElementVisibility: typeof import('@vueuse/core')['useElementVisibility'] 170 | const useEventBus: typeof import('@vueuse/core')['useEventBus'] 171 | const useEventListener: typeof import('@vueuse/core')['useEventListener'] 172 | const useEventSource: typeof import('@vueuse/core')['useEventSource'] 173 | const useEyeDropper: typeof import('@vueuse/core')['useEyeDropper'] 174 | const useFavicon: typeof import('@vueuse/core')['useFavicon'] 175 | const useFetch: typeof import('@vueuse/core')['useFetch'] 176 | const useFileDialog: typeof import('@vueuse/core')['useFileDialog'] 177 | const useFileSystemAccess: typeof import('@vueuse/core')['useFileSystemAccess'] 178 | const useFocus: typeof import('@vueuse/core')['useFocus'] 179 | const useFocusWithin: typeof import('@vueuse/core')['useFocusWithin'] 180 | const useFps: typeof import('@vueuse/core')['useFps'] 181 | const useFullscreen: typeof import('@vueuse/core')['useFullscreen'] 182 | const useGamepad: typeof import('@vueuse/core')['useGamepad'] 183 | const useGeolocation: typeof import('@vueuse/core')['useGeolocation'] 184 | const useIdle: typeof import('@vueuse/core')['useIdle'] 185 | const useImage: typeof import('@vueuse/core')['useImage'] 186 | const useInfiniteScroll: typeof import('@vueuse/core')['useInfiniteScroll'] 187 | const useIntersectionObserver: typeof import('@vueuse/core')['useIntersectionObserver'] 188 | const useInterval: typeof import('@vueuse/core')['useInterval'] 189 | const useIntervalFn: typeof import('@vueuse/core')['useIntervalFn'] 190 | const useKeyModifier: typeof import('@vueuse/core')['useKeyModifier'] 191 | const useLastChanged: typeof import('@vueuse/core')['useLastChanged'] 192 | const useLink: typeof import('vue-router')['useLink'] 193 | const useLoadingBar: typeof import('naive-ui')['useLoadingBar'] 194 | const useLocalStorage: typeof import('@vueuse/core')['useLocalStorage'] 195 | const useMagicKeys: typeof import('@vueuse/core')['useMagicKeys'] 196 | const useManualRefHistory: typeof import('@vueuse/core')['useManualRefHistory'] 197 | const useMediaControls: typeof import('@vueuse/core')['useMediaControls'] 198 | const useMediaQuery: typeof import('@vueuse/core')['useMediaQuery'] 199 | const useMemoize: typeof import('@vueuse/core')['useMemoize'] 200 | const useMemory: typeof import('@vueuse/core')['useMemory'] 201 | const useMounted: typeof import('@vueuse/core')['useMounted'] 202 | const useMouse: typeof import('@vueuse/core')['useMouse'] 203 | const useMouseInElement: typeof import('@vueuse/core')['useMouseInElement'] 204 | const useMousePressed: typeof import('@vueuse/core')['useMousePressed'] 205 | const useMutationObserver: typeof import('@vueuse/core')['useMutationObserver'] 206 | const useMyFetch: typeof import('./api/fetch')['useMyFetch'] 207 | const useNavigatorLanguage: typeof import('@vueuse/core')['useNavigatorLanguage'] 208 | const useNetwork: typeof import('@vueuse/core')['useNetwork'] 209 | const useNotification: typeof import('naive-ui')['useNotification'] 210 | const useNow: typeof import('@vueuse/core')['useNow'] 211 | const useObjectUrl: typeof import('@vueuse/core')['useObjectUrl'] 212 | const useOffsetPagination: typeof import('@vueuse/core')['useOffsetPagination'] 213 | const useOnline: typeof import('@vueuse/core')['useOnline'] 214 | const usePageLeave: typeof import('@vueuse/core')['usePageLeave'] 215 | const useParallax: typeof import('@vueuse/core')['useParallax'] 216 | const useParentElement: typeof import('@vueuse/core')['useParentElement'] 217 | const usePerformanceObserver: typeof import('@vueuse/core')['usePerformanceObserver'] 218 | const usePermission: typeof import('@vueuse/core')['usePermission'] 219 | const usePointer: typeof import('@vueuse/core')['usePointer'] 220 | const usePointerLock: typeof import('@vueuse/core')['usePointerLock'] 221 | const usePointerSwipe: typeof import('@vueuse/core')['usePointerSwipe'] 222 | const usePreferredColorScheme: typeof import('@vueuse/core')['usePreferredColorScheme'] 223 | const usePreferredContrast: typeof import('@vueuse/core')['usePreferredContrast'] 224 | const usePreferredDark: typeof import('@vueuse/core')['usePreferredDark'] 225 | const usePreferredLanguages: typeof import('@vueuse/core')['usePreferredLanguages'] 226 | const usePreferredReducedMotion: typeof import('@vueuse/core')['usePreferredReducedMotion'] 227 | const usePrevious: typeof import('@vueuse/core')['usePrevious'] 228 | const useRafFn: typeof import('@vueuse/core')['useRafFn'] 229 | const useRefHistory: typeof import('@vueuse/core')['useRefHistory'] 230 | const useResizeObserver: typeof import('@vueuse/core')['useResizeObserver'] 231 | const useRoute: typeof import('vue-router')['useRoute'] 232 | const useRouter: typeof import('vue-router')['useRouter'] 233 | const useScreenOrientation: typeof import('@vueuse/core')['useScreenOrientation'] 234 | const useScreenSafeArea: typeof import('@vueuse/core')['useScreenSafeArea'] 235 | const useScriptTag: typeof import('@vueuse/core')['useScriptTag'] 236 | const useScroll: typeof import('@vueuse/core')['useScroll'] 237 | const useScrollLock: typeof import('@vueuse/core')['useScrollLock'] 238 | const useSessionStorage: typeof import('@vueuse/core')['useSessionStorage'] 239 | const useShare: typeof import('@vueuse/core')['useShare'] 240 | const useSlots: typeof import('vue')['useSlots'] 241 | const useSorted: typeof import('@vueuse/core')['useSorted'] 242 | const useSpeechRecognition: typeof import('@vueuse/core')['useSpeechRecognition'] 243 | const useSpeechSynthesis: typeof import('@vueuse/core')['useSpeechSynthesis'] 244 | const useStepper: typeof import('@vueuse/core')['useStepper'] 245 | const useStorage: typeof import('@vueuse/core')['useStorage'] 246 | const useStorageAsync: typeof import('@vueuse/core')['useStorageAsync'] 247 | const useStyleTag: typeof import('@vueuse/core')['useStyleTag'] 248 | const useSupported: typeof import('@vueuse/core')['useSupported'] 249 | const useSwipe: typeof import('@vueuse/core')['useSwipe'] 250 | const useTemplateRefsList: typeof import('@vueuse/core')['useTemplateRefsList'] 251 | const useTextDirection: typeof import('@vueuse/core')['useTextDirection'] 252 | const useTextSelection: typeof import('@vueuse/core')['useTextSelection'] 253 | const useTextareaAutosize: typeof import('@vueuse/core')['useTextareaAutosize'] 254 | const useThrottle: typeof import('@vueuse/core')['useThrottle'] 255 | const useThrottleFn: typeof import('@vueuse/core')['useThrottleFn'] 256 | const useThrottledRefHistory: typeof import('@vueuse/core')['useThrottledRefHistory'] 257 | const useTimeAgo: typeof import('@vueuse/core')['useTimeAgo'] 258 | const useTimeout: typeof import('@vueuse/core')['useTimeout'] 259 | const useTimeoutFn: typeof import('@vueuse/core')['useTimeoutFn'] 260 | const useTimeoutPoll: typeof import('@vueuse/core')['useTimeoutPoll'] 261 | const useTimestamp: typeof import('@vueuse/core')['useTimestamp'] 262 | const useTitle: typeof import('@vueuse/core')['useTitle'] 263 | const useToNumber: typeof import('@vueuse/core')['useToNumber'] 264 | const useToString: typeof import('@vueuse/core')['useToString'] 265 | const useToggle: typeof import('@vueuse/core')['useToggle'] 266 | const useTransition: typeof import('@vueuse/core')['useTransition'] 267 | const useUrlSearchParams: typeof import('@vueuse/core')['useUrlSearchParams'] 268 | const useUserMedia: typeof import('@vueuse/core')['useUserMedia'] 269 | const useVModel: typeof import('@vueuse/core')['useVModel'] 270 | const useVModels: typeof import('@vueuse/core')['useVModels'] 271 | const useVibrate: typeof import('@vueuse/core')['useVibrate'] 272 | const useVirtualList: typeof import('@vueuse/core')['useVirtualList'] 273 | const useWakeLock: typeof import('@vueuse/core')['useWakeLock'] 274 | const useWebNotification: typeof import('@vueuse/core')['useWebNotification'] 275 | const useWebSocket: typeof import('@vueuse/core')['useWebSocket'] 276 | const useWebWorker: typeof import('@vueuse/core')['useWebWorker'] 277 | const useWebWorkerFn: typeof import('@vueuse/core')['useWebWorkerFn'] 278 | const useWindowFocus: typeof import('@vueuse/core')['useWindowFocus'] 279 | const useWindowScroll: typeof import('@vueuse/core')['useWindowScroll'] 280 | const useWindowSize: typeof import('@vueuse/core')['useWindowSize'] 281 | const watch: typeof import('vue')['watch'] 282 | const watchArray: typeof import('@vueuse/core')['watchArray'] 283 | const watchAtMost: typeof import('@vueuse/core')['watchAtMost'] 284 | const watchDebounced: typeof import('@vueuse/core')['watchDebounced'] 285 | const watchDeep: typeof import('@vueuse/core')['watchDeep'] 286 | const watchEffect: typeof import('vue')['watchEffect'] 287 | const watchIgnorable: typeof import('@vueuse/core')['watchIgnorable'] 288 | const watchImmediate: typeof import('@vueuse/core')['watchImmediate'] 289 | const watchOnce: typeof import('@vueuse/core')['watchOnce'] 290 | const watchPausable: typeof import('@vueuse/core')['watchPausable'] 291 | const watchPostEffect: typeof import('vue')['watchPostEffect'] 292 | const watchSyncEffect: typeof import('vue')['watchSyncEffect'] 293 | const watchThrottled: typeof import('@vueuse/core')['watchThrottled'] 294 | const watchTriggerable: typeof import('@vueuse/core')['watchTriggerable'] 295 | const watchWithFilter: typeof import('@vueuse/core')['watchWithFilter'] 296 | const whenever: typeof import('@vueuse/core')['whenever'] 297 | } 298 | // for type re-export 299 | declare global { 300 | // @ts-ignore 301 | export type { Component, ComponentPublicInstance, ComputedRef, InjectionKey, PropType, Ref, VNode } from 'vue' 302 | } 303 | // for vue template auto import 304 | import { UnwrapRef } from 'vue' 305 | declare module 'vue' { 306 | interface ComponentCustomProperties { 307 | readonly EffectScope: UnwrapRef 308 | readonly MemoVisibility: UnwrapRef 309 | readonly asyncComputed: UnwrapRef 310 | readonly autoResetRef: UnwrapRef 311 | readonly changedMemoBus: UnwrapRef 312 | readonly closeDrawerBus: UnwrapRef 313 | readonly commetSavedBus: UnwrapRef 314 | readonly computed: UnwrapRef 315 | readonly computedAsync: UnwrapRef 316 | readonly computedEager: UnwrapRef 317 | readonly computedInject: UnwrapRef 318 | readonly computedWithControl: UnwrapRef 319 | readonly controlledComputed: UnwrapRef 320 | readonly controlledRef: UnwrapRef 321 | readonly createApp: UnwrapRef 322 | readonly createDiscreteApi: UnwrapRef 323 | readonly createEventHook: UnwrapRef 324 | readonly createGlobalState: UnwrapRef 325 | readonly createInjectionState: UnwrapRef 326 | readonly createReactiveFn: UnwrapRef 327 | readonly createReusableTemplate: UnwrapRef 328 | readonly createSharedComposable: UnwrapRef 329 | readonly createTemplatePromise: UnwrapRef 330 | readonly createUnrefFn: UnwrapRef 331 | readonly customRef: UnwrapRef 332 | readonly debouncedRef: UnwrapRef 333 | readonly debouncedWatch: UnwrapRef 334 | readonly defineAsyncComponent: UnwrapRef 335 | readonly defineComponent: UnwrapRef 336 | readonly eagerComputed: UnwrapRef 337 | readonly editMemoBus: UnwrapRef 338 | readonly effectScope: UnwrapRef 339 | readonly extendRef: UnwrapRef 340 | readonly getCurrentInstance: UnwrapRef 341 | readonly getCurrentScope: UnwrapRef 342 | readonly getVisbilityDesc: UnwrapRef 343 | readonly getVisbilitys: UnwrapRef 344 | readonly h: UnwrapRef 345 | readonly ignorableWatch: UnwrapRef 346 | readonly inject: UnwrapRef 347 | readonly isDefined: UnwrapRef 348 | readonly isProxy: UnwrapRef 349 | readonly isReactive: UnwrapRef 350 | readonly isReadonly: UnwrapRef 351 | readonly isRef: UnwrapRef 352 | readonly makeDestructurable: UnwrapRef 353 | readonly markRaw: UnwrapRef 354 | readonly nextTick: UnwrapRef 355 | readonly onActivated: UnwrapRef 356 | readonly onBeforeMount: UnwrapRef 357 | readonly onBeforeRouteLeave: UnwrapRef 358 | readonly onBeforeRouteUpdate: UnwrapRef 359 | readonly onBeforeUnmount: UnwrapRef 360 | readonly onBeforeUpdate: UnwrapRef 361 | readonly onClickOutside: UnwrapRef 362 | readonly onDeactivated: UnwrapRef 363 | readonly onErrorCaptured: UnwrapRef 364 | readonly onKeyStroke: UnwrapRef 365 | readonly onLongPress: UnwrapRef 366 | readonly onMounted: UnwrapRef 367 | readonly onRenderTracked: UnwrapRef 368 | readonly onRenderTriggered: UnwrapRef 369 | readonly onScopeDispose: UnwrapRef 370 | readonly onServerPrefetch: UnwrapRef 371 | readonly onStartTyping: UnwrapRef 372 | readonly onUnmounted: UnwrapRef 373 | readonly onUpdated: UnwrapRef 374 | readonly pausableWatch: UnwrapRef 375 | readonly provide: UnwrapRef 376 | readonly reactify: UnwrapRef 377 | readonly reactifyObject: UnwrapRef 378 | readonly reactive: UnwrapRef 379 | readonly reactiveComputed: UnwrapRef 380 | readonly reactiveOmit: UnwrapRef 381 | readonly reactivePick: UnwrapRef 382 | readonly readonly: UnwrapRef 383 | readonly ref: UnwrapRef 384 | readonly refAutoReset: UnwrapRef 385 | readonly refDebounced: UnwrapRef 386 | readonly refDefault: UnwrapRef 387 | readonly refThrottled: UnwrapRef 388 | readonly refWithControl: UnwrapRef 389 | readonly reloadMemosBus: UnwrapRef 390 | readonly resolveComponent: UnwrapRef 391 | readonly resolveRef: UnwrapRef 392 | readonly resolveUnref: UnwrapRef 393 | readonly searchMemosBus: UnwrapRef 394 | readonly shallowReactive: UnwrapRef 395 | readonly shallowReadonly: UnwrapRef 396 | readonly shallowRef: UnwrapRef 397 | readonly syncRef: UnwrapRef 398 | readonly syncRefs: UnwrapRef 399 | readonly templateRef: UnwrapRef 400 | readonly themeChangeBus: UnwrapRef 401 | readonly throttledRef: UnwrapRef 402 | readonly throttledWatch: UnwrapRef 403 | readonly toRaw: UnwrapRef 404 | readonly toReactive: UnwrapRef 405 | readonly toRef: UnwrapRef 406 | readonly toRefs: UnwrapRef 407 | readonly toggleDrauuBus: UnwrapRef 408 | readonly triggerRef: UnwrapRef 409 | readonly tryOnBeforeMount: UnwrapRef 410 | readonly tryOnBeforeUnmount: UnwrapRef 411 | readonly tryOnMounted: UnwrapRef 412 | readonly tryOnScopeDispose: UnwrapRef 413 | readonly tryOnUnmounted: UnwrapRef 414 | readonly unref: UnwrapRef 415 | readonly unrefElement: UnwrapRef 416 | readonly until: UnwrapRef 417 | readonly useActiveElement: UnwrapRef 418 | readonly useAnimate: UnwrapRef 419 | readonly useArrayDifference: UnwrapRef 420 | readonly useArrayEvery: UnwrapRef 421 | readonly useArrayFilter: UnwrapRef 422 | readonly useArrayFind: UnwrapRef 423 | readonly useArrayFindIndex: UnwrapRef 424 | readonly useArrayFindLast: UnwrapRef 425 | readonly useArrayIncludes: UnwrapRef 426 | readonly useArrayJoin: UnwrapRef 427 | readonly useArrayMap: UnwrapRef 428 | readonly useArrayReduce: UnwrapRef 429 | readonly useArraySome: UnwrapRef 430 | readonly useArrayUnique: UnwrapRef 431 | readonly useAsyncQueue: UnwrapRef 432 | readonly useAsyncState: UnwrapRef 433 | readonly useAttrs: UnwrapRef 434 | readonly useBase64: UnwrapRef 435 | readonly useBattery: UnwrapRef 436 | readonly useBluetooth: UnwrapRef 437 | readonly useBreakpoints: UnwrapRef 438 | readonly useBroadcastChannel: UnwrapRef 439 | readonly useBrowserLocation: UnwrapRef 440 | readonly useCached: UnwrapRef 441 | readonly useClipboard: UnwrapRef 442 | readonly useCloned: UnwrapRef 443 | readonly useColorMode: UnwrapRef 444 | readonly useConfirmDialog: UnwrapRef 445 | readonly useCounter: UnwrapRef 446 | readonly useCssModule: UnwrapRef 447 | readonly useCssVar: UnwrapRef 448 | readonly useCssVars: UnwrapRef 449 | readonly useCurrentElement: UnwrapRef 450 | readonly useCycleList: UnwrapRef 451 | readonly useDark: UnwrapRef 452 | readonly useDateFormat: UnwrapRef 453 | readonly useDebounce: UnwrapRef 454 | readonly useDebounceFn: UnwrapRef 455 | readonly useDebouncedRefHistory: UnwrapRef 456 | readonly useDeviceMotion: UnwrapRef 457 | readonly useDeviceOrientation: UnwrapRef 458 | readonly useDevicePixelRatio: UnwrapRef 459 | readonly useDevicesList: UnwrapRef 460 | readonly useDialog: UnwrapRef 461 | readonly useDisplayMedia: UnwrapRef 462 | readonly useDocumentVisibility: UnwrapRef 463 | readonly useDraggable: UnwrapRef 464 | readonly useDropZone: UnwrapRef 465 | readonly useElementBounding: UnwrapRef 466 | readonly useElementByPoint: UnwrapRef 467 | readonly useElementHover: UnwrapRef 468 | readonly useElementSize: UnwrapRef 469 | readonly useElementVisibility: UnwrapRef 470 | readonly useEventBus: UnwrapRef 471 | readonly useEventListener: UnwrapRef 472 | readonly useEventSource: UnwrapRef 473 | readonly useEyeDropper: UnwrapRef 474 | readonly useFavicon: UnwrapRef 475 | readonly useFetch: UnwrapRef 476 | readonly useFileDialog: UnwrapRef 477 | readonly useFileSystemAccess: UnwrapRef 478 | readonly useFocus: UnwrapRef 479 | readonly useFocusWithin: UnwrapRef 480 | readonly useFps: UnwrapRef 481 | readonly useFullscreen: UnwrapRef 482 | readonly useGamepad: UnwrapRef 483 | readonly useGeolocation: UnwrapRef 484 | readonly useIdle: UnwrapRef 485 | readonly useImage: UnwrapRef 486 | readonly useInfiniteScroll: UnwrapRef 487 | readonly useIntersectionObserver: UnwrapRef 488 | readonly useInterval: UnwrapRef 489 | readonly useIntervalFn: UnwrapRef 490 | readonly useKeyModifier: UnwrapRef 491 | readonly useLastChanged: UnwrapRef 492 | readonly useLink: UnwrapRef 493 | readonly useLoadingBar: UnwrapRef 494 | readonly useLocalStorage: UnwrapRef 495 | readonly useMagicKeys: UnwrapRef 496 | readonly useManualRefHistory: UnwrapRef 497 | readonly useMediaControls: UnwrapRef 498 | readonly useMediaQuery: UnwrapRef 499 | readonly useMemoize: UnwrapRef 500 | readonly useMemory: UnwrapRef 501 | readonly useMounted: UnwrapRef 502 | readonly useMouse: UnwrapRef 503 | readonly useMouseInElement: UnwrapRef 504 | readonly useMousePressed: UnwrapRef 505 | readonly useMutationObserver: UnwrapRef 506 | readonly useMyFetch: UnwrapRef 507 | readonly useNavigatorLanguage: UnwrapRef 508 | readonly useNetwork: UnwrapRef 509 | readonly useNotification: UnwrapRef 510 | readonly useNow: UnwrapRef 511 | readonly useObjectUrl: UnwrapRef 512 | readonly useOffsetPagination: UnwrapRef 513 | readonly useOnline: UnwrapRef 514 | readonly usePageLeave: UnwrapRef 515 | readonly useParallax: UnwrapRef 516 | readonly useParentElement: UnwrapRef 517 | readonly usePerformanceObserver: UnwrapRef 518 | readonly usePermission: UnwrapRef 519 | readonly usePointer: UnwrapRef 520 | readonly usePointerLock: UnwrapRef 521 | readonly usePointerSwipe: UnwrapRef 522 | readonly usePreferredColorScheme: UnwrapRef 523 | readonly usePreferredContrast: UnwrapRef 524 | readonly usePreferredDark: UnwrapRef 525 | readonly usePreferredLanguages: UnwrapRef 526 | readonly usePreferredReducedMotion: UnwrapRef 527 | readonly usePrevious: UnwrapRef 528 | readonly useRafFn: UnwrapRef 529 | readonly useRefHistory: UnwrapRef 530 | readonly useResizeObserver: UnwrapRef 531 | readonly useRoute: UnwrapRef 532 | readonly useRouter: UnwrapRef 533 | readonly useScreenOrientation: UnwrapRef 534 | readonly useScreenSafeArea: UnwrapRef 535 | readonly useScriptTag: UnwrapRef 536 | readonly useScroll: UnwrapRef 537 | readonly useScrollLock: UnwrapRef 538 | readonly useSessionStorage: UnwrapRef 539 | readonly useShare: UnwrapRef 540 | readonly useSlots: UnwrapRef 541 | readonly useSorted: UnwrapRef 542 | readonly useSpeechRecognition: UnwrapRef 543 | readonly useSpeechSynthesis: UnwrapRef 544 | readonly useStepper: UnwrapRef 545 | readonly useStorage: UnwrapRef 546 | readonly useStorageAsync: UnwrapRef 547 | readonly useStyleTag: UnwrapRef 548 | readonly useSupported: UnwrapRef 549 | readonly useSwipe: UnwrapRef 550 | readonly useTemplateRefsList: UnwrapRef 551 | readonly useTextDirection: UnwrapRef 552 | readonly useTextSelection: UnwrapRef 553 | readonly useTextareaAutosize: UnwrapRef 554 | readonly useThrottle: UnwrapRef 555 | readonly useThrottleFn: UnwrapRef 556 | readonly useThrottledRefHistory: UnwrapRef 557 | readonly useTimeAgo: UnwrapRef 558 | readonly useTimeout: UnwrapRef 559 | readonly useTimeoutFn: UnwrapRef 560 | readonly useTimeoutPoll: UnwrapRef 561 | readonly useTimestamp: UnwrapRef 562 | readonly useTitle: UnwrapRef 563 | readonly useToNumber: UnwrapRef 564 | readonly useToString: UnwrapRef 565 | readonly useToggle: UnwrapRef 566 | readonly useTransition: UnwrapRef 567 | readonly useUrlSearchParams: UnwrapRef 568 | readonly useUserMedia: UnwrapRef 569 | readonly useVModel: UnwrapRef 570 | readonly useVModels: UnwrapRef 571 | readonly useVibrate: UnwrapRef 572 | readonly useVirtualList: UnwrapRef 573 | readonly useWakeLock: UnwrapRef 574 | readonly useWebNotification: UnwrapRef 575 | readonly useWebSocket: UnwrapRef 576 | readonly useWebWorker: UnwrapRef 577 | readonly useWebWorkerFn: UnwrapRef 578 | readonly useWindowFocus: UnwrapRef 579 | readonly useWindowScroll: UnwrapRef 580 | readonly useWindowSize: UnwrapRef 581 | readonly watch: UnwrapRef 582 | readonly watchArray: UnwrapRef 583 | readonly watchAtMost: UnwrapRef 584 | readonly watchDebounced: UnwrapRef 585 | readonly watchDeep: UnwrapRef 586 | readonly watchEffect: UnwrapRef 587 | readonly watchIgnorable: UnwrapRef 588 | readonly watchImmediate: UnwrapRef 589 | readonly watchOnce: UnwrapRef 590 | readonly watchPausable: UnwrapRef 591 | readonly watchPostEffect: UnwrapRef 592 | readonly watchSyncEffect: UnwrapRef 593 | readonly watchThrottled: UnwrapRef 594 | readonly watchTriggerable: UnwrapRef 595 | readonly watchWithFilter: UnwrapRef 596 | readonly whenever: UnwrapRef 597 | } 598 | } 599 | -------------------------------------------------------------------------------- /src/components.d.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | /* prettier-ignore */ 3 | // @ts-nocheck 4 | // Generated by unplugin-vue-components 5 | // Read more: https://github.com/vuejs/core/pull/3399 6 | import '@vue/runtime-core' 7 | 8 | export {} 9 | 10 | declare module '@vue/runtime-core' { 11 | export interface GlobalComponents { 12 | Comment: typeof import('./components/Comment.vue')['default'] 13 | CommentInput: typeof import('./components/CommentInput.vue')['default'] 14 | DevConfig: typeof import('./components/settings/DevConfig.vue')['default'] 15 | Drauu: typeof import('./components/Drauu.vue')['default'] 16 | FriendsCommentInput: typeof import('./components/themes/FriendsCommentInput.vue')['default'] 17 | FriendsMemo: typeof import('./components/themes/FriendsMemo.vue')['default'] 18 | FriendsMemoInput: typeof import('./components/themes/FriendsMemoInput.vue')['default'] 19 | Import: typeof import('./components/settings/Import.vue')['default'] 20 | LeftNav: typeof import('./components/LeftNav.vue')['default'] 21 | MarkdownInput: typeof import('./components/Markdown-input.vue')['default'] 22 | MeAll: typeof import('./components/MeAll.vue')['default'] 23 | Memo: typeof import('./components/Memo.vue')['default'] 24 | MemoInput: typeof import('./components/MemoInput.vue')['default'] 25 | Mine: typeof import('./components/Mine.vue')['default'] 26 | NAvatar: typeof import('naive-ui')['NAvatar'] 27 | NButton: typeof import('naive-ui')['NButton'] 28 | NConfigProvider: typeof import('naive-ui')['NConfigProvider'] 29 | NDrawer: typeof import('naive-ui')['NDrawer'] 30 | NDrawerContent: typeof import('naive-ui')['NDrawerContent'] 31 | NImage: typeof import('naive-ui')['NImage'] 32 | NImageGroup: typeof import('naive-ui')['NImageGroup'] 33 | NInput: typeof import('naive-ui')['NInput'] 34 | NMention: typeof import('naive-ui')['NMention'] 35 | NSpace: typeof import('naive-ui')['NSpace'] 36 | NTooltip: typeof import('naive-ui')['NTooltip'] 37 | RightNav: typeof import('./components/RightNav.vue')['default'] 38 | RouterLink: typeof import('vue-router')['RouterLink'] 39 | RouterView: typeof import('vue-router')['RouterView'] 40 | Statistics: typeof import('./components/Statistics.vue')['default'] 41 | SysConfig: typeof import('./components/settings/SysConfig.vue')['default'] 42 | TagManage: typeof import('./components/settings/TagManage.vue')['default'] 43 | Top10Tag: typeof import('./components/Top10Tag.vue')['default'] 44 | UserConfig: typeof import('./components/settings/UserConfig.vue')['default'] 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/components/Comment.vue: -------------------------------------------------------------------------------- 1 | 25 | 57 | 58 | 109 | 110 | 111 | -------------------------------------------------------------------------------- /src/components/CommentInput.vue: -------------------------------------------------------------------------------- 1 | 37 | 38 | 122 | 123 | 124 | -------------------------------------------------------------------------------- /src/components/Drauu.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 19 | 20 | 32 | -------------------------------------------------------------------------------- /src/components/LeftNav.vue: -------------------------------------------------------------------------------- 1 | 80 | 81 | 113 | 114 | 127 | -------------------------------------------------------------------------------- /src/components/Markdown-input.vue: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /src/components/MeAll.vue: -------------------------------------------------------------------------------- 1 | 30 | 31 | 125 | 126 | 127 | -------------------------------------------------------------------------------- /src/components/Memo.vue: -------------------------------------------------------------------------------- 1 | 180 | 181 | 308 | 309 | 368 | -------------------------------------------------------------------------------- /src/components/MemoInput.vue: -------------------------------------------------------------------------------- 1 | 161 | 162 | 387 | 388 | 413 | -------------------------------------------------------------------------------- /src/components/Mine.vue: -------------------------------------------------------------------------------- 1 | 15 | 16 | 50 | 51 | 52 | -------------------------------------------------------------------------------- /src/components/RightNav.vue: -------------------------------------------------------------------------------- 1 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/components/Statistics.vue: -------------------------------------------------------------------------------- 1 | 28 | 29 | 90 | 91 | 104 | -------------------------------------------------------------------------------- /src/components/Top10Tag.vue: -------------------------------------------------------------------------------- 1 | 14 | 15 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /src/components/settings/DevConfig.vue: -------------------------------------------------------------------------------- 1 | 82 | 83 | 130 | 131 | 132 | -------------------------------------------------------------------------------- /src/components/settings/Import.vue: -------------------------------------------------------------------------------- 1 | 8 | 9 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /src/components/settings/SysConfig.vue: -------------------------------------------------------------------------------- 1 | 182 | 183 | 341 | 342 | 343 | 344 | meta: 345 | layout: manage 346 | 347 | -------------------------------------------------------------------------------- /src/components/settings/TagManage.vue: -------------------------------------------------------------------------------- 1 | 9 | 10 | 120 | 121 | 122 | -------------------------------------------------------------------------------- /src/components/settings/UserConfig.vue: -------------------------------------------------------------------------------- 1 | 51 | 52 | 110 | 111 | 112 | 113 | meta: 114 | layout: manage 115 | 116 | -------------------------------------------------------------------------------- /src/components/themes/FriendsCommentInput.vue: -------------------------------------------------------------------------------- 1 | 26 | 27 | 115 | 116 | 117 | -------------------------------------------------------------------------------- /src/components/themes/FriendsMemo.vue: -------------------------------------------------------------------------------- 1 | 83 | 84 | 177 | 178 | -------------------------------------------------------------------------------- /src/components/themes/FriendsMemoInput.vue: -------------------------------------------------------------------------------- 1 | 161 | 162 | 387 | 388 | 413 | -------------------------------------------------------------------------------- /src/directives/directives.ts: -------------------------------------------------------------------------------- 1 | import type { App } from 'vue' 2 | 3 | const sessionStorage = useSessionStorage('config', { 4 | OPEN_REGISTER: false, 5 | WEBSITE_TITLE: 'MBlog', 6 | USER_MODEL: 'SINGLE', 7 | OPEN_COMMENT: false, 8 | OPEN_LIKE: false, 9 | ANONYMOUS_COMMENT: false, 10 | }) 11 | const userinfo = useLocalStorage('userinfo', { userId: 0 }) 12 | 13 | export const installDirectives = (app: App) => { 14 | app.directive('openRegister', { 15 | mounted: (el: Element) => { 16 | if (sessionStorage.value.OPEN_REGISTER !== true) { 17 | el.parentNode && el.parentNode.removeChild(el) 18 | } 19 | }, 20 | }) 21 | 22 | app.directive('openComment', { 23 | mounted: (el: Element) => { 24 | if (sessionStorage.value.OPEN_COMMENT !== true) { 25 | el.parentNode && el.parentNode.removeChild(el) 26 | return 27 | } 28 | if (!userinfo.value.userId && sessionStorage.value.ANONYMOUS_COMMENT === false) { 29 | el.parentNode && el.parentNode.removeChild(el) 30 | return 31 | } 32 | }, 33 | }) 34 | 35 | app.directive('openLike', { 36 | mounted: (el: Element) => { 37 | if (sessionStorage.value.OPEN_LIKE !== true) { 38 | el.parentNode && el.parentNode.removeChild(el) 39 | } 40 | }, 41 | }) 42 | } 43 | -------------------------------------------------------------------------------- /src/event/event.ts: -------------------------------------------------------------------------------- 1 | import type { MemoSearchParam, MemoDTO, MemoSaveParam } from '@/types/memo' 2 | 3 | export const searchMemosBus = useEventBus>('searchMemos') 4 | export const reloadMemosBus = useEventBus>('reloadMemos') 5 | export const editMemoBus = useEventBus('editMemo') 6 | export const changedMemoBus = useEventBus('changedMemo') 7 | export const closeDrawerBus = useEventBus<{}>('closeDrawer') 8 | export const themeChangeBus = useEventBus<{ theme: string }>('themeChange') 9 | export const toggleDrauuBus = useEventBus<{ theme: string }>('toggleDrauu') 10 | export const commetSavedBus = useEventBus<{}>('commetSaved') 11 | -------------------------------------------------------------------------------- /src/global.d.ts: -------------------------------------------------------------------------------- 1 | declare global { 2 | interface Window { 3 | $message: any 4 | } 5 | } 6 | export {} 7 | -------------------------------------------------------------------------------- /src/layouts/default.vue: -------------------------------------------------------------------------------- 1 | 31 | 32 | 105 | 106 | 123 | -------------------------------------------------------------------------------- /src/main.ts: -------------------------------------------------------------------------------- 1 | import './style.css' 2 | import '@unocss/reset/normalize.css' 3 | import { createApp } from 'vue' 4 | import { createPinia } from 'pinia' 5 | import generatedRoutes from '~pages' 6 | import App from './App.vue' 7 | import 'virtual:uno.css' 8 | import { setupLayouts } from 'virtual:generated-layouts' 9 | import { createRouter, createWebHashHistory, createWebHistory } from 'vue-router' 10 | import { installDirectives } from './directives/directives' 11 | 12 | const app = createApp(App) 13 | const routes = setupLayouts(generatedRoutes) 14 | const pinia = createPinia() 15 | 16 | const router = createRouter({ 17 | routes, 18 | history: import.meta.env.MODE === 'all' ? createWebHashHistory() : createWebHistory(), 19 | }) 20 | 21 | router.beforeEach((to, from, next) => { 22 | const userinfo = useStorage('userinfo', { username: '', token: '' }) 23 | if (userinfo.value.token) { 24 | if (to.path === '/login') { 25 | return next('/') 26 | } 27 | } else { 28 | if (['/', '/register', '/login'].includes(to.path) || to.path.startsWith('/memo/')|| to.path.startsWith('/friends_index')) { 29 | return next() 30 | } else { 31 | return next('/login?redirect=' + to.path) 32 | } 33 | } 34 | next() 35 | }) 36 | app.use(router) 37 | app.use(pinia) 38 | 39 | installDirectives(app) 40 | 41 | app.mount('#app') 42 | -------------------------------------------------------------------------------- /src/pages/defaultIndex.vue: -------------------------------------------------------------------------------- 1 | 51 | 52 | 177 | 178 | 179 | -------------------------------------------------------------------------------- /src/pages/friendsIndex.vue: -------------------------------------------------------------------------------- 1 | 2 | meta: 3 | layout: friends 4 | 5 | 27 | 28 | 123 | 124 | -------------------------------------------------------------------------------- /src/pages/index.vue: -------------------------------------------------------------------------------- 1 | 4 | 5 | -------------------------------------------------------------------------------- /src/pages/login.vue: -------------------------------------------------------------------------------- 1 | 23 | 24 | 79 | 80 | 81 | -------------------------------------------------------------------------------- /src/pages/me.vue: -------------------------------------------------------------------------------- 1 | 27 | 28 | 60 | 61 | 73 | -------------------------------------------------------------------------------- /src/pages/memo/[id].vue: -------------------------------------------------------------------------------- 1 | 33 | 34 | 89 | 90 | 91 | -------------------------------------------------------------------------------- /src/pages/register.vue: -------------------------------------------------------------------------------- 1 | 42 | 43 | 111 | 112 | 113 | -------------------------------------------------------------------------------- /src/pages/search.vue: -------------------------------------------------------------------------------- 1 | 82 | 83 | 153 | 154 | 155 | -------------------------------------------------------------------------------- /src/pages/settings.vue: -------------------------------------------------------------------------------- 1 | 17 | 18 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /src/style.css: -------------------------------------------------------------------------------- 1 | /* @import 'https://cdn.staticfile.org/lxgw-wenkai-screen-webfont/1.7.0/lxgwwenkaiscreen.min.css'; */ 2 | 3 | 4 | @font-face { 5 | font-family: MiSans; 6 | src: url('https://yoyo.s3.bitiful.net/misan-normal.ttf'); 7 | } 8 | html { 9 | height: 100%; 10 | background-color: #f4f4f5; 11 | font-size: 16px; 12 | } 13 | 14 | 15 | html.dark { 16 | background-color: #000 !important; 17 | } 18 | 19 | * { 20 | /* font-family: LXGW WenKai Screen, sans-serif; */ 21 | font-family: MiSans, sans-serif; 22 | } 23 | 24 | .md-content { 25 | font-size: 1rem; 26 | line-height: 2rem; 27 | } 28 | 29 | .md-content a:any-link { 30 | color: rgb(156, 163, 175); 31 | } 32 | [v-cloak] { 33 | display: none; 34 | } 35 | 36 | .md-content pre { 37 | /* font-family: 'Courier New', Courier, monospace; */ 38 | white-space: pre-wrap; /* css-3 */ 39 | word-wrap: break-word; /* InternetExplorer5.5+ */ 40 | white-space: -moz-pre-wrap; /* Mozilla,since1999 */ 41 | white-space: -pre-wrap; /* Opera4-6 */ 42 | white-space: -o-pre-wrap; /* Opera7 */ 43 | 44 | background-color: #000; 45 | color: wheat; 46 | padding: 4px 10px; 47 | border-radius: 5px; 48 | } 49 | 50 | .md-content code { 51 | font-family: LXGW WenKai Screen, sans-serif; 52 | font-size: 0.9rem; 53 | } 54 | 55 | .md-content p { 56 | margin: 0 0 0.25rem 0; 57 | } 58 | .md-content ul, 59 | .md-content ol { 60 | margin: 0 0 0.25rem 0; 61 | } 62 | 63 | .md-content li > code, 64 | .md-content p > code, 65 | .md-content td > code { 66 | padding: 2px 5px; 67 | border-radius: 2px; 68 | border: 1px solid #ccc; 69 | margin: 0 4px; 70 | } 71 | 72 | .md-content .mentioned { 73 | display: inline-block; 74 | margin: 0 4px; 75 | text-decoration: underline; 76 | text-decoration-color: teal; 77 | } 78 | 79 | .md-content .mentioned.self { 80 | color: red; 81 | } 82 | 83 | .md-content .mentioned:hover { 84 | color: #000; 85 | font-weight: 600; 86 | cursor: pointer; 87 | } 88 | 89 | .md-content img { 90 | max-width: 300px; 91 | max-height: 300px; 92 | object-fit: cover; 93 | } 94 | 95 | html.dark .men { 96 | color: rgba(255, 255, 255, 0.9) !important; 97 | } 98 | 99 | html.dark .n-tabs-tab--active .men { 100 | color: var(--n-tab-text-color-active) !important; 101 | } 102 | 103 | .n-tabs-tab--active .men { 104 | color: var(--n-tab-text-color-active) !important; 105 | } 106 | 107 | html.dark .n-tabs-nav--bar-type { 108 | background-color: black; 109 | } 110 | 111 | .md-content table { 112 | border: 1px solid #ccc; 113 | border-collapse: collapse; 114 | width: 100%; 115 | } 116 | 117 | .md-content table td, 118 | .md-content table th { 119 | border: 1px solid #ccc; 120 | padding: 4px 10px; 121 | } 122 | 123 | .md-content table th { 124 | background-color: rgba(158, 188, 226, 0.2); 125 | /* color: white; */ 126 | } 127 | 128 | .md-content hr { 129 | border: 1px solid #dedede; 130 | color: #cccccc; 131 | } 132 | 133 | .friend-md *{ 134 | } 135 | 136 | .friend-md p{ 137 | margin: 0 0 0.25rem 0; 138 | } 139 | 140 | .friend-md a{ 141 | text-decoration: none; 142 | color:#576b95; 143 | } -------------------------------------------------------------------------------- /src/types/comment.ts: -------------------------------------------------------------------------------- 1 | export interface CommentDTO { 2 | id: number 3 | userId: number 4 | content: string 5 | mentioned: string 6 | mentionedUserId: string 7 | memoId: number 8 | userName: string 9 | created: Date 10 | updated: Date 11 | email: string 12 | link: string 13 | approved: number 14 | } 15 | 16 | export interface QueryCommentResponse { 17 | total: number 18 | totalPage: number 19 | list: Array 20 | } 21 | -------------------------------------------------------------------------------- /src/types/config.ts: -------------------------------------------------------------------------------- 1 | export interface SysConfig { 2 | CORS_DOMAIN_LIST: string 3 | DOMAIN: string 4 | OPEN_REGISTER: string 5 | QINIU_PARAM: string 6 | STORAGE_TYPE: string 7 | WEBSITE_TITLE: string 8 | MEMO_MAX_LENGTH: string 9 | INDEX_WIDTH: string 10 | USER_MODEL: string 11 | CUSTOM_CSS: string 12 | CUSTOM_JAVASCRIPT: string 13 | [k: string]: any 14 | } 15 | 16 | export interface OssStorage { 17 | accessKey: string 18 | secretKey: string 19 | bucket: string 20 | domain: string 21 | prefix: string 22 | suffix: string 23 | region: string 24 | } 25 | -------------------------------------------------------------------------------- /src/types/memo.ts: -------------------------------------------------------------------------------- 1 | export interface MemoDTO { 2 | id: number 3 | userId: number 4 | content: string 5 | tags?: string 6 | visibility: string 7 | status: string 8 | created: string 9 | updated: string 10 | authorName: string 11 | authorRole: string 12 | email: string 13 | bio: string 14 | priority: number 15 | commentCount: number 16 | unApprovedCommentCount: number 17 | likeCount: number 18 | enableComment: number 19 | viewCount: number 20 | liked: number 21 | source: string 22 | resources: Array<{ 23 | publicId: string 24 | url: string 25 | fileType: string 26 | suffix: string 27 | storageType: string 28 | fileName: string 29 | }> 30 | } 31 | 32 | export type MemoInputDto = Partial 33 | 34 | export interface ListMemoResponse { 35 | items: Array 36 | total: number 37 | totalPage: number 38 | } 39 | 40 | export interface MemoSearchParam { 41 | tag?: string 42 | userId?: number 43 | username?: string 44 | visibility?: string 45 | page: number 46 | size: number 47 | begin?: Date 48 | end?: Date 49 | } 50 | 51 | export interface MemoSaveParam { 52 | id?: number 53 | content?: string 54 | publicIds?: Array 55 | visibility?: string 56 | priority?: number 57 | enableComment?: number | string 58 | deleteMemo?: boolean 59 | } 60 | export enum MemoVisibility { 61 | PUBLIC = '所有人可见', 62 | PROTECT = '登录用户可见', 63 | PRIVATE = '自己可见', 64 | } 65 | 66 | export const getVisbilityDesc = (value: string) => { 67 | return Object.entries(MemoVisibility).find(([key]) => key === value)?.[1] 68 | } 69 | 70 | export const getVisbilitys = () => { 71 | return Object.entries(MemoVisibility).map(([key, val]) => { 72 | return { 73 | label: val, 74 | value: key, 75 | } 76 | }) 77 | } 78 | 79 | export interface StatisticsDTO { 80 | totalMemos: number 81 | totalDays: number 82 | totalTags: number 83 | items: Array<{ 84 | date: string 85 | total: number 86 | }> 87 | } 88 | -------------------------------------------------------------------------------- /src/types/tag.ts: -------------------------------------------------------------------------------- 1 | export interface Tag { 2 | id: number 3 | name: string 4 | count: number 5 | edited: boolean 6 | } 7 | -------------------------------------------------------------------------------- /src/types/token.ts: -------------------------------------------------------------------------------- 1 | export interface Token { 2 | id: number 3 | name: string 4 | token: string 5 | } 6 | -------------------------------------------------------------------------------- /src/types/user.ts: -------------------------------------------------------------------------------- 1 | export interface User { 2 | id: number 3 | username: string 4 | email: string 5 | displayName: string 6 | bio: string 7 | created: string 8 | updated: string 9 | role: string 10 | avatarUrl: string 11 | defaultVisibility: string 12 | defaultEnableComment: string 13 | } 14 | 15 | export interface RegisterUserDTO { 16 | username: string 17 | password: string 18 | repeatPassword: string 19 | displayName: string 20 | bio: string 21 | email: string 22 | } 23 | -------------------------------------------------------------------------------- /tsconfig.app.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "@vue/tsconfig/tsconfig.dom.json", 3 | "include": ["env.d.ts", "src/**/*", "src/**/*.vue"], 4 | "exclude": ["src/**/__tests__/*"], 5 | "compilerOptions": { 6 | "composite": true, 7 | "baseUrl": ".", 8 | "paths": { 9 | "@/*": ["./src/*"] 10 | }, 11 | "lib": ["ES2021"], 12 | "types": ["vite-plugin-pages/client", "vite/client", "naive-ui/volar"] 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [], 3 | "references": [ 4 | { 5 | "path": "./tsconfig.node.json" 6 | }, 7 | { 8 | "path": "./tsconfig.app.json" 9 | } 10 | ] 11 | } 12 | -------------------------------------------------------------------------------- /tsconfig.node.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "@tsconfig/node18/tsconfig.json", 3 | "include": ["vite.config.*", "vitest.config.*", "cypress.config.*", "playwright.config.*"], 4 | "compilerOptions": { 5 | "composite": true, 6 | "module": "ESNext", 7 | "types": ["node"] 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /uno.config.ts: -------------------------------------------------------------------------------- 1 | import { 2 | defineConfig, 3 | presetAttributify, 4 | presetIcons, 5 | presetTypography, 6 | presetUno, 7 | transformerDirectives, 8 | transformerVariantGroup, 9 | } from 'unocss' 10 | 11 | export default defineConfig({ 12 | theme: { 13 | colors: {}, 14 | breakpoints: { 15 | sm: '320px', 16 | md: '640px', 17 | lg: '1024px', 18 | xl: '1280px', 19 | '2xl': '1536px', 20 | }, 21 | }, 22 | shortcuts: { 23 | fc: 'flex flex-col', 24 | fr: 'flex flex-row', 25 | }, 26 | presets: [ 27 | presetUno(), 28 | presetAttributify(), 29 | presetIcons({ 30 | cdn: 'https://esm.sh/', 31 | scale: 1.2, 32 | warn: true, 33 | }), 34 | presetTypography(), 35 | ], 36 | transformers: [transformerDirectives(), transformerVariantGroup()], 37 | }) 38 | -------------------------------------------------------------------------------- /vite.config.ts: -------------------------------------------------------------------------------- 1 | import { fileURLToPath, URL } from 'node:url' 2 | import Components from 'unplugin-vue-components/vite' 3 | import Pages from 'vite-plugin-pages' 4 | import { NaiveUiResolver } from 'unplugin-vue-components/resolvers' 5 | import Layouts from 'vite-plugin-vue-layouts' 6 | import UnoCSS from 'unocss/vite' 7 | import AutoImport from 'unplugin-auto-import/vite' 8 | import { VitePWA } from 'vite-plugin-pwa' 9 | 10 | import { defineConfig } from 'vite' 11 | import vue from '@vitejs/plugin-vue' 12 | 13 | export default defineConfig({ 14 | plugins: [ 15 | VitePWA(), 16 | vue({ 17 | template: { 18 | compilerOptions: { 19 | isCustomElement: (tag) => tag === 'emoji-picker', 20 | }, 21 | }, 22 | }), 23 | UnoCSS({}), 24 | Components({ 25 | resolvers: [NaiveUiResolver()], 26 | extensions: ['vue'], 27 | include: [/\.vue$/, /\.vue\?vue/], 28 | dts: 'src/components.d.ts', 29 | }), 30 | Pages(), 31 | Layouts(), 32 | AutoImport({ 33 | imports: [ 34 | 'vue', 35 | 'vue-router', 36 | '@vueuse/core', 37 | { 38 | 'naive-ui': ['useDialog', 'createDiscreteApi', 'useNotification', 'useLoadingBar'], 39 | }, 40 | ], 41 | dirs: ['src/api', 'src/event', 'src/types'], 42 | dts: 'src/auto-imports.d.ts', 43 | vueTemplate: true, 44 | }), 45 | ], 46 | resolve: { 47 | alias: { 48 | '@': fileURLToPath(new URL('./src', import.meta.url)), 49 | }, 50 | }, 51 | }) 52 | --------------------------------------------------------------------------------