From ae6ed9554435ce884971e35ad1dda70b862f8bf3 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期三, 24 二月 2021 19:25:35 +0800
Subject: [PATCH] 2021-02-24
---
src/menu/components/code/sandbox/editorcode/index.jsx | 9 +++++++--
1 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/src/menu/components/code/sandbox/editorcode/index.jsx b/src/menu/components/code/sandbox/editorcode/index.jsx
index 6d3df7d..5a51a66 100644
--- a/src/menu/components/code/sandbox/editorcode/index.jsx
+++ b/src/menu/components/code/sandbox/editorcode/index.jsx
@@ -1,7 +1,7 @@
import React, {Component} from 'react'
import PropTypes from 'prop-types'
import { is, fromJS } from 'immutable'
-import { Icon, Modal, Tabs } from 'antd'
+import { Icon, Modal, Tabs, message } from 'antd'
import zhCN from '@/locales/zh-CN/model.js'
import enUS from '@/locales/en-US/model.js'
@@ -18,7 +18,7 @@
}
state = {
- dict: localStorage.getItem('lang') !== 'en-US' ? zhCN : enUS,
+ dict: sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS,
visible: false,
html: '',
css: '',
@@ -63,6 +63,11 @@
}
onJsChange = (val) => {
+ if (/document\.getElementsByTagName/g.test(val)) {
+ message.warning('涓洪槻姝唬鐮佸啿绐侊紝js涓笉鍙娇鐢╠ocument.getElementsByTagName鏂规硶!')
+ return
+ }
+
this.setState({
js: val
})
--
Gitblit v1.8.0