删除 JS直接操作数据库.js

This commit is contained in:
wintsa 2026-02-02 11:10:34 +08:00
parent 2b46b64bb5
commit bf51e89611

View File

@ -1,35 +0,0 @@
/*
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
前端执行SQL查询语句
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
*/
// let SQL_sentence = `SELECT loginid as id,password as pw FROM hrmresource`;
// let cols = "id,pw";
function SelectByGSL(SQL_sentence, cols) {
const getUrl = '/api/gSl/GSl/gsl';
const Query1 = SQL_sentence;//编写SQL语句
const jiami = ecCom.WeaTools.Base64.encode(Query1);
const result1 = ecCom.WeaTools.Base64.encode(cols);//编写查询内容
const mynewJSON = `{
"expression": "${jiami}",
"result": "${result1}"
}`;
const result = await ecCom.WeaTools.callApi(getUrl, 'POST', JSON.parse(mynewJSON));
return result;
}
/*
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
前端执行SQL增改语句
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
*/
// let SQL_sentence = `update hrmresource set fieldname='123' where id='43' `;
function insertOrDeleteOrUpdateByGSL(SQL_sentence) {
const getUrl = '/api/gSl/GSl/setTable';
const Query1 = SQL_sentence;//编写SQL语句
const jiami = ecCom.WeaTools.Base64.encode(Query1);
const mynewJSON = `{
"expression": "${jiami}",
}`;
const result = await ecCom.WeaTools.callApi(getUrl, 'POST', JSON.parse(mynewJSON));
return result;
}