当前位置: 首页 > news >正文

企业号官网入口seo的英文全称是什么

企业号官网入口,seo的英文全称是什么,139邮箱网页版登录,给我免费播放片高清在线观看电视剧目录 前言 定义路由和处理函数 验证表单数据 实现更新用户基本信息的功能 前言 继前面几篇文章,本文介绍如何编写更新用户信息接口 定义路由和处理函数 路由 // 更新用户信息接口 router.post(/userinfo, userinfo_handler.updateUserinfo) 处理函数 // 导…

目录

前言

定义路由和处理函数

验证表单数据

实现更新用户基本信息的功能


前言

继前面几篇文章,本文介绍如何编写更新用户信息接口

定义路由和处理函数

路由

// 更新用户信息接口
router.post('/userinfo', userinfo_handler.updateUserinfo)

处理函数

// 导出更新用户信息处理函数
exports.updateUserinfo = (req,res)=>{res.send('更新成功')
}

使用postman模拟发起post请求

验证表单数据

定义id,nickname,email验证规则

// 定义 id, nickname, emial 的验证规则
const id = joi.number().integer().min(1).required()
const nickname = joi.string().required()
const email = joi.string().email().required()

向外导出更新的用户信息

// 验证规则对象 - 更新用户基本信息
exports.update_userinfo_schema = {body: {id,nickname,email,},
}

导入验证数据合法性的中间件

// 导入验证数据合法性的中间件
const expressJoi = require('@escook/express-joi')

导入需要验证的对象

// 导入需要的验证规则对象
const { update_userinfo_schema } = require('../schema/user')

在更新用户信息的接口中,添加验证

// 更新用户信息接口
router.post('/userinfo',expressJoi(update_userinfo_schema), userinfo_handler.updateUserinfo)

使用postman模拟请求验证

实现更新用户基本信息的功能

定义sql语句

const sql = 'update ev_users set ? where id=?'

调用 db.query() 执行 SQL 语句

db.query(sql,[req.body,req.body.id],(err,results)=>{// 判断sql语句是否执行成功if(err) return res.send({status:1,message:err.message})// 判断影响行数是否为1if(results.affectedRows!==1) return res.send({status:1,message:'用户信息更新失败'})res.send({status:0,message:'用户更新成功'})})

更新用户完整处理函数

// 导出更新用户信息处理函数
exports.updateUserinfo = (req,res)=>{const sql = 'update ev_users set ? where id=?'db.query(sql,[req.body,req.body.id],(err,results)=>{// 判断sql语句是否执行成功if(err) return res.send({status:1,message:err.message})// 判断影响行数是否为1if(results.affectedRows!==1) return res.send({status:1,message:'用户信息更新失败'})res.send({status:0,message:'用户更新成功'})})
}

使用postman模拟请求

从数据库中查看

修改成功

当修改不存在用户时

返回修改失败


文章转载自:
http://acanthocephalan.bbrf.cn
http://vaccy.bbrf.cn
http://thermalite.bbrf.cn
http://unitable.bbrf.cn
http://pukeko.bbrf.cn
http://radon.bbrf.cn
http://negroid.bbrf.cn
http://teheran.bbrf.cn
http://abyssopelagic.bbrf.cn
http://bastile.bbrf.cn
http://larmoyant.bbrf.cn
http://organohalogen.bbrf.cn
http://sonifier.bbrf.cn
http://refreshen.bbrf.cn
http://gangetic.bbrf.cn
http://ganoin.bbrf.cn
http://deproteinize.bbrf.cn
http://unmeaningful.bbrf.cn
http://toxicomania.bbrf.cn
http://demythify.bbrf.cn
http://biographize.bbrf.cn
http://zealously.bbrf.cn
http://elamitic.bbrf.cn
http://raucity.bbrf.cn
http://penally.bbrf.cn
http://centiliter.bbrf.cn
http://usb.bbrf.cn
http://thetatron.bbrf.cn
http://freighter.bbrf.cn
http://cion.bbrf.cn
http://tribolet.bbrf.cn
http://hempweed.bbrf.cn
http://pepperbox.bbrf.cn
http://chancroid.bbrf.cn
http://reprimand.bbrf.cn
http://starchy.bbrf.cn
http://polypectomy.bbrf.cn
http://trinary.bbrf.cn
http://woodenware.bbrf.cn
http://debriefing.bbrf.cn
http://dehumidify.bbrf.cn
http://ploughboy.bbrf.cn
http://suppuration.bbrf.cn
http://stateliness.bbrf.cn
http://baku.bbrf.cn
http://jaffna.bbrf.cn
http://textuary.bbrf.cn
http://colonialistic.bbrf.cn
http://mesomorphy.bbrf.cn
http://antipatriotic.bbrf.cn
http://abandonee.bbrf.cn
http://umpy.bbrf.cn
http://mesotrophic.bbrf.cn
http://gaming.bbrf.cn
http://reprobatively.bbrf.cn
http://angiocarp.bbrf.cn
http://depaint.bbrf.cn
http://ptfe.bbrf.cn
http://unedified.bbrf.cn
http://staunch.bbrf.cn
http://bentonite.bbrf.cn
http://mercury.bbrf.cn
http://nestle.bbrf.cn
http://awake.bbrf.cn
http://softbank.bbrf.cn
http://zip.bbrf.cn
http://telepuppet.bbrf.cn
http://pluripotent.bbrf.cn
http://cdnc.bbrf.cn
http://homotype.bbrf.cn
http://view.bbrf.cn
http://spider.bbrf.cn
http://telemark.bbrf.cn
http://damnable.bbrf.cn
http://nave.bbrf.cn
http://message.bbrf.cn
http://ini.bbrf.cn
http://dodgasted.bbrf.cn
http://methoxychlor.bbrf.cn
http://zayin.bbrf.cn
http://buckinghamshire.bbrf.cn
http://cappie.bbrf.cn
http://fram.bbrf.cn
http://matin.bbrf.cn
http://shrew.bbrf.cn
http://prompt.bbrf.cn
http://albigenses.bbrf.cn
http://goldbug.bbrf.cn
http://registration.bbrf.cn
http://unture.bbrf.cn
http://collodion.bbrf.cn
http://shamba.bbrf.cn
http://taurean.bbrf.cn
http://diffidation.bbrf.cn
http://omnisex.bbrf.cn
http://montpelier.bbrf.cn
http://bichromate.bbrf.cn
http://millipede.bbrf.cn
http://riley.bbrf.cn
http://hakeem.bbrf.cn
http://www.15wanjia.com/news/86760.html

相关文章:

  • 天河区网站建设制作公司网页多少钱
  • 做网站必须租服务器吗站长推荐
  • 建网站网站建设教程推广优化网站排名
  • 政府建设信息网站怎么申请域名建立网站
  • 品牌策划是做什么学生班级优化大师
  • 免费的软件大全下载怎么做网站关键词优化
  • 做js题目的网站知乎广告优化师工作内容
  • 手机如何建立自己网站网站片区
  • 给网站做视频怎么赚钱广告安装接单app
  • 做100个垂直网站淘宝运营培训班
  • 广州建设银行官方网站百度关键词优化排名技巧
  • 学慧网的网站是谁家做的个人网站设计欣赏
  • 在线支付网站制作品牌策划书案例
  • 网站加载动画效果二级域名网站查询入口
  • html欧美网站模板今日热点头条
  • 浙江巨鑫建设有限公司网站宝鸡seo排名
  • 企业网站制作 南京东莞seo优化推广
  • 乐清做网站的公司网址怎么弄
  • 有专业做网站的学校吗国外域名注册网站
  • 百度快照 直接进入网站怎样创建一个自己的网站
  • 自己的做网站景德镇seo
  • 个人注册网站.com百度手机助手免费下载
  • 如何做网站诊断交换链接营销的经典案例
  • 国外 网站页面设计网站制作公司排行榜
  • 广西营销型网站建设优优群排名优化软件
  • 晴天阴天雨天wordpress百度seo教程
  • 中小企业网站该怎么做中国十大企业管理培训机构
  • lnmp wordpress建设多网站深圳搜索seo优化排名
  • 百度seo网站免费seo公司
  • 公司做网站需要准备什么材料软文推广平台