Commit dafcdd898caae57104f1155b0ec660ea333e7b19

Authored by Vben
1 parent 5bce6528

fix: ensure that safari is running properly, fix #875

.eslintrc.js
... ... @@ -61,6 +61,7 @@ module.exports = defineConfig({
61 61 'vue/singleline-html-element-content-newline': 'off',
62 62 'vue/attribute-hyphenation': 'off',
63 63 'vue/require-default-prop': 'off',
  64 + 'vue/script-setup-uses-vars': 'off',
64 65 'vue/html-self-closing': [
65 66 'error',
66 67 {
... ...
commitlint.config.js
1 1 module.exports = {
2 2 ignores: [(commit) => commit.includes('init')],
3 3 extends: ['@commitlint/config-conventional'],
4   - parserPreset: {
5   - parserOpts: {
6   - headerPattern: /^(\w*|[\u4e00-\u9fa5]*)(?:[\(\(](.*)[\)\)])?[\:\:] (.*)/,
7   - headerCorrespondence: ['type', 'scope', 'subject'],
8   - referenceActions: [
9   - 'close',
10   - 'closes',
11   - 'closed',
12   - 'fix',
13   - 'fixes',
14   - 'fixed',
15   - 'resolve',
16   - 'resolves',
17   - 'resolved',
18   - ],
19   - issuePrefixes: ['#'],
20   - noteKeywords: ['BREAKING CHANGE'],
21   - fieldPattern: /^-(.*?)-$/,
22   - revertPattern: /^Revert\s"([\s\S]*)"\s*This reverts commit (\w*)\./,
23   - revertCorrespondence: ['header', 'hash'],
24   - warn() {},
25   - mergePattern: null,
26   - mergeCorrespondence: null,
27   - },
28   - },
29 4 rules: {
30 5 'body-leading-blank': [2, 'always'],
31 6 'footer-leading-blank': [1, 'always'],
... ...
src/router/helper/menuHelper.ts
... ... @@ -72,14 +72,16 @@ export function transformRouteToMenu(routeModList: AppRouteModule[], routerMappi
72 72 /**
73 73 * config menu with given params
74 74 */
75   -const menuParamRegex = /(?<=:)([\s\S]+?)((?=\/)|$)/g;
  75 +const menuParamRegex = /(?::)([\s\S]+?)((?=\/)|$)/g;
76 76 export function configureDynamicParamsMenu(menu: Menu, params: RouteParams) {
77 77 const { path, paramPath } = toRaw(menu);
78 78 let realPath = paramPath ? paramPath : path;
79 79 const matchArr = realPath.match(menuParamRegex);
  80 +
80 81 matchArr?.forEach((it) => {
81   - if (params[it]) {
82   - realPath = realPath.replace(`:${it}`, params[it] as string);
  82 + const realIt = it.substr(1);
  83 + if (params[realIt]) {
  84 + realPath = realPath.replace(`:${realIt}`, params[realIt] as string);
83 85 }
84 86 });
85 87 // save original param path.
... ...