Skip to content

Commit

Permalink
删除提示信息X
Browse files Browse the repository at this point in the history
  • Loading branch information
王飞 committed Jul 2, 2024
1 parent e53ae4b commit 77298d7
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions sql/templates/sqlsubmit.html
Original file line number Diff line number Diff line change
Expand Up @@ -391,8 +391,10 @@ <h4 class="modal-title text-danger">提交信息确认</h4>
return true
}

String.prototype.removeStartsWith = function(prefix) {
let str = String(this);
function removeStartsWith(str,prefix) {
if (typeof str !== 'string' || str === null) {
return str;
}
if (str.startsWith(prefix)) {
return str.substring(prefix.length);
}
Expand All @@ -403,7 +405,7 @@ <h4 class="modal-title text-danger">提交信息确认</h4>
const sqlTips = "-- 请在此输入SQL,以分号结尾,仅支持DML和DDL语句,查询语句请使用SQL查询功能。\n";
var editorValue=editor.getValue();
// 删除默认的提示字符串
editorValueRemove=editorValue.removeStartsWith(sqlTips);
editorValueRemove=removeStartsWith(editorValue,sqlTips);
if(editorValue!==editorValueRemove)
{
editor.setValue(editorValueRemove);
Expand Down

0 comments on commit 77298d7

Please sign in to comment.