Commit 6e404697353ccc4c2c7e797e4da7d41098d59c96

Authored by YunaiV
1 parent bbb5bed7

【修复】菜单无法使用外链的问题

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