Skip to content

Commit f03ec30

Browse files
committed
【修复】菜单无法使用外链的问题
1 parent 3f0217f commit f03ec30

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/views/system/menu/index.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,7 @@ import IconSelect from "@/components/IconSelect";
189189
190190
import { SystemMenuTypeEnum, CommonStatusEnum } from '@/utils/constants'
191191
import { getDictDatas, DICT_TYPE } from '@/utils/dict'
192+
import {isExternal} from "@/utils/validate";
192193
193194
export default {
194195
name: "Menu",
@@ -346,7 +347,7 @@ export default {
346347
|| this.form.type === SystemMenuTypeEnum.MENU) {
347348
// 如果是外链,则不进行校验
348349
const path = this.form.path
349-
if (path.indexOf('http://') === -1 || path.indexOf('https://') === -1) {
350+
if (!isExternal(path)) {
350351
// 父权限为根节点,path 必须以 / 开头
351352
if (this.form.parentId === 0 && path.charAt(0) !== '/') {
352353
this.$modal.msgSuccess('前端必须以 / 开头')

0 commit comments

Comments
 (0)