diff --git a/.env.development b/.env.development index 548fc857..9e558cf5 100644 --- a/.env.development +++ b/.env.development @@ -2,12 +2,14 @@ VITE_APP_PORT = 3000 # 代理前缀 -VITE_APP_BASE_API = '/dev-api' +VITE_APP_BASE_API = /dev-api -# 线上接口地址 -VITE_APP_API_URL = http://vapi.youlai.tech -# 开发接口地址 -# VITE_APP_API_URL = http://localhost:8989 +# 接口地址 +VITE_APP_API_URL = https://api.youlai.tech # 线上 +# VITE_APP_API_URL = http://localhost:8989 # 本地 -# 是否启用 Mock 服务 +# WebSocket 端点(不配置则关闭),线上 ws://api.youlai.tech/ws ,本地 ws://localhost:8989/ws +VITE_APP_WS_ENDPOINT = + +# 启用 Mock 服务 VITE_MOCK_DEV_SERVER = false diff --git a/.env.production b/.env.production index 74d45c16..9669b46e 100644 --- a/.env.production +++ b/.env.production @@ -1,3 +1,6 @@ # 代理前缀 VITE_APP_BASE_API = '/prod-api' + +# WebSocket端点(可选) +VITE_APP_WS_ENDPOINT = wss://api.youlai.tech/ws diff --git a/.eslintignore b/.eslintignore deleted file mode 100644 index 43af40f4..00000000 --- a/.eslintignore +++ /dev/null @@ -1,14 +0,0 @@ -dist -node_modules -public -.husky -.vscode -.idea -*.sh -*.md - -src/assets - -.eslintrc.cjs -.prettierrc.cjs -.stylelintrc.cjs diff --git a/.eslintrc-auto-import.json b/.eslintrc-auto-import.json index f4738bfc..0e8546f8 100644 --- a/.eslintrc-auto-import.json +++ b/.eslintrc-auto-import.json @@ -279,6 +279,38 @@ "watchThrottled": true, "watchTriggerable": true, "watchWithFilter": true, - "whenever": true + "useRoute": true, + "useRouter": true, + "storeToRefs": true, + "whenever": true, + "DirectiveBinding": true, + "ExtractDefaultPropTypes": true, + "ExtractPropTypes": true, + "ExtractPublicPropTypes": true, + "MaybeRef": true, + "MaybeRefOrGetter": true, + "WritableComputedRef": true, + "acceptHMRUpdate": true, + "createPinia": true, + "defineStore": true, + "getActivePinia": true, + "injectLocal": true, + "mapActions": true, + "mapGetters": true, + "mapState": true, + "mapStores": true, + "mapWritableState": true, + "onBeforeRouteLeave": true, + "onBeforeRouteUpdate": true, + "onWatcherCleanup": true, + "provideLocal": true, + "setActivePinia": true, + "setMapStoreSuffix": true, + "useClipboardItems": true, + "useI18n": true, + "useId": true, + "useLink": true, + "useModel": true, + "useTemplateRef": true } } diff --git a/.eslintrc.cjs b/.eslintrc.cjs deleted file mode 100644 index 8ae169a9..00000000 --- a/.eslintrc.cjs +++ /dev/null @@ -1,88 +0,0 @@ -module.exports = { - root: true, - env: { - browser: true, - es2021: true, - node: true, - }, - parser: "vue-eslint-parser", - extends: [ - // https://eslint.vuejs.org/user-guide/#usage - "plugin:vue/vue3-recommended", - "./.eslintrc-auto-import.json", - "prettier", - "plugin:@typescript-eslint/recommended", - "plugin:prettier/recommended", - ], - parserOptions: { - ecmaVersion: "latest", - sourceType: "module", - parser: "@typescript-eslint/parser", - project: "./tsconfig.*?.json", - createDefaultProgram: false, - extraFileExtensions: [".vue"], - }, - plugins: ["vue", "@typescript-eslint"], - rules: { - // https://eslint.vuejs.org/rules/#priority-a-essential-error-prevention - "vue/multi-word-component-names": "off", - "vue/no-v-model-argument": "off", - "vue/script-setup-uses-vars": "error", - "vue/no-reserved-component-names": "off", - "vue/custom-event-name-casing": "off", - "vue/attributes-order": "off", - "vue/one-component-per-file": "off", - "vue/html-closing-bracket-newline": "off", - "vue/max-attributes-per-line": "off", - "vue/multiline-html-element-content-newline": "off", - "vue/singleline-html-element-content-newline": "off", - "vue/attribute-hyphenation": "off", - "vue/require-default-prop": "off", - "vue/require-explicit-emits": "off", - "vue/html-self-closing": [ - "error", - { - html: { - void: "always", - normal: "never", - component: "always", - }, - svg: "always", - math: "always", - }, - ], - - "@typescript-eslint/no-empty-function": "off", // 关闭空方法检查 - "@typescript-eslint/no-explicit-any": "off", // 关闭any类型的警告 - "@typescript-eslint/no-non-null-assertion": "off", - "@typescript-eslint/ban-ts-ignore": "off", - "@typescript-eslint/ban-ts-comment": "off", - "@typescript-eslint/ban-types": "off", - "@typescript-eslint/explicit-function-return-type": "off", - "@typescript-eslint/no-explicit-any": "off", - "@typescript-eslint/no-var-requires": "off", - "@typescript-eslint/no-empty-function": "off", - "@typescript-eslint/no-use-before-define": "off", - "@typescript-eslint/no-non-null-assertion": "off", - "@typescript-eslint/explicit-module-boundary-types": "off", - "@typescript-eslint/no-unused-vars": "off", - - "prettier/prettier": [ - "error", - { - useTabs: false, // 不使用制表符 - }, - ], - }, - // eslint不能对html文件生效 - overrides: [ - { - files: ["*.html"], - processor: "vue/.vue", - }, - ], - // https://eslint.org/docs/latest/use/configure/language-options#specifying-globals - globals: { - OptionType: "readonly", - }, -}; diff --git a/.gitignore b/.gitignore index fee6999c..dccd5ce8 100644 --- a/.gitignore +++ b/.gitignore @@ -13,6 +13,6 @@ dist-ssr *.sln *.local -package-lock.json -pnpm-lock.yaml stats.html +pnpm-lock.yaml +package-lock.json diff --git a/.prettierignore b/.prettierignore index f3e9850f..44421a7a 100644 --- a/.prettierignore +++ b/.prettierignore @@ -9,3 +9,4 @@ public src/assets stats.html +pnpm-lock.yaml diff --git a/.prettierrc.cjs b/.prettierrc.cjs deleted file mode 100644 index 419b91e6..00000000 --- a/.prettierrc.cjs +++ /dev/null @@ -1,46 +0,0 @@ -module.exports = { - // (x)=>{},单个参数箭头函数是否显示小括号。(always:始终显示;avoid:省略括号。默认:always) - arrowParens: "always", - // 开始标签的右尖括号是否跟随在最后一行属性末尾,默认false - bracketSameLine: false, - // 对象字面量的括号之间打印空格 (true - Example: { foo: bar } ; false - Example: {foo:bar}) - bracketSpacing: true, - // 是否格式化一些文件中被嵌入的代码片段的风格(auto|off;默认auto) - embeddedLanguageFormatting: "auto", - // 指定 HTML 文件的空格敏感度 (css|strict|ignore;默认css) - htmlWhitespaceSensitivity: "ignore", - // 当文件已经被 Prettier 格式化之后,是否会在文件顶部插入一个特殊的 @format 标记,默认false - insertPragma: false, - // 在 JSX 中使用单引号替代双引号,默认false - jsxSingleQuote: false, - // 每行最多字符数量,超出换行(默认80) - printWidth: 80, - // 超出打印宽度 (always | never | preserve ) - proseWrap: "preserve", - // 对象属性是否使用引号(as-needed | consistent | preserve;默认as-needed:对象的属性需要加引号才添加;) - quoteProps: "as-needed", - // 是否只格式化在文件顶部包含特定注释(@prettier| @format)的文件,默认false - requirePragma: false, - // 结尾添加分号 - semi: true, - // 使用单引号 (true:单引号;false:双引号) - singleQuote: false, - // 缩进空格数,默认2个空格 - tabWidth: 2, - // 元素末尾是否加逗号,默认es5: ES5中的 objects, arrays 等会添加逗号,TypeScript 中的 type 后不加逗号 - trailingComma: "es5", - // 指定缩进方式,空格或tab,默认false,即使用空格 - useTabs: false, - // vue 文件中是否缩进 diff --git a/src/components/CURD/PageSearch.vue b/src/components/CURD/PageSearch.vue index f2baf1d4..3b218dec 100644 --- a/src/components/CURD/PageSearch.vue +++ b/src/components/CURD/PageSearch.vue @@ -1,9 +1,9 @@