diff --git a/.eslintrc.js b/.eslintrc.js new file mode 100644 index 0000000..3c29b9a --- /dev/null +++ b/.eslintrc.js @@ -0,0 +1,198 @@ +module.exports = { + root: true, + parserOptions: { + parser: 'babel-eslint', + sourceType: 'module' + }, + env: { + browser: true, + node: true, + es6: true, + }, + extends: ['plugin:vue/recommended', 'eslint:recommended'], + + // add your custom rules here + //it is base on https://github.com/vuejs/eslint-config-vue + rules: { + "vue/max-attributes-per-line": [2, { + "singleline": 10, + // "multiline": { + // "max": 1, + // "allowFirstLine": false + // } + }], + "vue/singleline-html-element-content-newline": "off", + "vue/multiline-html-element-content-newline":"off", + "vue/name-property-casing": ["error", "PascalCase"], + "vue/no-v-html": "off", + 'accessor-pairs': 2, + 'arrow-spacing': [2, { + 'before': true, + 'after': true + }], + 'block-spacing': [2, 'always'], + 'brace-style': [2, '1tbs', { + 'allowSingleLine': true + }], + 'camelcase': [0, { + 'properties': 'always' + }], + 'comma-dangle': [2, 'never'], + 'comma-spacing': [2, { + 'before': false, + 'after': true + }], + 'comma-style': [2, 'last'], + 'constructor-super': 2, + 'curly': [2, 'multi-line'], + 'dot-location': [2, 'property'], + 'eol-last': 2, + 'eqeqeq': ["error", "always", {"null": "ignore"}], + 'generator-star-spacing': [2, { + 'before': true, + 'after': true + }], + 'handle-callback-err': [2, '^(err|error)$'], + 'indent': [2, 2, { + 'SwitchCase': 1 + }], + 'jsx-quotes': [2, 'prefer-single'], + 'key-spacing': [2, { + 'beforeColon': false, + 'afterColon': true + }], + 'keyword-spacing': [2, { + 'before': true, + 'after': true + }], + 'new-cap': [2, { + 'newIsCap': true, + 'capIsNew': false + }], + 'new-parens': 2, + 'no-array-constructor': 2, + 'no-caller': 2, + 'no-console': 'off', + 'no-class-assign': 2, + 'no-cond-assign': 2, + 'no-const-assign': 2, + 'no-control-regex': 0, + 'no-delete-var': 2, + 'no-dupe-args': 2, + 'no-dupe-class-members': 2, + 'no-dupe-keys': 2, + 'no-duplicate-case': 2, + 'no-empty-character-class': 2, + 'no-empty-pattern': 2, + 'no-eval': 2, + 'no-ex-assign': 2, + 'no-extend-native': 2, + 'no-extra-bind': 2, + 'no-extra-boolean-cast': 2, + 'no-extra-parens': [2, 'functions'], + 'no-fallthrough': 2, + 'no-floating-decimal': 2, + 'no-func-assign': 2, + 'no-implied-eval': 2, + 'no-inner-declarations': [2, 'functions'], + 'no-invalid-regexp': 2, + 'no-irregular-whitespace': 2, + 'no-iterator': 2, + 'no-label-var': 2, + 'no-labels': [2, { + 'allowLoop': false, + 'allowSwitch': false + }], + 'no-lone-blocks': 2, + 'no-mixed-spaces-and-tabs': 2, + 'no-multi-spaces': 2, + 'no-multi-str': 2, + 'no-multiple-empty-lines': [2, { + 'max': 1 + }], + 'no-native-reassign': 2, + 'no-negated-in-lhs': 2, + 'no-new-object': 2, + 'no-new-require': 2, + 'no-new-symbol': 2, + 'no-new-wrappers': 2, + 'no-obj-calls': 2, + 'no-octal': 2, + 'no-octal-escape': 2, + 'no-path-concat': 2, + 'no-proto': 2, + 'no-redeclare': 2, + 'no-regex-spaces': 2, + 'no-return-assign': [2, 'except-parens'], + 'no-self-assign': 2, + 'no-self-compare': 2, + 'no-sequences': 2, + 'no-shadow-restricted-names': 2, + 'no-spaced-func': 2, + 'no-sparse-arrays': 2, + 'no-this-before-super': 2, + 'no-throw-literal': 2, + 'no-trailing-spaces': 2, + 'no-undef': 2, + 'no-undef-init': 2, + 'no-unexpected-multiline': 2, + 'no-unmodified-loop-condition': 2, + 'no-unneeded-ternary': [2, { + 'defaultAssignment': false + }], + 'no-unreachable': 2, + 'no-unsafe-finally': 2, + 'no-unused-vars': [2, { + 'vars': 'all', + 'args': 'none' + }], + 'no-useless-call': 2, + 'no-useless-computed-key': 2, + 'no-useless-constructor': 2, + 'no-useless-escape': 0, + 'no-whitespace-before-property': 2, + 'no-with': 2, + 'one-var': [2, { + 'initialized': 'never' + }], + 'operator-linebreak': [2, 'after', { + 'overrides': { + '?': 'before', + ':': 'before' + } + }], + 'padded-blocks': [2, 'never'], + 'quotes': [2, 'single', { + 'avoidEscape': true, + 'allowTemplateLiterals': true + }], + 'semi': [2, 'never'], + 'semi-spacing': [2, { + 'before': false, + 'after': true + }], + 'space-before-blocks': [2, 'always'], + 'space-before-function-paren': [2, 'never'], + 'space-in-parens': [2, 'never'], + 'space-infix-ops': 2, + 'space-unary-ops': [2, { + 'words': true, + 'nonwords': false + }], + 'spaced-comment': [2, 'always', { + 'markers': ['global', 'globals', 'eslint', 'eslint-disable', '*package', '!', ','] + }], + 'template-curly-spacing': [2, 'never'], + 'use-isnan': 2, + 'valid-typeof': 2, + 'wrap-iife': [2, 'any'], + 'yield-star-spacing': [2, 'both'], + 'yoda': [2, 'never'], + 'prefer-const': 2, + 'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0, + 'object-curly-spacing': [2, 'always', { + objectsInObjects: false + }], + 'array-bracket-spacing': [2, 'never'] + } +} diff --git a/.gitignore b/.gitignore index 545c73c..5755d43 100644 --- a/.gitignore +++ b/.gitignore @@ -401,4 +401,6 @@ FodyWeavers.xsd .idea/ -Web/dist \ No newline at end of file +Web/dist +# ESLint +.eslintcache diff --git a/.vscode/settings.json b/.vscode/settings.json index 5bbb269..037b7ae 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,3 +1,14 @@ { - "vue3snippets.enable-compile-vue-file-on-did-save-code": false + "vue3snippets.enable-compile-vue-file-on-did-save-code": false, + "eslint.workingDirectories": [ + "./Web" + ], + "editor.codeActionsOnSave": { + "source.fixAll.eslint": "explicit" + }, + "eslint.validate": [ + "javascript", + "javascriptreact", + "vue" + ] } \ No newline at end of file diff --git a/Web/.eslintcache b/Web/.eslintcache index dac762e..e108bf4 100644 --- a/Web/.eslintcache +++ b/Web/.eslintcache @@ -1 +1 @@ -[{"D:\\codes\\others\\EmailBill\\Web\\src\\views\\ClassificationSmart.vue":"1","D:\\codes\\others\\EmailBill\\Web\\eslint.config.js":"2","D:\\codes\\others\\EmailBill\\Web\\public\\service-worker.js":"3","D:\\codes\\others\\EmailBill\\Web\\src\\api\\billImport.js":"4","D:\\codes\\others\\EmailBill\\Web\\src\\api\\emailRecord.js":"5","D:\\codes\\others\\EmailBill\\Web\\src\\api\\log.js":"6","D:\\codes\\others\\EmailBill\\Web\\src\\api\\message.js":"7","D:\\codes\\others\\EmailBill\\Web\\src\\api\\request.js":"8","D:\\codes\\others\\EmailBill\\Web\\src\\api\\statistics.js":"9","D:\\codes\\others\\EmailBill\\Web\\src\\api\\transactionCategory.js":"10","D:\\codes\\others\\EmailBill\\Web\\src\\api\\transactionPeriodic.js":"11","D:\\codes\\others\\EmailBill\\Web\\src\\api\\transactionRecord.js":"12","D:\\codes\\others\\EmailBill\\Web\\src\\App.vue":"13","D:\\codes\\others\\EmailBill\\Web\\src\\components\\ClassifyPicker.vue":"14","D:\\codes\\others\\EmailBill\\Web\\src\\components\\TransactionDetail.vue":"15","D:\\codes\\others\\EmailBill\\Web\\src\\components\\TransactionList.vue":"16","D:\\codes\\others\\EmailBill\\Web\\src\\main.js":"17","D:\\codes\\others\\EmailBill\\Web\\src\\registerServiceWorker.js":"18","D:\\codes\\others\\EmailBill\\Web\\src\\router\\index.js":"19","D:\\codes\\others\\EmailBill\\Web\\src\\stores\\auth.js":"20","D:\\codes\\others\\EmailBill\\Web\\src\\stores\\counter.js":"21","D:\\codes\\others\\EmailBill\\Web\\src\\stores\\message.js":"22","D:\\codes\\others\\EmailBill\\Web\\src\\views\\BalanceView.vue":"23","D:\\codes\\others\\EmailBill\\Web\\src\\views\\BillAnalysisView.vue":"24","D:\\codes\\others\\EmailBill\\Web\\src\\views\\CalendarView.vue":"25","D:\\codes\\others\\EmailBill\\Web\\src\\views\\ClassificationBatch.vue":"26","D:\\codes\\others\\EmailBill\\Web\\src\\views\\ClassificationEdit.vue":"27","D:\\codes\\others\\EmailBill\\Web\\src\\views\\ClassificationNLP.vue":"28","D:\\codes\\others\\EmailBill\\Web\\src\\views\\EmailRecord.vue":"29","D:\\codes\\others\\EmailBill\\Web\\src\\views\\LoginView.vue":"30","D:\\codes\\others\\EmailBill\\Web\\src\\views\\LogView.vue":"31","D:\\codes\\others\\EmailBill\\Web\\src\\views\\MessageView.vue":"32","D:\\codes\\others\\EmailBill\\Web\\src\\views\\PeriodicRecord.vue":"33","D:\\codes\\others\\EmailBill\\Web\\src\\views\\SettingView.vue":"34","D:\\codes\\others\\EmailBill\\Web\\src\\views\\StatisticsView.vue":"35","D:\\codes\\others\\EmailBill\\Web\\src\\views\\TransactionsRecord.vue":"36","D:\\codes\\others\\EmailBill\\Web\\vite.config.js":"37"},{"size":12129,"mtime":1766998646236,"results":"38","hashOfConfig":"39"},{"size":596,"mtime":1766397301264,"results":"40","hashOfConfig":"41"},{"size":3763,"mtime":1766643343649,"results":"42","hashOfConfig":"41"},{"size":1786,"mtime":1766493393933,"results":"43","hashOfConfig":"41"},{"size":1828,"mtime":1766628922810,"results":"44","hashOfConfig":"41"},{"size":868,"mtime":1766997952394,"results":"45","hashOfConfig":"41"},{"size":1670,"mtime":1766988985063,"results":"46","hashOfConfig":"41"},{"size":2280,"mtime":1766737267237,"results":"47","hashOfConfig":"41"},{"size":2968,"mtime":1766740438323,"results":"48","hashOfConfig":"41"},{"size":1916,"mtime":1766716056978,"results":"49","hashOfConfig":"41"},{"size":2855,"mtime":1766991229153,"results":"50","hashOfConfig":"41"},{"size":5791,"mtime":1766725491308,"results":"51","hashOfConfig":"41"},{"size":4370,"mtime":1766988985057,"results":"52","hashOfConfig":"39"},{"size":4162,"mtime":1766991229152,"results":"53","hashOfConfig":"39"},{"size":8877,"mtime":1766995651564,"results":"54","hashOfConfig":"39"},{"size":8006,"mtime":1766732771392,"results":"55","hashOfConfig":"39"},{"size":562,"mtime":1766971736444,"results":"56","hashOfConfig":"41"},{"size":2903,"mtime":1766998608620,"results":"57","hashOfConfig":"41"},{"size":3069,"mtime":1766997952394,"results":"58","hashOfConfig":"41"},{"size":1345,"mtime":1766640160651,"results":"59","hashOfConfig":"41"},{"size":306,"mtime":1766397238501,"results":"60","hashOfConfig":"41"},{"size":529,"mtime":1766988985056,"results":"61","hashOfConfig":"41"},{"size":1498,"mtime":1766971736456,"results":"62","hashOfConfig":"39"},{"size":7872,"mtime":1766971736459,"results":"63","hashOfConfig":"39"},{"size":7374,"mtime":1766995651564,"results":"64","hashOfConfig":"39"},{"size":12825,"mtime":1766971736468,"results":"65","hashOfConfig":"39"},{"size":6993,"mtime":1766993465076,"results":"66","hashOfConfig":"39"},{"size":8753,"mtime":1766995651587,"results":"67","hashOfConfig":"39"},{"size":12489,"mtime":1766995651561,"results":"68","hashOfConfig":"39"},{"size":2145,"mtime":1766978070072,"results":"69","hashOfConfig":"39"},{"size":9634,"mtime":1766997952394,"results":"70","hashOfConfig":"39"},{"size":6774,"mtime":1766995651567,"results":"71","hashOfConfig":"39"},{"size":22374,"mtime":1766995651561,"results":"72","hashOfConfig":"39"},{"size":5264,"mtime":1766997952404,"results":"73","hashOfConfig":"39"},{"size":28355,"mtime":1766995651561,"results":"74","hashOfConfig":"39"},{"size":15032,"mtime":1766995651561,"results":"75","hashOfConfig":"39"},{"size":702,"mtime":1766737248019,"results":"76","hashOfConfig":"41"},{"filePath":"77","messages":"78","suppressedMessages":"79","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"1xefihw",{"filePath":"80","messages":"81","suppressedMessages":"82","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"19tzkw5",{"filePath":"83","messages":"84","suppressedMessages":"85","errorCount":1,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"86","messages":"87","suppressedMessages":"88","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"89","messages":"90","suppressedMessages":"91","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"92","messages":"93","suppressedMessages":"94","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"95","messages":"96","suppressedMessages":"97","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"98","messages":"99","suppressedMessages":"100","errorCount":1,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"101","messages":"102","suppressedMessages":"103","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"104","messages":"105","suppressedMessages":"106","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"107","messages":"108","suppressedMessages":"109","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"110","messages":"111","suppressedMessages":"112","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"113","messages":"114","suppressedMessages":"115","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"116","messages":"117","suppressedMessages":"118","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"119","messages":"120","suppressedMessages":"121","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"122","messages":"123","suppressedMessages":"124","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"125","messages":"126","suppressedMessages":"127","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"128","messages":"129","suppressedMessages":"130","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"131","messages":"132","suppressedMessages":"133","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"134","messages":"135","suppressedMessages":"136","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"137","messages":"138","suppressedMessages":"139","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"140","messages":"141","suppressedMessages":"142","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"143","messages":"144","suppressedMessages":"145","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"146","messages":"147","suppressedMessages":"148","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"149","messages":"150","suppressedMessages":"151","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"152","messages":"153","suppressedMessages":"154","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"155","messages":"156","suppressedMessages":"157","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"158","messages":"159","suppressedMessages":"160","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"161","messages":"162","suppressedMessages":"163","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"164","messages":"165","suppressedMessages":"166","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"167","messages":"168","suppressedMessages":"169","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"170","messages":"171","suppressedMessages":"172","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"173","messages":"174","suppressedMessages":"175","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"176","messages":"177","suppressedMessages":"178","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"179","messages":"180","suppressedMessages":"181","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"182","messages":"183","suppressedMessages":"184","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"185","messages":"186","suppressedMessages":"187","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"D:\\codes\\others\\EmailBill\\Web\\src\\views\\ClassificationSmart.vue",[],[],"D:\\codes\\others\\EmailBill\\Web\\eslint.config.js",[],[],"D:\\codes\\others\\EmailBill\\Web\\public\\service-worker.js",["188"],[],"D:\\codes\\others\\EmailBill\\Web\\src\\api\\billImport.js",[],[],"D:\\codes\\others\\EmailBill\\Web\\src\\api\\emailRecord.js",[],[],"D:\\codes\\others\\EmailBill\\Web\\src\\api\\log.js",[],[],"D:\\codes\\others\\EmailBill\\Web\\src\\api\\message.js",[],[],"D:\\codes\\others\\EmailBill\\Web\\src\\api\\request.js",["189"],[],"D:\\codes\\others\\EmailBill\\Web\\src\\api\\statistics.js",[],[],"D:\\codes\\others\\EmailBill\\Web\\src\\api\\transactionCategory.js",[],[],"D:\\codes\\others\\EmailBill\\Web\\src\\api\\transactionPeriodic.js",[],[],"D:\\codes\\others\\EmailBill\\Web\\src\\api\\transactionRecord.js",[],[],"D:\\codes\\others\\EmailBill\\Web\\src\\App.vue",[],[],"D:\\codes\\others\\EmailBill\\Web\\src\\components\\ClassifyPicker.vue",[],[],"D:\\codes\\others\\EmailBill\\Web\\src\\components\\TransactionDetail.vue",[],[],"D:\\codes\\others\\EmailBill\\Web\\src\\components\\TransactionList.vue",[],[],"D:\\codes\\others\\EmailBill\\Web\\src\\main.js",[],[],"D:\\codes\\others\\EmailBill\\Web\\src\\registerServiceWorker.js",[],[],"D:\\codes\\others\\EmailBill\\Web\\src\\router\\index.js",[],[],"D:\\codes\\others\\EmailBill\\Web\\src\\stores\\auth.js",[],[],"D:\\codes\\others\\EmailBill\\Web\\src\\stores\\counter.js",[],[],"D:\\codes\\others\\EmailBill\\Web\\src\\stores\\message.js",[],[],"D:\\codes\\others\\EmailBill\\Web\\src\\views\\BalanceView.vue",[],[],"D:\\codes\\others\\EmailBill\\Web\\src\\views\\BillAnalysisView.vue",[],[],"D:\\codes\\others\\EmailBill\\Web\\src\\views\\CalendarView.vue",[],[],"D:\\codes\\others\\EmailBill\\Web\\src\\views\\ClassificationBatch.vue",[],[],"D:\\codes\\others\\EmailBill\\Web\\src\\views\\ClassificationEdit.vue",[],[],"D:\\codes\\others\\EmailBill\\Web\\src\\views\\ClassificationNLP.vue",[],[],"D:\\codes\\others\\EmailBill\\Web\\src\\views\\EmailRecord.vue",[],[],"D:\\codes\\others\\EmailBill\\Web\\src\\views\\LoginView.vue",[],[],"D:\\codes\\others\\EmailBill\\Web\\src\\views\\LogView.vue",[],[],"D:\\codes\\others\\EmailBill\\Web\\src\\views\\MessageView.vue",[],[],"D:\\codes\\others\\EmailBill\\Web\\src\\views\\PeriodicRecord.vue",[],[],"D:\\codes\\others\\EmailBill\\Web\\src\\views\\SettingView.vue",[],[],"D:\\codes\\others\\EmailBill\\Web\\src\\views\\StatisticsView.vue",[],[],"D:\\codes\\others\\EmailBill\\Web\\src\\views\\TransactionsRecord.vue",[],[],"D:\\codes\\others\\EmailBill\\Web\\vite.config.js",[],[],{"ruleId":"190","severity":2,"message":"191","line":129,"column":5,"nodeType":"192","messageId":"193","endLine":129,"endColumn":12},{"ruleId":"194","severity":2,"message":"195","line":59,"column":11,"nodeType":"196","messageId":"197","endLine":59,"endColumn":43,"suggestions":"198"},"no-undef","'clients' is not defined.","Identifier","undef","no-case-declarations","Unexpected lexical declaration in case block.","VariableDeclaration","unexpected",["199"],{"messageId":"200","fix":"201","desc":"202"},"addBrackets",{"range":"203","text":"204"},"Add {} brackets around the case block.",[1274,1513],"{ message = '未授权,请重新登录'\r\n // 清除登录状态并跳转到登录页\r\n const authStore = useAuthStore()\r\n authStore.logout()\r\n router.push({ name: 'login', query: { redirect: router.currentRoute.value.fullPath } })\r\n break }"] \ No newline at end of file +[{"D:\\codes\\others\\EmailBill\\Web\\eslint.config.js":"1","D:\\codes\\others\\EmailBill\\Web\\public\\service-worker.js":"2","D:\\codes\\others\\EmailBill\\Web\\src\\api\\billImport.js":"3","D:\\codes\\others\\EmailBill\\Web\\src\\api\\budget.js":"4","D:\\codes\\others\\EmailBill\\Web\\src\\api\\config.js":"5","D:\\codes\\others\\EmailBill\\Web\\src\\api\\emailRecord.js":"6","D:\\codes\\others\\EmailBill\\Web\\src\\api\\log.js":"7","D:\\codes\\others\\EmailBill\\Web\\src\\api\\message.js":"8","D:\\codes\\others\\EmailBill\\Web\\src\\api\\notification.js":"9","D:\\codes\\others\\EmailBill\\Web\\src\\api\\request.js":"10","D:\\codes\\others\\EmailBill\\Web\\src\\api\\statistics.js":"11","D:\\codes\\others\\EmailBill\\Web\\src\\api\\transactionCategory.js":"12","D:\\codes\\others\\EmailBill\\Web\\src\\api\\transactionPeriodic.js":"13","D:\\codes\\others\\EmailBill\\Web\\src\\api\\transactionRecord.js":"14","D:\\codes\\others\\EmailBill\\Web\\src\\App.vue":"15","D:\\codes\\others\\EmailBill\\Web\\src\\components\\AddClassifyDialog.vue":"16","D:\\codes\\others\\EmailBill\\Web\\src\\components\\Bill\\BillForm.vue":"17","D:\\codes\\others\\EmailBill\\Web\\src\\components\\Bill\\ManualBillAdd.vue":"18","D:\\codes\\others\\EmailBill\\Web\\src\\components\\Bill\\OneLineBillAdd.vue":"19","D:\\codes\\others\\EmailBill\\Web\\src\\components\\Global\\GlobalAddBill.vue":"20","D:\\codes\\others\\EmailBill\\Web\\src\\components\\PopupContainer.vue":"21","D:\\codes\\others\\EmailBill\\Web\\src\\components\\ReasonGroupList.vue":"22","D:\\codes\\others\\EmailBill\\Web\\src\\components\\SmartClassifyButton.vue":"23","D:\\codes\\others\\EmailBill\\Web\\src\\components\\TransactionDetail.vue":"24","D:\\codes\\others\\EmailBill\\Web\\src\\components\\TransactionList.vue":"25","D:\\codes\\others\\EmailBill\\Web\\src\\constants\\enums.js":"26","D:\\codes\\others\\EmailBill\\Web\\src\\main.js":"27","D:\\codes\\others\\EmailBill\\Web\\src\\registerServiceWorker.js":"28","D:\\codes\\others\\EmailBill\\Web\\src\\router\\index.js":"29","D:\\codes\\others\\EmailBill\\Web\\src\\stores\\auth.js":"30","D:\\codes\\others\\EmailBill\\Web\\src\\stores\\counter.js":"31","D:\\codes\\others\\EmailBill\\Web\\src\\stores\\message.js":"32","D:\\codes\\others\\EmailBill\\Web\\src\\views\\BalanceView.vue":"33","D:\\codes\\others\\EmailBill\\Web\\src\\views\\BillAnalysisView.vue":"34","D:\\codes\\others\\EmailBill\\Web\\src\\views\\BudgetView.vue":"35","D:\\codes\\others\\EmailBill\\Web\\src\\views\\CalendarView.vue":"36","D:\\codes\\others\\EmailBill\\Web\\src\\views\\ClassificationBatch.vue":"37","D:\\codes\\others\\EmailBill\\Web\\src\\views\\ClassificationEdit.vue":"38","D:\\codes\\others\\EmailBill\\Web\\src\\views\\ClassificationNLP.vue":"39","D:\\codes\\others\\EmailBill\\Web\\src\\views\\ClassificationSmart.vue":"40","D:\\codes\\others\\EmailBill\\Web\\src\\views\\EmailRecord.vue":"41","D:\\codes\\others\\EmailBill\\Web\\src\\views\\LoginView.vue":"42","D:\\codes\\others\\EmailBill\\Web\\src\\views\\LogView.vue":"43","D:\\codes\\others\\EmailBill\\Web\\src\\views\\MessageView.vue":"44","D:\\codes\\others\\EmailBill\\Web\\src\\views\\PeriodicRecord.vue":"45","D:\\codes\\others\\EmailBill\\Web\\src\\views\\SettingView.vue":"46","D:\\codes\\others\\EmailBill\\Web\\src\\views\\StatisticsView.vue":"47","D:\\codes\\others\\EmailBill\\Web\\src\\views\\TransactionsRecord.vue":"48","D:\\codes\\others\\EmailBill\\Web\\vite.config.js":"49"},{"size":1376,"mtime":1767763712467,"results":"50","hashOfConfig":"51"},{"size":4492,"mtime":1767750713585,"results":"52","hashOfConfig":"53"},{"size":1786,"mtime":1766493393933,"results":"54","hashOfConfig":"51"},{"size":1474,"mtime":1767763656547,"results":"55","hashOfConfig":"51"},{"size":610,"mtime":1767596162064,"results":"56","hashOfConfig":"51"},{"size":1828,"mtime":1766628922810,"results":"57","hashOfConfig":"51"},{"size":868,"mtime":1766997952394,"results":"58","hashOfConfig":"51"},{"size":1670,"mtime":1766988985063,"results":"59","hashOfConfig":"51"},{"size":446,"mtime":1767514216792,"results":"60","hashOfConfig":"51"},{"size":2293,"mtime":1767750712255,"results":"61","hashOfConfig":"51"},{"size":2968,"mtime":1766740438323,"results":"62","hashOfConfig":"51"},{"size":1916,"mtime":1766716056978,"results":"63","hashOfConfig":"51"},{"size":2855,"mtime":1766991229153,"results":"64","hashOfConfig":"51"},{"size":6496,"mtime":1767514216795,"results":"65","hashOfConfig":"51"},{"size":5899,"mtime":1767750867395,"results":"66","hashOfConfig":"67"},{"size":842,"mtime":1767668937412,"results":"68","hashOfConfig":"67"},{"size":8471,"mtime":1767668937425,"results":"69","hashOfConfig":"67"},{"size":990,"mtime":1767514216797,"results":"70","hashOfConfig":"67"},{"size":2640,"mtime":1767750867395,"results":"71","hashOfConfig":"67"},{"size":1954,"mtime":1767514216799,"results":"72","hashOfConfig":"67"},{"size":3547,"mtime":1767763648503,"results":"73","hashOfConfig":"67"},{"size":19312,"mtime":1767750867395,"results":"74","hashOfConfig":"67"},{"size":10016,"mtime":1767750867395,"results":"75","hashOfConfig":"67"},{"size":9563,"mtime":1767750529171,"results":"76","hashOfConfig":"67"},{"size":8617,"mtime":1767750867395,"results":"77","hashOfConfig":"67"},{"size":375,"mtime":1767705302969,"results":"78","hashOfConfig":"51"},{"size":562,"mtime":1766971736444,"results":"79","hashOfConfig":"51"},{"size":2903,"mtime":1767527652708,"results":"80","hashOfConfig":"53"},{"size":3227,"mtime":1767702750845,"results":"81","hashOfConfig":"51"},{"size":1345,"mtime":1766640160651,"results":"82","hashOfConfig":"51"},{"size":306,"mtime":1766397238501,"results":"83","hashOfConfig":"51"},{"size":529,"mtime":1766988985056,"results":"84","hashOfConfig":"51"},{"size":1917,"mtime":1767705669835,"results":"85","hashOfConfig":"67"},{"size":9631,"mtime":1767763376529,"results":"86","hashOfConfig":"67"},{"size":30188,"mtime":1767750867395,"results":"87","hashOfConfig":"67"},{"size":9835,"mtime":1767750655270,"results":"88","hashOfConfig":"67"},{"size":3269,"mtime":1767750867395,"results":"89","hashOfConfig":"67"},{"size":8674,"mtime":1767750867395,"results":"90","hashOfConfig":"67"},{"size":8598,"mtime":1767750867395,"results":"91","hashOfConfig":"67"},{"size":9444,"mtime":1767750867395,"results":"92","hashOfConfig":"67"},{"size":14558,"mtime":1767751116825,"results":"93","hashOfConfig":"67"},{"size":2145,"mtime":1767750867395,"results":"94","hashOfConfig":"67"},{"size":9997,"mtime":1767750867395,"results":"95","hashOfConfig":"67"},{"size":7150,"mtime":1767751023646,"results":"96","hashOfConfig":"67"},{"size":18335,"mtime":1767750867395,"results":"97","hashOfConfig":"67"},{"size":9445,"mtime":1767750867395,"results":"98","hashOfConfig":"67"},{"size":32191,"mtime":1767750867395,"results":"99","hashOfConfig":"67"},{"size":6127,"mtime":1767750867395,"results":"100","hashOfConfig":"67"},{"size":702,"mtime":1766737248019,"results":"101","hashOfConfig":"51"},{"filePath":"102","messages":"103","suppressedMessages":"104","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"157m373",{"filePath":"105","messages":"106","suppressedMessages":"107","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"6whpx8",{"filePath":"108","messages":"109","suppressedMessages":"110","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"111","messages":"112","suppressedMessages":"113","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"114","messages":"115","suppressedMessages":"116","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"117","messages":"118","suppressedMessages":"119","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"120","messages":"121","suppressedMessages":"122","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"123","messages":"124","suppressedMessages":"125","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"126","messages":"127","suppressedMessages":"128","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"129","messages":"130","suppressedMessages":"131","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"132","messages":"133","suppressedMessages":"134","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"135","messages":"136","suppressedMessages":"137","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"138","messages":"139","suppressedMessages":"140","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"141","messages":"142","suppressedMessages":"143","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"144","messages":"145","suppressedMessages":"146","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"rrn29q",{"filePath":"147","messages":"148","suppressedMessages":"149","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"150","messages":"151","suppressedMessages":"152","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"153","messages":"154","suppressedMessages":"155","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"156","messages":"157","suppressedMessages":"158","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"159","messages":"160","suppressedMessages":"161","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"162","messages":"163","suppressedMessages":"164","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"165","messages":"166","suppressedMessages":"167","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"168","messages":"169","suppressedMessages":"170","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"171","messages":"172","suppressedMessages":"173","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"174","messages":"175","suppressedMessages":"176","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"177","messages":"178","suppressedMessages":"179","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"180","messages":"181","suppressedMessages":"182","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"183","messages":"184","suppressedMessages":"185","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"186","messages":"187","suppressedMessages":"188","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"189","messages":"190","suppressedMessages":"191","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"192","messages":"193","suppressedMessages":"194","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"195","messages":"196","suppressedMessages":"197","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"198","messages":"199","suppressedMessages":"200","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"201","messages":"202","suppressedMessages":"203","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"204","messages":"205","suppressedMessages":"206","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"207","messages":"208","suppressedMessages":"209","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"210","messages":"211","suppressedMessages":"212","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"213","messages":"214","suppressedMessages":"215","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"216","messages":"217","suppressedMessages":"218","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"219","messages":"220","suppressedMessages":"221","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"222","messages":"223","suppressedMessages":"224","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"225","messages":"226","suppressedMessages":"227","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"228","messages":"229","suppressedMessages":"230","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"231","messages":"232","suppressedMessages":"233","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"234","messages":"235","suppressedMessages":"236","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"237","messages":"238","suppressedMessages":"239","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"240","messages":"241","suppressedMessages":"242","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"243","messages":"244","suppressedMessages":"245","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"246","messages":"247","suppressedMessages":"248","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"D:\\codes\\others\\EmailBill\\Web\\eslint.config.js",[],[],"D:\\codes\\others\\EmailBill\\Web\\public\\service-worker.js",[],[],"D:\\codes\\others\\EmailBill\\Web\\src\\api\\billImport.js",[],[],"D:\\codes\\others\\EmailBill\\Web\\src\\api\\budget.js",[],[],"D:\\codes\\others\\EmailBill\\Web\\src\\api\\config.js",[],[],"D:\\codes\\others\\EmailBill\\Web\\src\\api\\emailRecord.js",[],[],"D:\\codes\\others\\EmailBill\\Web\\src\\api\\log.js",[],[],"D:\\codes\\others\\EmailBill\\Web\\src\\api\\message.js",[],[],"D:\\codes\\others\\EmailBill\\Web\\src\\api\\notification.js",[],[],"D:\\codes\\others\\EmailBill\\Web\\src\\api\\request.js",[],[],"D:\\codes\\others\\EmailBill\\Web\\src\\api\\statistics.js",[],[],"D:\\codes\\others\\EmailBill\\Web\\src\\api\\transactionCategory.js",[],[],"D:\\codes\\others\\EmailBill\\Web\\src\\api\\transactionPeriodic.js",[],[],"D:\\codes\\others\\EmailBill\\Web\\src\\api\\transactionRecord.js",[],[],"D:\\codes\\others\\EmailBill\\Web\\src\\App.vue",[],[],"D:\\codes\\others\\EmailBill\\Web\\src\\components\\AddClassifyDialog.vue",[],[],"D:\\codes\\others\\EmailBill\\Web\\src\\components\\Bill\\BillForm.vue",[],[],"D:\\codes\\others\\EmailBill\\Web\\src\\components\\Bill\\ManualBillAdd.vue",[],[],"D:\\codes\\others\\EmailBill\\Web\\src\\components\\Bill\\OneLineBillAdd.vue",[],[],"D:\\codes\\others\\EmailBill\\Web\\src\\components\\Global\\GlobalAddBill.vue",[],[],"D:\\codes\\others\\EmailBill\\Web\\src\\components\\PopupContainer.vue",[],[],"D:\\codes\\others\\EmailBill\\Web\\src\\components\\ReasonGroupList.vue",[],[],"D:\\codes\\others\\EmailBill\\Web\\src\\components\\SmartClassifyButton.vue",[],[],"D:\\codes\\others\\EmailBill\\Web\\src\\components\\TransactionDetail.vue",[],[],"D:\\codes\\others\\EmailBill\\Web\\src\\components\\TransactionList.vue",[],[],"D:\\codes\\others\\EmailBill\\Web\\src\\constants\\enums.js",[],[],"D:\\codes\\others\\EmailBill\\Web\\src\\main.js",[],[],"D:\\codes\\others\\EmailBill\\Web\\src\\registerServiceWorker.js",[],[],"D:\\codes\\others\\EmailBill\\Web\\src\\router\\index.js",[],[],"D:\\codes\\others\\EmailBill\\Web\\src\\stores\\auth.js",[],[],"D:\\codes\\others\\EmailBill\\Web\\src\\stores\\counter.js",[],[],"D:\\codes\\others\\EmailBill\\Web\\src\\stores\\message.js",[],[],"D:\\codes\\others\\EmailBill\\Web\\src\\views\\BalanceView.vue",[],[],"D:\\codes\\others\\EmailBill\\Web\\src\\views\\BillAnalysisView.vue",[],[],"D:\\codes\\others\\EmailBill\\Web\\src\\views\\BudgetView.vue",[],[],"D:\\codes\\others\\EmailBill\\Web\\src\\views\\CalendarView.vue",[],[],"D:\\codes\\others\\EmailBill\\Web\\src\\views\\ClassificationBatch.vue",[],[],"D:\\codes\\others\\EmailBill\\Web\\src\\views\\ClassificationEdit.vue",[],[],"D:\\codes\\others\\EmailBill\\Web\\src\\views\\ClassificationNLP.vue",[],[],"D:\\codes\\others\\EmailBill\\Web\\src\\views\\ClassificationSmart.vue",[],[],"D:\\codes\\others\\EmailBill\\Web\\src\\views\\EmailRecord.vue",[],[],"D:\\codes\\others\\EmailBill\\Web\\src\\views\\LoginView.vue",[],[],"D:\\codes\\others\\EmailBill\\Web\\src\\views\\LogView.vue",[],[],"D:\\codes\\others\\EmailBill\\Web\\src\\views\\MessageView.vue",[],[],"D:\\codes\\others\\EmailBill\\Web\\src\\views\\PeriodicRecord.vue",[],[],"D:\\codes\\others\\EmailBill\\Web\\src\\views\\SettingView.vue",[],[],"D:\\codes\\others\\EmailBill\\Web\\src\\views\\StatisticsView.vue",[],[],"D:\\codes\\others\\EmailBill\\Web\\src\\views\\TransactionsRecord.vue",[],[],"D:\\codes\\others\\EmailBill\\Web\\vite.config.js",[],[]] \ No newline at end of file diff --git a/Web/.gitignore b/Web/.gitignore index 593bd61..3687b3e 100644 --- a/Web/.gitignore +++ b/Web/.gitignore @@ -399,4 +399,6 @@ FodyWeavers.xsd -.idea/ \ No newline at end of file +.idea/ +# ESLint +.eslintcache diff --git a/Web/.vscode/settings.json b/Web/.vscode/settings.json index 608ad9b..c61e79c 100644 --- a/Web/.vscode/settings.json +++ b/Web/.vscode/settings.json @@ -6,8 +6,31 @@ "package.json": "package-lock.json, pnpm*, .yarnrc*, yarn*, .eslint*, eslint*, .oxlint*, oxlint*, .prettier*, prettier*, .editorconfig" }, "editor.codeActionsOnSave": { - "source.fixAll": "explicit" + "source.fixAll": "explicit", + "source.fixAll.eslint": "explicit" }, "editor.formatOnSave": true, - "editor.defaultFormatter": "esbenp.prettier-vscode" + "editor.defaultFormatter": "esbenp.prettier-vscode", + "[javascript]": { + "editor.defaultFormatter": "esbenp.prettier-vscode" + }, + "[vue]": { + "editor.defaultFormatter": "esbenp.prettier-vscode" + }, + "[css]": { + "editor.defaultFormatter": "esbenp.prettier-vscode" + }, + "eslint.validate": [ + "javascript", + "javascriptreact", + "vue" + ], + "eslint.format.enable": false, + "prettier.documentSelectors": [ + "**/*.vue", + "**/*.js", + "**/*.jsx", + "**/*.css", + "**/*.html" + ] } diff --git a/Web/eslint.config.js b/Web/eslint.config.js index 7807d8b..5687451 100644 --- a/Web/eslint.config.js +++ b/Web/eslint.config.js @@ -1,26 +1,52 @@ -import { defineConfig, globalIgnores } from 'eslint/config' -import globals from 'globals' import js from '@eslint/js' +import globals from 'globals' import pluginVue from 'eslint-plugin-vue' import skipFormatting from '@vue/eslint-config-prettier/skip-formatting' -export default defineConfig([ +export default [ { - name: 'app/files-to-lint', - files: ['**/*.{js,mjs,jsx,vue}'], + ignores: ['**/dist/**', '**/dist-ssr/**', '**/coverage/**', '**/node_modules/**', '.nuxt/**'], }, - - globalIgnores(['**/dist/**', '**/dist-ssr/**', '**/coverage/**']), - { + files: ['**/*.{js,mjs,jsx}'], languageOptions: { globals: { ...globals.browser, }, + parserOptions: { + ecmaVersion: 'latest', + sourceType: 'module', + }, + }, + rules: { + ...js.configs.recommended.rules, + 'indent': ['error', 2], + 'quotes': ['error', 'single', { avoidEscape: true }], + 'semi': ['error', 'never'], + 'no-unused-vars': ['warn', { argsIgnorePattern: '^_' }], + 'comma-dangle': ['error', 'never'], + 'no-trailing-spaces': 'error', + 'no-multiple-empty-lines': ['error', { max: 1 }], + 'space-before-function-paren': ['error', 'always'], + }, + }, + ...pluginVue.configs['flat/recommended'], + { + files: ['**/*.vue'], + rules: { + 'vue/multi-word-component-names': 'off', + 'vue/no-v-html': 'warn', + 'indent': 'off', }, }, - - js.configs.recommended, - ...pluginVue.configs['flat/essential'], skipFormatting, -]) + { + files: ['**/service-worker.js', '**/src/registerServiceWorker.js'], + languageOptions: { + globals: { + ...globals.serviceworker, + ...globals.browser, + }, + }, + }, +] diff --git a/Web/public/service-worker.js b/Web/public/service-worker.js index 70fe1cb..e4b575c 100644 --- a/Web/public/service-worker.js +++ b/Web/public/service-worker.js @@ -119,7 +119,7 @@ self.addEventListener('push', (event) => { try { const json = event.data.json(); data = { ...data, ...json }; - } catch (e) { + } catch { data.body = event.data.text(); } } diff --git a/Web/src/App.vue b/Web/src/App.vue index b0af6ac..3600b36 100644 --- a/Web/src/App.vue +++ b/Web/src/App.vue @@ -2,7 +2,7 @@
- + 日历 @@ -13,8 +13,8 @@ name="balance" icon="balance-list" :to="messageStore.unreadCount > 0 ? '/balance?tab=message' : '/balance'" - @click="handleTabClick('/balance')" - :badge="messageStore.unreadCount || null" + :badge="messageStore.unreadCount || null" + @click="handleTabClick('/balance')" > 账单 @@ -151,48 +151,6 @@ const handleAddTransactionSuccess = () => { window.dispatchEvent(event) } -// 辅助函数:将 Base64 字符串转换为 Uint8Array -const urlBase64ToUint8Array = (base64String) => { - const padding = '='.repeat((4 - base64String.length % 4) % 4); - const base64 = (base64String + padding).replace(/-/g, '+').replace(/_/g, '/'); - const rawData = window.atob(base64); - const outputArray = new Uint8Array(rawData.length); - for (let i = 0; i < rawData.length; ++i) { - outputArray[i] = rawData.charCodeAt(i); - } - return outputArray; -} - -const subscribeToPush = async () => { - if (!('serviceWorker' in navigator)) return; - - // 1. 获取 VAPID 公钥 - const response = await fetch('/api/notification/vapid-public-key'); - const { publicKey } = await response.json(); - - // 2. 等待 Service Worker 准备就绪 - const registration = await navigator.serviceWorker.ready; - - // 3. 请求订阅 - const subscription = await registration.pushManager.subscribe({ - userVisibleOnly: true, - applicationServerKey: urlBase64ToUint8Array(publicKey) - }); - - // 4. 将订阅信息发送给后端 - // 注意:后端 PushSubscriptionEntity 字段首字母大写,这里需要转换或让后端兼容 - const subJson = subscription.toJSON(); - await fetch('/api/notification/subscribe', { - method: 'POST', - headers: { 'Content-Type': 'application/json' }, - body: JSON.stringify({ - endpoint: subJson.endpoint, - p256dh: subJson.keys.p256dh, - auth: subJson.keys.auth - }) - }); -} -