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

This commit is contained in:
YunaiV 2022-04-23 01:30:15 +08:00
parent bbb5bed7da
commit 6e40469735

View File

@ -189,6 +189,7 @@ import IconSelect from "@/components/IconSelect";
import { SystemMenuTypeEnum, CommonStatusEnum } from '@/utils/constants' import { SystemMenuTypeEnum, CommonStatusEnum } from '@/utils/constants'
import { getDictDatas, DICT_TYPE } from '@/utils/dict' import { getDictDatas, DICT_TYPE } from '@/utils/dict'
import {isExternal} from "@/utils/validate";
export default { export default {
name: "Menu", name: "Menu",
@ -346,7 +347,7 @@ export default {
|| this.form.type === SystemMenuTypeEnum.MENU) { || this.form.type === SystemMenuTypeEnum.MENU) {
// //
const path = this.form.path const path = this.form.path
if (path.indexOf('http://') === -1 || path.indexOf('https://') === -1) { if (!isExternal(path)) {
// path / // path /
if (this.form.parentId === 0 && path.charAt(0) !== '/') { if (this.form.parentId === 0 && path.charAt(0) !== '/') {
this.$modal.msgSuccess('前端必须以 / 开头') this.$modal.msgSuccess('前端必须以 / 开头')