diff --git a/JS直接操作数据库.js b/JS直接操作数据库.js deleted file mode 100644 index 475fe74..0000000 --- a/JS直接操作数据库.js +++ /dev/null @@ -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; -} \ No newline at end of file