Commit 6e404697353ccc4c2c7e797e4da7d41098d59c96
1 parent
bbb5bed7
【修复】菜单无法使用外链的问题
Showing
1 changed file
with
2 additions
and
1 deletions
yudao-ui-admin/src/views/system/menu/index.vue
| ... | ... | @@ -189,6 +189,7 @@ import IconSelect from "@/components/IconSelect"; |
| 189 | 189 | |
| 190 | 190 | import { SystemMenuTypeEnum, CommonStatusEnum } from '@/utils/constants' |
| 191 | 191 | import { getDictDatas, DICT_TYPE } from '@/utils/dict' |
| 192 | +import {isExternal} from "@/utils/validate"; | |
| 192 | 193 | |
| 193 | 194 | export default { |
| 194 | 195 | name: "Menu", |
| ... | ... | @@ -346,7 +347,7 @@ export default { |
| 346 | 347 | || this.form.type === SystemMenuTypeEnum.MENU) { |
| 347 | 348 | // 如果是外链,则不进行校验 |
| 348 | 349 | const path = this.form.path |
| 349 | - if (path.indexOf('http://') === -1 || path.indexOf('https://') === -1) { | |
| 350 | + if (!isExternal(path)) { | |
| 350 | 351 | // 父权限为根节点,path 必须以 / 开头 |
| 351 | 352 | if (this.form.parentId === 0 && path.charAt(0) !== '/') { |
| 352 | 353 | this.$modal.msgSuccess('前端必须以 / 开头') | ... | ... |