女生wordpress网站适合泾川县住房和城乡建设局网站

bicheng/2026/1/20 18:07:05/文章来源:
女生wordpress网站适合,泾川县住房和城乡建设局网站,WordPress访问ip记录,广告创意策划1.在自己的项目JS文件夹中建文件#xff1a;config.js、mssql.js和server.js以及api文件夹下的user.js 2.在config.js中封装数据库信息 let app {user: sa, //这里写你的数据库的用户名password: ,//这里写数据库的密码server: localhost,database: medicineSystem, // 数据…1.在自己的项目JS文件夹中建文件config.js、mssql.js和server.js以及api文件夹下的user.js 2.在config.js中封装数据库信息 let app {user: sa, //这里写你的数据库的用户名password: ,//这里写数据库的密码server: localhost,database: medicineSystem, // 数据库名字port: 1433, //端口号,默认1433options: {encrypt: false, //加密,设置为true时会连接失败 Failed to connect to localhost:1433 - self signed certificateenableArithAbort: false},pool: {min: 0,max: 10,idleTimeoutMillis: 3000} }module.exports app 3.在mssql.js中对sql语句的二次封装 //mssql.js /***sqlserver Model**/ const mssql require(mssql); const conf require(./config.js);const pool new mssql.ConnectionPool(conf) const poolConnect pool.connect()pool.on(error, err {console.log(error: , err) }) /*** 自由查询* param sql sql语句例如: select * from news where id id* param params 参数用来解释sql中的*例如 { id: id }* param callBack 回调函数*/ let querySql async function (sql, params, callBack) {try {let ps new mssql.PreparedStatement(await poolConnect);if (params ! ) {for (let index in params) {if (typeof params[index] number) {ps.input(index, mssql.Int);} else if (typeof params[index] string) {ps.input(index, mssql.NVarChar);}}}ps.prepare(sql, function (err) {if (err)console.log(err);ps.execute(params, function (err, recordset) {callBack(err, recordset);ps.unprepare(function (err) {if (err)console.log(err);});});});} catch (e) {console.log(e)} };/*** 按条件和需求查询指定表* param tableName 数据库表名例news* param topNumber 只查询前几个数据可为空为空表示查询所有* param whereSql 条件语句例where id id* param params 参数用来解释sql中的*例如 { id: id }* param orderSql 排序语句例order by created_date* param callBack 回调函数*/ let select async function (tableName, topNumber, whereSql, params, orderSql, callBack) {try {let ps new mssql.PreparedStatement(await poolConnect);let sql select * from tableName ;if (topNumber ! ) {sql select top( topNumber ) * from tableName ;}sql whereSql ;if (params ! ) {for (let index in params) {if (typeof params[index] number) {ps.input(index, mssql.Int);} else if (typeof params[index] string) {ps.input(index, mssql.NVarChar);}}}sql orderSql;console.log(sql);ps.prepare(sql, function (err) {if (err)console.log(err);ps.execute(params, function (err, recordset) {callBack(err, recordset);ps.unprepare(function (err) {if (err)console.log(err);});});});} catch (e) {console.log(e)} };/*** 查询指定表的所有数据* param tableName 数据库表名* param callBack 回调函数*/ let selectAll async function (tableName, callBack) {try {let ps new mssql.PreparedStatement(await poolConnect);let sql select * from tableName ;ps.prepare(sql, function (err) {if (err)console.log(err);ps.execute(, function (err, recordset) {callBack(err, recordset);ps.unprepare(function (err) {if (err)console.log(err);});});});} catch (e) {console.log(e)} };/*** 添加字段到指定表* param addObj 需要添加的对象字段例{ name: name, age: 20 }* param tableName 数据库表名* param callBack 回调函数*/ let add async function (addObj, tableName, callBack) {try {let ps new mssql.PreparedStatement(await poolConnect);let sql insert into tableName (;if (addObj ! ) {for (let index in addObj) {if (typeof addObj[index] number) {ps.input(index, mssql.Int);} else if (typeof addObj[index] string) {ps.input(index, mssql.NVarChar);}sql index ,;}sql sql.substring(0, sql.length - 1) ) values(;for (let index in addObj) {if (typeof addObj[index] number) {sql addObj[index] ,;} else if (typeof addObj[index] string) {sql addObj[index] ,;}}}sql sql.substring(0, sql.length - 1) ) SELECT IDENTITY id; // 加上SELECT IDENTITY id才会返回idps.prepare(sql, function (err) {if (err) console.log(err);ps.execute(addObj, function (err, recordset) {callBack(err, recordset);ps.unprepare(function (err) {if (err)console.log(err);});});});} catch (e) {console.log(e)} };/*** 更新指定表的数据* param updateObj 需要更新的对象字段例{ name: name, age: 20 }* param whereObj 需要更新的条件例: { id: id }* param tableName 数据库表名* param callBack 回调函数*/ let update async function (updateObj, whereObj, tableName, callBack) {try {let ps new mssql.PreparedStatement(await poolConnect);let sql update tableName set ;if (updateObj ! ) {for (let index in updateObj) {if (typeof updateObj[index] number) {ps.input(index, mssql.Int);sql index updateObj[index] ,;} else if (typeof updateObj[index] string) {ps.input(index, mssql.NVarChar);sql index updateObj[index] ,;}}}sql sql.substring(0, sql.length - 1) where ;if (whereObj ! ) {for (let index in whereObj) {if (typeof whereObj[index] number) {ps.input(index, mssql.Int);sql index whereObj[index] and ;} else if (typeof whereObj[index] string) {ps.input(index, mssql.NVarChar);sql index whereObj[index] and ;}}}sql sql.substring(0, sql.length - 5);ps.prepare(sql, function (err) {if (err)console.log(err);ps.execute(updateObj, function (err, recordset) {callBack(err, recordset);ps.unprepare(function (err) {if (err)console.log(err);});});});} catch (e) {console.log(e)} };/*** 删除指定表字段* param whereSql 要删除字段的条件语句例where id id* param params 参数用来解释sql中的*例如 { id: id }* param tableName 数据库表名* param callBack 回调函数*/ let del async function (whereSql, params, tableName, callBack) {try {let ps new mssql.PreparedStatement(await poolConnect);let sql delete from tableName ;if (params ! ) {for (let index in params) {if (typeof params[index] number) {ps.input(index, mssql.Int);} else if (typeof params[index] string) {ps.input(index, mssql.NVarChar);}}}sql whereSql;ps.prepare(sql, function (err) {if (err)console.log(err);ps.execute(params, function (err, recordset) {callBack(err, recordset);ps.unprepare(function (err) {if (err)console.log(err);});});});} catch (e) {console.log(e)} };exports.config conf; exports.del del; exports.select select; exports.update update; exports.querySql querySql; exports.selectAll selectAll; exports.add add; 4.在api/user.js下写接口代码 //user.js const express require(express); const db require(../mssql.js); const moment require(moment); const router express.Router();/* GET home page. */ router.get(/medicineList, function (req, res, next) {//查询某表下的全部数据db.selectAll(medicineList, function (err, result) {res.send(result.recordset)}); }); router.get(/medicineAssess, function (req, res, next) {db.selectAll(medicineAssess, function (err, result) {res.send(result.recordset)}); }); router.get(/medicineAsk, function (req, res, next) {db.selectAll(medicineAsk, function (err, result) {res.send(result.recordset)}); }); router.get(/diseaseList, function (req, res, next) {db.selectAll(diseaseList, function (err, result) {res.send(result.recordset)}); }); router.get(/diseaseMedicine, function (req, res, next) {db.selectAll(diseaseMedicine, function (err, result) {res.send(result.recordset)}); }); router.get(/user, function (req, res, next) {db.selectAll(user, function (err, result) {res.send(result.recordset)}); }); router.get(/admin, function (req, res, next) {db.selectAll(admin, function (err, result) {res.send(result.recordset)}); }); router.post(/delete, function (req, res, next) {//删除一条id对应的userInfo表的数据const { UserId } req.bodyconst id UserIddb.del(where id id, { id: id }, userInfo, function (err, result) {console.log(result, 66);res.send(ok)}); }); router.post(/update/:id, function (req, res, next) {//更新一条对应id的userInfo表的数据var id req.params.id;var content req.body.content;db.update({ content: content }, { id: id }, userInfo, function (err, result) {res.redirect(back);}); });module.exports router; 5.在server.js中配置启动文件 //1.导入模块 const express require(express)//2.创建服务器 let server express() server.use(express.urlencoded()) //中间件要写在启动文件里面const cors require(cors) server.use(cors())const user require(./api/user.js)server.use(/, user)//3.开启服务器 server.listen(8002, () {console.log(服务器已启动,在端口号8002) }) 6.启动服务器 cmd到server.js所在的目录下输入 nodemon server.js 7.用postman测试接口

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/bicheng/88439.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

网站建设技术员保密协议甘肃网站建设方案服务至上

聚沙成塔每天进步一点点 ⭐ 专栏简介⭐IIFE 的基本语法⭐IIFE 的主要作用⭐如何使用 IIFE 来创建私有变量和模块封装⭐ 写在最后 ⭐ 专栏简介 前端入门之旅:探索Web开发的奇妙世界 记得点击上方或者右侧链接订阅本专栏哦 几何带你启航前端之旅 欢迎来到前端入门之旅…

宿州城乡建设局网站律师网站建设建议

文章目录 前言一、pandas是什么?二、使用步骤 1.引入库2.读入数据总结 前言 MPLS 基于标签转发表进行转发,与路由表类似,标签转发表有两种获取渠道:一是手动配置(类似静态路由),二是通过协议自动学习(类似OSPF)。手动配…

做普工招聘网站阿里云9元做网站

静态长效代理IP和动态短效代理IP是两种常见的代理IP类型,它们在用途和适用场景上存在一定的差异。了解它们的特性以及使用场景有助于我们更好地利用代理IP,提高网络访问的效率和安全性。 一、静态长效代理IP 1. 用途 静态长效代理IP是指长期保持稳定的代…

网站开发工程师待遇淄博网站建设的专业术语

ChatGPT 在论文写作与编程方面也具备强大的能力。无论是进行代码生成、错误调试还是解决编程难题,ChatGPT都能为您提供实用且高质量的建议和指导,提高编程效率和准确性。此外,ChatGPT是一位出色的合作伙伴,可以为您提供论文写作的…

网站怎么做微信支付宝支付汽车业务网站开发公司

UTF-8编码:打破字符编码的国界 大家好,我是免费搭建查券返利机器人赚佣金就用微赚淘客系统3.0的小编,也是冬天不穿秋裤,天冷也要风度的程序猿!今天,让我们一同探讨编程世界中一项至关重要的技术——“UTF-…

动易网站模板免费做网站用什么写

来源:《2020 自动驾驶技术报告》进入 2020 年,自动驾驶技术的跨越式路线与渐进式路线之间的阵营划分已经十分明显。但最终自动驾驶要完全实现无人化,其技术还需要进行不断的迭代和发展。对于自动驾驶的技术进展,WEVOLVER 发布的《…

合肥外贸网站建设公司做ppt会去什么网站找图

首先,常量是一个字段,所以需要从字段中获取该值。 但是需要传入的BindingFlags是什么,与其盲猜,不如直接反射所有字段值,查看其中的常量有哪些特性和bool值来判断。 ...static void Main(string[] args){var type typ…

便宜网站建设成都谷歌网站推广费用

文章目录 1.项目内创建函数块(FB)2.项目内创建数据块(DB)2.1去除优化块访问2.2去除优化块的访问后对数据块进行编译 3.在函数块(FB)内实现正转反转的自锁与互锁3.1在函数块内实现电机正反转的梯形图 4.主函…

江门网站制作报价软件开发包括什么内容

来源 : 超级数学建模著名数学家丘成桐先生发表了题为“几何:从黎曼、爱因斯坦到弦论”的演讲,追溯了为广义相对论发展奠定基础的的黎曼几何,回顾了影响广义相对论发展的物理学突破,并谈及量子力学和引力理论相结合、引…

python做网站用什么长春建站网站建设

【7.1】目录与路径 【7.1.2】目录相关操作1)特殊目录列表:(1)2)目录操作命令,底下我们就来谈一谈几个常见的处理目录的命令吧:cd:变换目录pwd:显示目前的目录mkdir:创建一个新的目录…

网站首页自动下拉广告淄博网站制作设计公司

Pdoc:生成优雅Python API文档的工具 在开发Python项目时,文档是至关重要的。它不仅提供了对代码功能和用法的了解,还为其他开发人员提供了参考和使用的便利。Pdoc是一个流行的文档生成工具,专为生成Python API文档而设计。本文将介…

营销网站规划的要点包括( )织梦网站程序模板

订单履约系统的概念模型 订单:客户提交购物请求后,生成的买卖合同,通常包含客户信息、下单日期、所购买的商品或服务明细、价格、数量、收货地址以及支付方式等详细信息。 子订单:为了更高效地进行履约,大订单可能会被…

新农村建设管理网站株洲荷塘区

#204. 鸡兔同笼[2] 题目描述 一个笼子里面关了鸡和兔子(鸡有 2 只脚,兔子有 4 只脚,没有例外)。 已经知道了笼子里面脚的总数 a,问笼子里面至少有多少只动物,至多有多少只动物。 输入格式 一行&#x…

版面设计网站有哪些wordpress改造seo

个人简介:Java领域新星创作者;阿里云技术博主、星级博主、专家博主;正在Java学习的路上摸爬滚打,记录学习的过程~ 个人主页:.29.的博客 学习社区:进去逛一逛~ InnoDB存储引擎 ⑩⑧【MySQL】详解InnoDB存储引…

90设计网站官网首页国内最好的编程培训学校

GC机制 GC机制又称垃圾回收机制,是Python解释器自带一种机,专门用来回收不可用的变量值所占用的内存空间 有三个核心,分别是引用计数、标记清除和分代回收 引用计数:一个变量值如果有一个变量名指向,那么在它身上就计…

乐都企业网站建设哪家好asp300源码

1、问题: Docker自启:http://t.csdn.cn/L2v55 重新启动虚拟机,Docker自动启动之后,发现MySQL、Redis都没有启动。 docker ps 没查到有启动的容器。 docker ps -a 查看所有的容器。 2、先使用 su root 命令,切换到root…

海淀网站建设wzjs51爱你社区

目录 前言 说明 依赖注入的类型 2.1 基于构造器的依赖注入 2.2 基于 Setter 的依赖注入 2.3 基于属性的依赖注入 基于字段的依赖注入缺陷 3.1 不允许声明不可变域 3.2 容易违反单一职责设计原则 3.3 与依赖注入容器紧密耦合 3.4 隐藏依赖关系 总结 参考文档 前言 …

网站手机版下悬浮条怎么做青岛微信网站制作

文章目录 IntroductionMethodControlNetControlNet for Text-to-Image DiffusionTrainingInference Experiments消融实验定量分析 在作者 github 上的一些讨论消融实验更进一步的探索Precomputed ControlNet 加快模型推理迁移控制能力到其他 SD1.X 模型上其他 Introduction 提…

怎么在华为防火墙做网站映射深圳住房建设部网站

查看帮助命令 kubectl --help 具体查看某个操作 kubectl get --help

常州建设工程交易网站wordpress新建文章模型

撰稿|行星 来源|贝多财经 9月5日,乐舱物流股份有限公司(下称“乐舱物流”)通过港交所上市聆讯,并披露了通过港交所聆讯后的资料集(即招股书),中信证券和农银国际为其联席保荐人。 成立于2004…