af-mobile-client-vue3 1.3.54 → 1.3.57
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 +115 -115
- package/public/favicon.svg +4 -4
- package/scripts/verifyCommit.js +19 -19
- package/src/App.vue +1 -1
- package/src/api/user/index.ts +45 -45
- package/src/components/data/UserDetail/types.ts +1 -1
- package/src/components/data/XReportGrid/XAddReport/index.ts +1 -1
- package/src/components/data/XReportGrid/XReportDrawer/index.ts +1 -1
- package/src/components/data/XTag/index.vue +10 -10
- package/src/components/layout/TabBarLayout/index.vue +40 -40
- package/src/font-style/Inter-Bold.woff2 +0 -0
- package/src/font-style/Inter-Medium.woff2 +0 -0
- package/src/font-style/Inter-Regular.woff2 +0 -0
- package/src/font-style/Inter-SemiBold.woff2 +0 -0
- package/src/font-style/PingFangSC-Medium.subset.woff2 +0 -0
- package/src/font-style/PingFangSC-Medium.woff2 +0 -0
- package/src/font-style/PingFangSC-Regular.subset.woff2 +0 -0
- package/src/font-style/PingFangSC-Semibold.subset.woff2 +0 -0
- package/src/font-style/PingFangSC-Semibold.woff2 +0 -0
- package/src/font-style/font.css +59 -2
- package/src/hooks/useCommon.ts +9 -9
- package/src/plugins/AppData.ts +38 -38
- package/src/router/external-routes.ts +69 -69
- package/src/router/guards.ts +131 -131
- package/src/router/invoiceRoutes.ts +33 -33
- package/src/router/routes.ts +421 -421
- package/src/services/api/Login.ts +6 -6
- package/src/services/api/common.ts +109 -109
- package/src/services/api/manage.ts +8 -8
- package/src/services/api/search.ts +16 -16
- package/src/services/restTools.ts +56 -56
- package/src/services/v3Api.ts +11 -11
- package/src/stores/modules/user.ts +1 -1
- package/src/styles/login.less +109 -109
- package/src/types/platform.ts +194 -194
- package/src/utils/authority-utils.ts +84 -84
- package/src/utils/crypto.ts +39 -39
- package/src/utils/environment.ts +10 -10
- package/src/utils/platform-auth.ts +150 -150
- package/src/utils/routerUtil.ts +81 -2
- package/src/utils/runEvalFunction.ts +13 -13
- package/src/utils/wechat.ts +297 -297
- package/src/views/component/EvaluateRecordView/index.vue +40 -40
- package/src/views/component/XCellDetailView/index.vue +217 -217
- package/src/views/component/XReportFormIframeView/index.vue +47 -47
- package/src/views/component/XReportFormView/index.vue +13 -13
- package/src/views/component/XSignatureView/index.vue +50 -50
- package/src/views/component/notice.vue +46 -46
- package/src/views/component/topNav.vue +36 -36
- package/src/views/invoiceShow/index.vue +61 -61
- package/src/views/loading/AuthLoading.vue +378 -378
- package/src/views/user/login/index.vue +22 -22
- package/src/views/user/register/index.vue +1 -1
- package/vite.config.ts +114 -114
- package/certs/127.0.0.1+2-key.pem +0 -28
- package/certs/127.0.0.1+2.pem +0 -27
package/src/utils/routerUtil.ts
CHANGED
|
@@ -105,14 +105,93 @@ function loadRoutes(routesConfig?: any) {
|
|
|
105
105
|
const newRoutes = parseRoutes(routesConfig, routes)
|
|
106
106
|
// 设置路由首页
|
|
107
107
|
newRoutes[0].redirect = '/'
|
|
108
|
-
|
|
108
|
+
let finalRoutes = mergeRoutes(routes, newRoutes)
|
|
109
109
|
formatRoutes(finalRoutes)
|
|
110
|
+
const duplicates = checkDuplicateRouteNames(finalRoutes)
|
|
111
|
+
if (duplicates.length > 0) {
|
|
112
|
+
// 可以选择在这里处理重复的路由名称
|
|
113
|
+
finalRoutes = deduplicateRouteNames(finalRoutes)
|
|
114
|
+
}
|
|
110
115
|
finalRoutes.forEach((row) => {
|
|
111
116
|
router.addRoute(row)
|
|
112
117
|
})
|
|
113
118
|
}
|
|
114
119
|
}
|
|
115
120
|
|
|
121
|
+
function checkDuplicateRouteNames(routes) {
|
|
122
|
+
const names = new Set()
|
|
123
|
+
const duplicates = []
|
|
124
|
+
|
|
125
|
+
function check(route) {
|
|
126
|
+
if (route.name) {
|
|
127
|
+
if (names.has(`${route.name}_${route.path}`)) {
|
|
128
|
+
duplicates.push(`${route.name}_${route.path}`)
|
|
129
|
+
}
|
|
130
|
+
else {
|
|
131
|
+
names.add(`${route.name}_${route.path}`)
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
if (route.children) {
|
|
135
|
+
route.children.forEach(check)
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
routes.forEach(check)
|
|
140
|
+
return duplicates
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
// 处理重复路由名称的函数
|
|
144
|
+
function deduplicateRouteNames(routes) {
|
|
145
|
+
const namePathMap = new Map() // 存储 name_path 组合
|
|
146
|
+
const nameCountMap = new Map() // 存储仅 name 的计数
|
|
147
|
+
|
|
148
|
+
function deduplicate(route) {
|
|
149
|
+
if (!route)
|
|
150
|
+
return null
|
|
151
|
+
|
|
152
|
+
if (route.name) {
|
|
153
|
+
const namePathKey = `${route.name}_${route.path}`
|
|
154
|
+
const nameKey = route.name
|
|
155
|
+
|
|
156
|
+
// 检查 name 和 path 是否都重复
|
|
157
|
+
if (namePathMap.has(namePathKey)) {
|
|
158
|
+
// 完全重复的路由,直接移除
|
|
159
|
+
// console.log(`移除重复路由: name=${route.name}, path=${route.path}`)
|
|
160
|
+
return null
|
|
161
|
+
}
|
|
162
|
+
else {
|
|
163
|
+
// 记录这个 name 和 path 的组合
|
|
164
|
+
namePathMap.set(namePathKey, route)
|
|
165
|
+
|
|
166
|
+
// 检查是否只有 name 重复
|
|
167
|
+
if (nameCountMap.has(nameKey)) {
|
|
168
|
+
const count = nameCountMap.get(nameKey) + 1
|
|
169
|
+
nameCountMap.set(nameKey, count)
|
|
170
|
+
// 修改路由名称,添加计数后缀
|
|
171
|
+
route.name = `${nameKey}_${count}`
|
|
172
|
+
// console.log(`重命名重复路由: ${nameKey} -> ${route.name}`)
|
|
173
|
+
}
|
|
174
|
+
else {
|
|
175
|
+
nameCountMap.set(nameKey, 1)
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
// 递归处理子路由
|
|
181
|
+
if (route.children && route.children.length) {
|
|
182
|
+
route.children = route.children
|
|
183
|
+
.map(child => deduplicate({ ...child }))
|
|
184
|
+
.filter(child => child !== null) // 移除返回 null 的子路由
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
return route
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
// 处理所有路由并过滤掉返回 null 的路由
|
|
191
|
+
return routes
|
|
192
|
+
.map(route => deduplicate({ ...route }))
|
|
193
|
+
.filter(route => route !== null)
|
|
194
|
+
}
|
|
116
195
|
/**
|
|
117
196
|
* 合并路由
|
|
118
197
|
* @param target
|
|
@@ -219,7 +298,7 @@ function parsefunc(func) {
|
|
|
219
298
|
params: undefined,
|
|
220
299
|
children: undefined,
|
|
221
300
|
}
|
|
222
|
-
if (row
|
|
301
|
+
if (row?.link?.includes('$')) {
|
|
223
302
|
route.router = row.link.split('$')[1]
|
|
224
303
|
route.params = row.link.split('$')[0]
|
|
225
304
|
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
export function executeStrFunction(funcString, args) {
|
|
2
|
-
// 使用 eval 执行传入的函数字符串
|
|
3
|
-
// eslint-disable-next-line no-eval
|
|
4
|
-
return eval(`(${funcString})`)(...args)
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
export function executeStrFunctionByContext(context, fnStr, args) {
|
|
8
|
-
// 使用 new Function 创建函数,并绑定 context 作为 this
|
|
9
|
-
// eslint-disable-next-line no-new-func
|
|
10
|
-
const fn = new Function(`return (${fnStr});`)()
|
|
11
|
-
// 使用 bind 绑定 context,并立即调用
|
|
12
|
-
return fn.bind(context)(...args)
|
|
13
|
-
}
|
|
1
|
+
export function executeStrFunction(funcString, args) {
|
|
2
|
+
// 使用 eval 执行传入的函数字符串
|
|
3
|
+
// eslint-disable-next-line no-eval
|
|
4
|
+
return eval(`(${funcString})`)(...args)
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export function executeStrFunctionByContext(context, fnStr, args) {
|
|
8
|
+
// 使用 new Function 创建函数,并绑定 context 作为 this
|
|
9
|
+
// eslint-disable-next-line no-new-func
|
|
10
|
+
const fn = new Function(`return (${fnStr});`)()
|
|
11
|
+
// 使用 bind 绑定 context,并立即调用
|
|
12
|
+
return fn.bind(context)(...args)
|
|
13
|
+
}
|