vue2server7 7.0.48 → 7.0.50

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vue2server7",
3
- "version": "7.0.48",
3
+ "version": "7.0.50",
4
4
  "description": "",
5
5
  "scripts": {
6
6
  "dev": "nodemon --watch src --ext ts --exec \"ts-node src/app.ts\"",
@@ -0,0 +1,60 @@
1
+ // scripts/check-permission-duplicate.js
2
+ import fs from 'fs'
3
+ import path from 'path'
4
+
5
+ const rootDir = path.resolve(process.cwd(), 'src')
6
+
7
+ const permissionMap = new Map()
8
+
9
+ function scanFile(filePath) {
10
+ const content = fs.readFileSync(filePath, 'utf-8')
11
+
12
+ // 匹配 v-permission="xxx" 或 v-permission="'xxx'"
13
+ const regex = /v-permission\s*=\s*["']([^"']+)["']/g
14
+
15
+ let match
16
+ while ((match = regex.exec(content))) {
17
+ const permission = match[1].trim()
18
+
19
+ if (!permissionMap.has(permission)) {
20
+ permissionMap.set(permission, [])
21
+ }
22
+
23
+ permissionMap.get(permission).push(filePath)
24
+ }
25
+ }
26
+
27
+ function scanDir(dir) {
28
+ const files = fs.readdirSync(dir)
29
+
30
+ for (const file of files) {
31
+ const fullPath = path.join(dir, file)
32
+ const stat = fs.statSync(fullPath)
33
+
34
+ if (stat.isDirectory()) {
35
+ scanDir(fullPath)
36
+ } else if (/\.(vue|js|ts|jsx|tsx)$/.test(file)) {
37
+ scanFile(fullPath)
38
+ }
39
+ }
40
+ }
41
+
42
+ scanDir(rootDir)
43
+
44
+ // 输出重复
45
+ console.log('\n🔍 重复的权限指令如下:\n')
46
+
47
+ let hasDuplicate = false
48
+
49
+ for (const [key, files] of permissionMap.entries()) {
50
+ if (files.length > 1) {
51
+ hasDuplicate = true
52
+ console.log(`🚨 权限:${key}`)
53
+ files.forEach(f => console.log(` - ${f}`))
54
+ console.log('')
55
+ }
56
+ }
57
+
58
+ if (!hasDuplicate) {
59
+ console.log('✅ 没有发现重复权限')
60
+ }
package/test/2.txt CHANGED
@@ -1 +1,14 @@
1
- cmd /c copy /b big.zip.000+big.zip.001+big.zip.002+big.zip.003+big.zip.004+big.zip.005+big.zip.006+big.zip.007+big.zip.008+big.zip.009+big.zip.010+big.zip.011+big.zip.012+big.zip.013+big.zip.014+big.zip.015+big.zip.016+big.zip.017+big.zip.018+big.zip.019+big.zip.020+big.zip.021+big.zip.022+big.zip.023+big.zip.024+big.zip.025+big.zip.026+big.zip.027+big.zip.028+big.zip.029+big.zip.030+big.zip.031+big.zip.032+big.zip.033+big.zip.034 big.zip
1
+ const getSummaries = ({ columns }: any) => {
2
+ return columns.map((col: any, index: number) => {
3
+ if (index === 0) return '合计'
4
+
5
+ const value = summaryRow.value[col.property]
6
+
7
+ // 👉 指定字段做千分位
8
+ if (['price', 'amount'].includes(col.property)) {
9
+ return formatNumber(Number(value))
10
+ }
11
+
12
+ return value ?? ''
13
+ })
14
+ }