From 41c874092e4ec6621909f01e00f83b062cff6b74 Mon Sep 17 00:00:00 2001 From: "Ray.Hao" <1490493387@qq.com> Date: Fri, 4 Apr 2025 23:50:18 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20:bug:=20=E4=BF=AE=E5=A4=8D=20eslint=20?= =?UTF-8?q?=E8=AD=A6=E5=91=8A=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .prettierignore | 2 +- eslint.config.mjs | 41 +++- package.json | 4 +- pnpm-lock.yaml | 63 +++--- src/api/system/dict.ts | 174 +++++++++++++--- src/components/da-tree/index.vue | 11 +- src/components/da-tree/utils.ts | 69 ++++--- .../qiun-data-charts/qiun-data-charts.vue | 4 +- src/pages/login/index.vue | 21 +- src/pages/mine/feedback/index.vue | 2 +- src/pages/mine/index.vue | 2 +- src/pages/mine/profile/index.vue | 7 +- src/pages/mine/settings/index.vue | 2 +- src/pages/mine/settings/network/index.vue | 8 +- src/pages/work/config/index.vue | 4 +- src/pages/work/log/index.vue | 2 +- src/pages/work/notice/index.vue | 41 ++-- src/types/auto-imports.d.ts | 189 ++++++++---------- 18 files changed, 372 insertions(+), 274 deletions(-) diff --git a/.prettierignore b/.prettierignore index c2e668d..5bb1d8c 100644 --- a/.prettierignore +++ b/.prettierignore @@ -3,4 +3,4 @@ dist public node_modules - +auto-imports.d.ts diff --git a/eslint.config.mjs b/eslint.config.mjs index 657193f..d8b32a3 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -17,13 +17,24 @@ const autoImportConfig = JSON.parse(fs.readFileSync(".eslintrc-auto-import.json" /** @type {import('eslint').Linter.Config[]} */ export default [ - // 指定检查文件和忽略文件 + // 忽略指定文件 + { + ignores: [ + "node_modules/**", + "dist/**", + "unpackage/**", + "public/**", + "static/**", + "**/u-charts/**", + "**/qiun-**/**", + "**/auto-imports.d.ts", + "src/types/auto-imports.d.ts", + ], + }, + // 检查文件的配置 { files: ["**/*.{js,mjs,cjs,ts,vue}"], ignores: ["**/*.d.ts"], - }, - // 全局配置 - { languageOptions: { globals: { ...globals.browser, @@ -35,6 +46,8 @@ export default [ ResponseData: "readonly", // 统一响应数据类型 PageResult: "readonly", // 分页结果数据类型 PageQuery: "readonly", // 分页查询数据类型 + OptionType: "readonly", // 选项类型 + getCurrentPages: "readonly", // uni-app 全局 API }, }, }, @@ -51,6 +64,8 @@ export default [ ignoreRestSiblings: true, // 忽略解构赋值中同级未使用变量的警告 }, ], + "no-prototype-builtins": "off", // 允许直接调用Object.prototype方法 + "no-constant-binary-expression": "warn", // 将常量二元表达式警告降为警告级别 }, }, // JavaScript 配置 @@ -93,4 +108,22 @@ export default [ "vue/multi-word-component-names": "off", // 允许单个单词组件名 }, }, + + // 单独针对第三方组件的处理 + { + files: ["**/qiun-data-charts.vue", "**/qiun-data-charts/**/*.vue", "**/u-charts/**"], + linterOptions: { + noInlineConfig: false, + reportUnusedDisableDirectives: false, + }, + rules: { + // 禁用所有规则 + ...Object.fromEntries( + Object.keys(pluginVue.configs["vue3-recommended"].rules || {}).map((key) => [key, "off"]) + ), + "no-unused-vars": "off", + "no-prototype-builtins": "off", + "@typescript-eslint/no-explicit-any": "off", + }, + }, ]; diff --git a/package.json b/package.json index 8c16a06..2104be3 100644 --- a/package.json +++ b/package.json @@ -26,7 +26,7 @@ "build:app-ios": "uni build -p app-ios", "build:app-harmony": "uni build -p app-harmony", "build:custom": "uni build -p", - "build:h5": "uni build", + "build:h5": "uni build --mode production", "build:h5:ssr": "uni build --ssr", "build:mp-alipay": "uni build -p mp-alipay", "build:mp-baidu": "uni build -p mp-baidu", @@ -41,7 +41,7 @@ "build:quickapp-webview-huawei": "uni build -p quickapp-webview-huawei", "build:quickapp-webview-union": "uni build -p quickapp-webview-union", "type-check": "vue-tsc --noEmit", - "lint:eslint": "eslint --fix ./src", + "lint:eslint": "eslint \"src/**/*.{vue,ts}\" --fix", "lint:prettier": "prettier --write \"**/*.{js,cjs,ts,json,css,scss,vue,html,md}\"", "lint:stylelint": "stylelint \"**/*.{css,scss,vue,html}\" --fix", "lint:lint-staged": "lint-staged", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 06c6d5e..8e0866a 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -50,18 +50,15 @@ dependencies: '@dcloudio/uni-quickapp-webview': specifier: 3.0.0-4020420240722002 version: 3.0.0-4020420240722002(postcss@8.4.49)(vue@3.5.13) - '@qiun/uni-ucharts': - specifier: 2.5.0-20230101 - version: 2.5.0-20230101 pinia: specifier: ^2.2.2 version: 2.2.6(typescript@4.9.5)(vue@3.5.13) vue: - specifier: ^3.4.21 + specifier: ^3.5.13 version: 3.5.13(typescript@4.9.5) wot-design-uni: - specifier: ^1.3.11 - version: 1.3.14(vue@3.5.13) + specifier: ^1.4.0 + version: 1.8.0(vue@3.5.13) devDependencies: '@commitlint/cli': @@ -131,11 +128,11 @@ devDependencies: specifier: ^3.3.3 version: 3.3.3 sass: - specifier: 1.79.3 - version: 1.79.3 + specifier: 1.78.0 + version: 1.78.0 sass-loader: specifier: ^16.0.2 - version: 16.0.3(sass@1.79.3) + version: 16.0.3(sass@1.78.0) stylelint: specifier: ^16.9.0 version: 16.10.0(typescript@4.9.5) @@ -174,7 +171,7 @@ devDependencies: version: 0.18.5 vite: specifier: 5.2.8 - version: 5.2.8(@types/node@22.9.1)(sass@1.79.3)(terser@5.36.0) + version: 5.2.8(@types/node@22.9.1)(sass@1.78.0)(terser@5.36.0) vue-eslint-parser: specifier: ^9.4.3 version: 9.4.3(eslint@9.15.0) @@ -2269,7 +2266,7 @@ packages: picocolors: 1.1.1 terser: 5.36.0 unplugin-auto-import: 0.16.7 - vite: 5.2.8(@types/node@22.9.1)(sass@1.79.3)(terser@5.36.0) + vite: 5.2.8(@types/node@22.9.1)(sass@1.78.0)(terser@5.36.0) transitivePeerDependencies: - '@nuxt/kit' - '@vueuse/core' @@ -3528,10 +3525,6 @@ packages: resolution: {integrity: sha512-8LduaNlMZGwdZ6qWrKlfa+2M4gahzFkprZiAt2TF8uS0qQgBizKXpXURqvTJ4WtmupWxaLqjRb2UCTe72mu+Aw==} dev: true - /@qiun/uni-ucharts@2.5.0-20230101: - resolution: {integrity: sha512-qpgzAUgrShgKNn0uMoN54n6/MkFeQQpK2gur0Fzokn8oTIMCVjTfnt8C2UhD20pPlm6MFxwkWF+bsJ3qd4QMvg==} - dev: false - /@rollup/pluginutils@5.1.3: resolution: {integrity: sha512-Pnsb6f32CD2W3uCaLZIzDmeFyQ2b8UWMFI7xtwUezpcGBDVDW6y9XgAWIlARiGAo6eNF5FK5aQTr0LFyNyqq5A==} engines: {node: '>=14.0.0'} @@ -3926,7 +3919,7 @@ packages: '@unocss/core': 0.62.4 '@unocss/reset': 0.62.4 '@unocss/vite': 0.62.4(vite@5.2.8) - vite: 5.2.8(@types/node@22.9.1)(sass@1.79.3)(terser@5.36.0) + vite: 5.2.8(@types/node@22.9.1)(sass@1.78.0)(terser@5.36.0) transitivePeerDependencies: - rollup - supports-color @@ -4112,7 +4105,7 @@ packages: chokidar: 3.6.0 magic-string: 0.30.13 tinyglobby: 0.2.10 - vite: 5.2.8(@types/node@22.9.1)(sass@1.79.3)(terser@5.36.0) + vite: 5.2.8(@types/node@22.9.1)(sass@1.78.0)(terser@5.36.0) transitivePeerDependencies: - rollup - supports-color @@ -4134,7 +4127,7 @@ packages: regenerator-runtime: 0.14.1 systemjs: 6.15.1 terser: 5.36.0 - vite: 5.2.8(@types/node@22.9.1)(sass@1.79.3)(terser@5.36.0) + vite: 5.2.8(@types/node@22.9.1)(sass@1.78.0)(terser@5.36.0) transitivePeerDependencies: - supports-color dev: true @@ -4149,7 +4142,7 @@ packages: '@babel/core': 7.26.0 '@babel/plugin-transform-typescript': 7.25.9(@babel/core@7.26.0) '@vue/babel-plugin-jsx': 1.2.5(@babel/core@7.26.0) - vite: 5.2.8(@types/node@22.9.1)(sass@1.79.3)(terser@5.36.0) + vite: 5.2.8(@types/node@22.9.1)(sass@1.78.0)(terser@5.36.0) vue: 3.5.13(typescript@4.9.5) transitivePeerDependencies: - supports-color @@ -4162,7 +4155,7 @@ packages: vite: ^5.0.0 vue: ^3.2.25 dependencies: - vite: 5.2.8(@types/node@22.9.1)(sass@1.79.3)(terser@5.36.0) + vite: 5.2.8(@types/node@22.9.1)(sass@1.78.0)(terser@5.36.0) vue: 3.5.13(typescript@4.9.5) /@volar/language-core@1.11.1: @@ -4906,12 +4899,6 @@ packages: optionalDependencies: fsevents: 2.3.3 - /chokidar@4.0.1: - resolution: {integrity: sha512-n8enUVCED/KVRQlab1hr3MVpcVMvxtZjmEa956u+4YijlmQED223XMSYj2tLuKvr4jcCTzNNMpQDUer72MMmzA==} - engines: {node: '>= 14.16.0'} - dependencies: - readdirp: 4.0.2 - /ci-info@3.9.0: resolution: {integrity: sha512-NIxF55hv4nSqQswkAeiOi1r83xy8JldOFDTWiug55KBu9Jnblncd2U6ViHmYgHf01TPZS77NJBhBMKdWj9HQMQ==} engines: {node: '>=8'} @@ -8446,10 +8433,6 @@ packages: dependencies: picomatch: 2.3.1 - /readdirp@4.0.2: - resolution: {integrity: sha512-yDMz9g+VaZkqBYS/ozoBJwaBhTbZo3UNYQHNRw1D3UFQB8oHB4uS/tAODO+ZLjGWmUbKnIlOWO+aaIiAxrUWHA==} - engines: {node: '>= 14.16.0'} - /regenerate-unicode-properties@10.2.0: resolution: {integrity: sha512-DqHn3DwbmmPVzeKj9woBadqmXxLvQoQIwu7nopMc72ztvxVmVk2SBhSnx67zuye5TP+lJsb/TBQsjLKhnDf3MA==} engines: {node: '>=4'} @@ -8640,7 +8623,7 @@ packages: resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==} dev: true - /sass-loader@16.0.3(sass@1.79.3): + /sass-loader@16.0.3(sass@1.78.0): resolution: {integrity: sha512-gosNorT1RCkuCMyihv6FBRR7BMV06oKRAs+l4UMp1mlcVg9rWN6KMmUj3igjQwmYys4mDP3etEYJgiHRbgHCHA==} engines: {node: '>= 18.12.0'} peerDependencies: @@ -8662,15 +8645,15 @@ packages: optional: true dependencies: neo-async: 2.6.2 - sass: 1.79.3 + sass: 1.78.0 dev: true - /sass@1.79.3: - resolution: {integrity: sha512-m7dZxh0W9EZ3cw50Me5GOuYm/tVAJAn91SUnohLRo9cXBixGUOdvmryN+dXpwR831bhoY3Zv7rEFt85PUwTmzA==} + /sass@1.78.0: + resolution: {integrity: sha512-AaIqGSrjo5lA2Yg7RvFZrlXDBCp3nV4XP73GrLGvdRWWwk+8H3l0SDvq/5bA4eF+0RFPLuWUk3E+P1U/YqnpsQ==} engines: {node: '>=14.0.0'} hasBin: true dependencies: - chokidar: 4.0.1 + chokidar: 3.6.0 immutable: 4.3.7 source-map-js: 1.2.1 @@ -9465,7 +9448,7 @@ packages: '@unocss/transformer-directives': 0.62.4 '@unocss/transformer-variant-group': 0.62.4 '@unocss/vite': 0.62.4(vite@5.2.8) - vite: 5.2.8(@types/node@22.9.1)(sass@1.79.3)(terser@5.36.0) + vite: 5.2.8(@types/node@22.9.1)(sass@1.78.0)(terser@5.36.0) transitivePeerDependencies: - postcss - rollup @@ -9615,7 +9598,7 @@ packages: engines: {node: '>= 0.8'} dev: true - /vite@5.2.8(@types/node@22.9.1)(sass@1.79.3)(terser@5.36.0): + /vite@5.2.8(@types/node@22.9.1)(sass@1.78.0)(terser@5.36.0): resolution: {integrity: sha512-OyZR+c1CE8yeHw5V5t59aXsUPPVTHMDjEZz8MgguLL/Q7NblxhZUlTu9xSPqlsUO/y+X7dlU05jdhvyycD55DA==} engines: {node: ^18.0.0 || >=20.0.0} hasBin: true @@ -9647,7 +9630,7 @@ packages: esbuild: 0.20.2 postcss: 8.4.49 rollup: 4.27.3 - sass: 1.79.3 + sass: 1.78.0 terser: 5.36.0 optionalDependencies: fsevents: 2.3.3 @@ -9811,8 +9794,8 @@ packages: engines: {node: '>=0.10.0'} dev: true - /wot-design-uni@1.3.14(vue@3.5.13): - resolution: {integrity: sha512-njqhMpVVHPWjiQdnuUkAFvCrJKv28RraSU6BiAW1soHw7BA6L3b7UJ0mdUMxsjT+A2hCk2YN8RsLKC03wDV9zw==} + /wot-design-uni@1.8.0(vue@3.5.13): + resolution: {integrity: sha512-JSfOVGtvBnXVnaf8/2Fsh/aMkZPoFFt6t8wBRhpDaEPoOndTHBR68Ro+ctP3JKgyVATHaYc4v63TJca55SV1Iw==} engines: {HBuilderX: ^3.8.7} peerDependencies: vue: '>=3.2.47' diff --git a/src/api/system/dict.ts b/src/api/system/dict.ts index 157b0a9..b343726 100644 --- a/src/api/system/dict.ts +++ b/src/api/system/dict.ts @@ -1,16 +1,20 @@ import request from "@/utils/request"; -const DICT_BASE_URL = "/api/v1/dict"; +const DICT_BASE_URL = "/api/v1/dicts"; const DictAPI = { + //--------------------------------------------------- + // 字典相关接口 + //--------------------------------------------------- + /** - * 获取字典分页列表 + * 字典分页列表 * * @param queryParams 查询参数 * @returns 字典分页结果 */ getPage(queryParams: DictPageQuery) { - return request({ + return request>({ url: `${DICT_BASE_URL}/page`, method: "GET", data: queryParams, @@ -18,7 +22,7 @@ const DictAPI = { }, /** - * 获取字典表单数据 + * 字典表单数据 * * @param id 字典ID * @returns 字典表单数据 @@ -35,7 +39,7 @@ const DictAPI = { * * @param data 字典表单数据 */ - add(data: DictForm) { + create(data: DictForm) { return request({ url: `${DICT_BASE_URL}`, method: "POST", @@ -65,21 +69,81 @@ const DictAPI = { deleteByIds(ids: string) { return request({ url: `${DICT_BASE_URL}/${ids}`, - method: "delete", + method: "DELETE", + }); + }, + + //--------------------------------------------------- + // 字典项相关接口 + //--------------------------------------------------- + /** + * 获取字典分页列表 + * + * @param queryParams 查询参数 + * @returns 字典分页结果 + */ + getDictItemPage(dictCode: string, queryParams: DictItemPageQuery) { + return request>({ + url: `${DICT_BASE_URL}/${dictCode}/items/page`, + method: "GET", + data: queryParams, }); }, /** - * 获取字典列表 - * - * @returns 字典列表 + * 获取字典项列表 */ - getList() { - return request({ - url: `${DICT_BASE_URL}/list`, + getDictItems(dictCode: string) { + return request({ + url: `${DICT_BASE_URL}/${dictCode}/items`, method: "GET", }); }, + + /** + * 新增字典项 + */ + createDictItem(dictCode: string, data: DictItemForm) { + return request({ + url: `${DICT_BASE_URL}/${dictCode}/items`, + method: "POST", + data: data, + }); + }, + + /** + * 获取字典项表单数据 + * + * @param id 字典项ID + * @returns 字典项表单数据 + */ + getDictItemFormData(dictCode: string, id: number) { + return request({ + url: `${DICT_BASE_URL}/${dictCode}/items/${id}/form`, + method: "GET", + }); + }, + + /** + * 修改字典项 + */ + updateDictItem(dictCode: string, id: number, data: DictItemForm) { + return request({ + url: `${DICT_BASE_URL}/${dictCode}/items/${id}`, + method: "PUT", + data: data, + }); + }, + + /** + * 删除字典项 + */ + deleteDictItems(dictCode: string, ids: string) { + return request({ + url: `${DICT_BASE_URL}/${dictCode}/items/${ids}`, + method: "DELETE", + }); + }, }; export default DictAPI; @@ -148,27 +212,85 @@ export interface DictForm { } /** - * 字典数据项分页VO - * - * @description 字典数据分页对象 + * 字典查询参数 */ -export interface DictVO { - /** 字典名称 */ - name: string; +export interface DictItemPageQuery extends PageQuery { + /** 关键字(字典数据值/标签) */ + keywords?: string; /** 字典编码 */ - dictCode: string; - - /** 字典数据集合 */ - dictDataList: DictData[]; + dictCode?: string; } /** - * 字典数据 - * - * @description 字典数据 + * 字典分页对象 */ -export interface DictData { +export interface DictItemPageVO { + /** + * 字典ID + */ + id: number; + /** + * 字典编码 + */ + dictCode: string; + /** + * 字典数据值 + */ + value: string; + /** + * 字典数据标签 + */ + label: string; + /** + * 状态(1:启用,0:禁用) + */ + status: number; + /** + * 字典排序 + */ + sort?: number; +} + +/** + * 字典 + */ +export interface DictItemForm { + /** + * 字典ID + */ + id?: number; + /** + * 字典编码 + */ + dictCode?: string; + /** + * 字典数据值 + */ + value?: string; + /** + * 字典数据标签 + */ + label?: string; + /** + * 状态(1:启用,0:禁用) + */ + status?: number; + /** + * 字典排序 + */ + sort?: number; + + /** + * 标签类型 + */ + tagType?: "success" | "warning" | "info" | "primary" | "danger" | undefined; +} + +/** + * 字典项下拉选项 + */ +export interface DictItemOption { /** 字典数据值 */ value: string; diff --git a/src/components/da-tree/index.vue b/src/components/da-tree/index.vue index 03b0329..cc4b9c6 100644 --- a/src/components/da-tree/index.vue +++ b/src/components/da-tree/index.vue @@ -683,10 +683,13 @@ export default defineComponent({ let newChildren = [...(item.originItem?.children || []), ...(apiRes || [])]; const newChildrenObj = {}; newChildren = newChildren.reduce((total, next) => { - newChildrenObj[next[fieldMap.value]] - ? "" - : (newChildrenObj[next[fieldMap.value]] = true && total.push(next)); - return total; + if (newChildrenObj[next[fieldMap.value]]) { + return total; + } else { + newChildrenObj[next[fieldMap.value]] = true; + total.push(next); + return total; + } }, []); item.originItem.children = newChildren || null; diff --git a/src/components/da-tree/utils.ts b/src/components/da-tree/utils.ts index d79ea1e..5a6ca0b 100644 --- a/src/components/da-tree/utils.ts +++ b/src/components/da-tree/utils.ts @@ -10,18 +10,18 @@ export const isCheckedStatus = 2; * @param originData 拷贝对象 * @author crlang(https://crlang.com) */ -export function deepClone(originData) { +export function deepClone(originData: any): any { const type = Object.prototype.toString.call(originData); - let data; + let data: any; if (type === "[object Array]") { data = []; for (let i = 0; i < originData.length; i++) { data.push(deepClone(originData[i])); } } else if (type === "[object Object]") { - data = {}; + data = {} as Record; for (const prop in originData) { - if (originData.hasOwnProperty(prop)) { + if (Object.prototype.hasOwnProperty.call(originData, prop)) { // 非继承属性 data[prop] = deepClone(originData[prop]); } @@ -34,11 +34,13 @@ export function deepClone(originData) { /** * 获取所有指定的节点 - * @param type - * @param value + * @param list 列表 + * @param type 类型 + * @param value 值 + * @param packDisabledkey 是否包含禁用节点 * @author crlang(https://crlang.com) */ -export function getAllNodes(list, type, value, packDisabledkey = true) { +export function getAllNodes(list: any[], type: string, value: any, packDisabledkey = true): any[] { if (!list || list.length === 0) { return []; } @@ -58,16 +60,23 @@ export function getAllNodes(list, type, value, packDisabledkey = true) { /** * 获取所有指定的key值 - * @param type - * @param value + * @param list 列表 + * @param type 类型 + * @param value 值 + * @param packDisabledkey 是否包含禁用节点 * @author crlang(https://crlang.com) */ -export function getAllNodeKeys(list, type, value, packDisabledkey = true) { +export function getAllNodeKeys( + list: any[], + type: string, + value: any, + packDisabledkey = true +): string[] | null { if (!list || list.length === 0) { return null; } - const res = []; + const res: string[] = []; for (let i = 0; i < list.length; i++) { const item = list[i]; if (item[type] === value) { @@ -82,69 +91,63 @@ export function getAllNodeKeys(list, type, value, packDisabledkey = true) { /** * 错误输出 - * - * @param msg + * @param msg 错误消息 + * @param args 附加参数 */ -export function logError(msg, ...args) { +export function logError(msg: string, ...args: any[]): void { console.error(`DaTree: ${msg}`, ...args); } const toString = Object.prototype.toString; -export function is(val, type) { +export function is(val: any, type: string): boolean { return toString.call(val) === `[object ${type}]`; } /** * 是否对象(Object) - * @param val - + * @param val 值 */ -export function isObject(val) { +export function isObject(val: any): boolean { return val !== null && is(val, "Object"); } /** * 是否数字(Number) - * @param val - + * @param val 值 */ -export function isNumber(val) { +export function isNumber(val: any): boolean { return is(val, "Number"); } /** * 是否字符串(String) - * @param val - + * @param val 值 */ -export function isString(val) { +export function isString(val: any): boolean { return is(val, "String"); } /** * 是否函数方法(Function) - * @param val - + * @param val 值 */ -export function isFunction(val) { +export function isFunction(val: any): boolean { return typeof val === "function"; } /** * 是否布尔(Boolean) - * @param val - + * @param val 值 */ -export function isBoolean(val) { +export function isBoolean(val: any): boolean { return is(val, "Boolean"); } /** * 是否数组(Array) - * @param val - + * @param val 值 */ -export function isArray(val) { +export function isArray(val: any): boolean { return val && Array.isArray(val); } diff --git a/src/components/qiun-data-charts/qiun-data-charts.vue b/src/components/qiun-data-charts/qiun-data-charts.vue index 9abcf2d..c1fbfb7 100644 --- a/src/components/qiun-data-charts/qiun-data-charts.vue +++ b/src/components/qiun-data-charts/qiun-data-charts.vue @@ -68,8 +68,8 @@ import { type LoginFormData } from "@/api/auth"; import { useUserStore } from "@/store/modules/user"; -import { useDictStore } from "@/store/modules/dict"; const loginFormRef = ref(); const loginFormData = ref({ @@ -66,7 +65,6 @@ const loginFormData = ref({ }); const userStore = useUserStore(); -const dictStore = useDictStore(); // 登录处理 const handleLogin = () => { @@ -75,23 +73,14 @@ const handleLogin = () => { try { await userStore.login(loginFormData.value); await userStore.getInfo(); - await dictStore.loadDictionaries(); uni.showToast({ title: "登录成功", icon: "success" }); // 检查是否有上一页 - const pages = getCurrentPages(); - console.log("pages", pages.length); - if (pages.length > 1) { - setTimeout(() => { - uni.navigateBack(); - }, 1500); - } else { - setTimeout(() => { - uni.reLaunch({ - url: "/pages/index/index", - }); - }, 1500); - } + setTimeout(() => { + uni.reLaunch({ + url: "/pages/index/index", + }); + }, 1500); } catch (error: any) { console.log("登录失败", error.message); } diff --git a/src/pages/mine/feedback/index.vue b/src/pages/mine/feedback/index.vue index 78c7487..89502a1 100644 --- a/src/pages/mine/feedback/index.vue +++ b/src/pages/mine/feedback/index.vue @@ -125,7 +125,7 @@ const handleSubmit = async () => { setTimeout(() => { uni.navigateBack(); }, 1500); - } catch (error) { + } catch { toast.error("提交失败,请重试"); } finally { submitting.value = false; diff --git a/src/pages/mine/index.vue b/src/pages/mine/index.vue index 960d6f9..e3a63e0 100644 --- a/src/pages/mine/index.vue +++ b/src/pages/mine/index.vue @@ -95,7 +95,7 @@ const handleQuestionFeedback = () => { uni.navigateTo({ url: "/pages/mine/feedback/index" }); }; // 建设中 -const handleItemclick = (item: any) => { +const handleItemclick = () => { toast.show("建设中..."); }; diff --git a/src/pages/mine/profile/index.vue b/src/pages/mine/profile/index.vue index 3be60e9..47ee78c 100644 --- a/src/pages/mine/profile/index.vue +++ b/src/pages/mine/profile/index.vue @@ -63,12 +63,7 @@