diff --git a/package.json b/package.json index 61898ae..9cca632 100644 --- a/package.json +++ b/package.json @@ -59,6 +59,7 @@ "@ttou/uview-typings": "^2.0.5", "clipboard": "^2.0.11", "dayjs": "^1.11.9", + "tslib": "^2.6.2", "uview-plus": "^3.1.36", "vue": "^3.2.47", "vue-i18n": "^9.2.2", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 95b6b25..3b5f2a6 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -59,6 +59,9 @@ dependencies: dayjs: specifier: ^1.11.9 version: 1.11.9 + tslib: + specifier: ^2.6.2 + version: 2.6.2 uview-plus: specifier: ^3.1.36 version: 3.1.36 @@ -5417,7 +5420,7 @@ packages: dependencies: copy-anything: 2.0.6 parse-node-version: 1.0.1 - tslib: 2.6.1 + tslib: 2.6.2 optionalDependencies: errno: 0.1.8 graceful-fs: 4.2.11 @@ -6576,8 +6579,8 @@ packages: punycode: 2.3.0 dev: true - /tslib@2.6.1: - resolution: {integrity: sha512-t0hLfiEKfMUoqhG+U1oid7Pva4bbDPHYfJNiB7BiIjRkj1pyC++4N3huJfqY6aRH6VTB0rvtzQwjM4K6qpfOig==} + /tslib@2.6.2: + resolution: {integrity: sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==} /type-detect@4.0.8: resolution: {integrity: sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==} diff --git a/src/plugins/auth.ts b/src/plugins/auth.ts index 48b9de7..bb33a85 100644 --- a/src/plugins/auth.ts +++ b/src/plugins/auth.ts @@ -76,7 +76,7 @@ export default { * @param roles 角色数组 * @returns */ - hasRoleAnd(roles: Array) { + hasRoleAnd(roles: Array): boolean { return roles.every(item => { return authRole(item) }) diff --git a/tsconfig.json b/tsconfig.json index 95e385a..e11b5fa 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,19 +1,24 @@ { "compilerOptions": { - "strict": true, - "forceConsistentCasingInFileNames":true, - "outDir": "dist/compiled", - "allowJs": true, - "lib": ["es2017"], - "baseUrl": "./", - "paths": { - "@": [ - "src" - ], - "@/*": [ - "src/*" - ], - "vue": ["node_modules/vue"] - }, + "importHelpers": true, + "strict": true, + "forceConsistentCasingInFileNames": true, + "outDir": "dist/compiled", + "baseUrl": "./", + "allowSyntheticDefaultImports": true, + "allowJs": true, + "jsx": "preserve", + "moduleResolution": "node", + "module": "ES2022", + "lib": ["ES2020", "dom"], + "declaration": true, + "paths": { + "@": ["src"], + "@/*": ["src/*"], + "/@/*": ["src/*"], + "vue": ["node_modules/vue"], + "tslib" : ["node_modules/tslib/tslib.d.ts"] + } } -} \ No newline at end of file + } + \ No newline at end of file