|
|
|
@ -25,9 +25,10 @@ $globalExpandRouter($globalRouter, routes); // 添加路由扩展 |
|
|
|
$globalRouter.beforeEach((to, from, next) => { |
|
|
|
// 在这里进行身份验证、权限检查等
|
|
|
|
// ...
|
|
|
|
let pattern3 = new RegExp("^[0-9]*$"); |
|
|
|
if (null != to.query) { |
|
|
|
for (let key in to.query) { |
|
|
|
if (typeof to.query[key] === 'number' && !Number.isNaN(to.query[key])) { |
|
|
|
if (pattern3.test(to.query[key])) { |
|
|
|
if (to.query[key].toString().length > 9) { |
|
|
|
to.query[key] = 0; |
|
|
|
} |
|
|
|
@ -41,7 +42,7 @@ $globalRouter.beforeEach((to, from, next) => { |
|
|
|
|
|
|
|
if (null != to.params) { |
|
|
|
for (let key in to.params) { |
|
|
|
if (typeof to.params[key] === 'number' && !Number.isNaN(to.params[key])) { |
|
|
|
if (pattern3.test(to.params[key])) { |
|
|
|
if (to.params[key].toString().length > 9) { |
|
|
|
to.params[key] = 0; |
|
|
|
} |
|
|
|
|