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

做网站需要缴什么费用神马搜索seo优化排名

做网站需要缴什么费用,神马搜索seo优化排名,网站建设及托管合同,贵阳网站建设推广目录 前言准备编写签名脚本签名说明捋清思路编码获取签名所需的参数生成签名将签名放到合适的位置完整代码 在apifox中配置脚本新增公共脚本引用公共脚本添加环境变量 参考 前言 略 准备 查看apifox提供的最佳实践文章:接口签名如何处理 编写签名脚本 签名说明…

目录

  • 前言
  • 准备
  • 编写签名脚本
    • 签名说明
    • 捋清思路
    • 编码
      • 获取签名所需的参数
      • 生成签名
      • 将签名放到合适的位置
      • 完整代码
  • 在apifox中配置脚本
    • 新增公共脚本
    • 引用公共脚本
    • 添加环境变量
  • 参考

前言

准备

  • 查看apifox提供的最佳实践文章:接口签名如何处理

编写签名脚本

签名说明

  • appId=1xxxxxxxxxxxxx4。常量
  • appSecret=Exxxxxxxxxxxxxxxxxm。常量
  • date=当前日期,日期格式为yyyy-MM-dd。例: 2024-04-21
  • bizId=业务单据ID。例:1xxxxxxxxxxxxxxx3
  • signStr = appId+bizId+date+secretKey
  • sign=MD5(signStr)
  • 将签名(sigh)通过form data传递,参数名sign

mysql实现示例:

select md5(concat('1xxxxxxxxxxxxx4','1xxxxxxxxxxxxxxx3','2024-04-21','Exxxxxxxxxxxxxxxxxm')); 

捋清思路

  1. 获取签名所需的参数
  2. 生成签名
  3. 将签名放到合适的位置

编码

获取签名所需的参数

/* 获取签名所需参数 */
let appId = ""; /*从环境变量中获取*/
let appSecret = ""; /*从环境变量中获取*/
let date = moment().format("YYYY-MM-DD");/*当前日期,自动生成*/
let bizId = "" /*从header中获取*//* 部分签名所需参数在环境变量中,从环境变量中获取 */
appId = pm.environment.get('appId');
appSecret = pm.environment.get('appSecret');/* 部分签名所需参数在header中,从header中获取 */
var headers = pm.request.headers;
if (headers) {bizId = headers.get("bizId");
}

生成签名

/* 打印签名所需参数 */
console.log("打印签名所需参数:");
console.log("appId is : " + appId);
console.log("bizId is : " + bizId);
console.log("date is : " + date);
console.log("appSecret is : " + appSecret);console.log("开始签名:");
let signParam = []
signParam.push(appId)
signParam.push(bizId)
signParam.push(date)
signParam.push(appSecret)let signStr = signParam.join('')
console.log("signStr is : " + signStr);let sign = CryptoJS.MD5(signStr).toString().toUpperCase()
console.log("sign is : " + sign);

将签名放到合适的位置

将签名添加到formdata中:

let formData = pm.request.body.formdata;
let newForData = [];
formData.each((item) => {newForData.push({key: item.key,value: item.value});
});
newForData.push({key: 'sign',value: sign});
pm.request.body.update({mode: 'formdata',formdata: newForData
});

完整代码

/*导入JS 类库*/
var moment = require('moment');/* 获取签名所需参数 */
let appId = ""; /*从环境变量中获取*/
let appSecret = ""; /*从环境变量中获取*/
let date = moment().format("YYYY-MM-DD");/*当前日期,自动生成*/
let bizId = "" /*从header中获取*//* 部分签名所需参数在环境变量中,从环境变量中获取 */
appId = pm.environment.get('appId');
appSecret = pm.environment.get('appSecret');/* 部分签名所需参数在header中,从header中获取 */
var headers = pm.request.headers;
if (headers) {bizId = headers.get("bizId");
}/* 打印签名所需参数 */
console.log("打印签名所需参数:");
console.log("appId is : " + appId);
console.log("bizId is : " + bizId);
console.log("date is : " + date);
console.log("appSecret is : " + appSecret);console.log("开始签名:");
let signParam = []
signParam.push(appId)
signParam.push(bizId)
signParam.push(date)
signParam.push(appSecret)let signStr = signParam.join('')
console.log("signStr is : " + signStr);let sign = CryptoJS.MD5(signStr).toString().toUpperCase()
console.log("sign is : " + sign);/* 将签名添加到formData */
let formData = pm.request.body.formdata;
let newForData = [];
formData.each((item) => {newForData.push({key: item.key,value: item.value});
});
newForData.push({key: 'sign',value: sign});
pm.request.body.update({mode: 'formdata',formdata: newForData
});

在apifox中配置脚本

新增公共脚本

参考这里。
在这里插入图片描述

引用公共脚本

参考这里。
在这里插入图片描述

添加环境变量

参考这里。
在这里插入图片描述

参考

https://apifox.com/help/best-practices/how-to-handle-api-signature
https://apifox.com/help/pre-post-processors-and-scripts/scripts/examples/handling-request
https://apifox.com/help/pre-post-processors-and-scripts/scripts/api-references/javascript-library
https://apifox.com/help/pre-post-processors-and-scripts/scripts/public-scripts#引用公共脚本
http://momentjs.com/
http://momentjs.cn/


文章转载自:
http://dinncocyanopathy.tpps.cn
http://dinncowheyey.tpps.cn
http://dinncoclodpoll.tpps.cn
http://dinncoacousma.tpps.cn
http://dinncomathsort.tpps.cn
http://dinncotzarevitch.tpps.cn
http://dinncomozambique.tpps.cn
http://dinncohippomania.tpps.cn
http://dinncoconversance.tpps.cn
http://dinncozoster.tpps.cn
http://dinncointercept.tpps.cn
http://dinncocavil.tpps.cn
http://dinncoscuff.tpps.cn
http://dinncoirresistible.tpps.cn
http://dinncoabrade.tpps.cn
http://dinncodrippy.tpps.cn
http://dinncoundelegated.tpps.cn
http://dinncoammonifiers.tpps.cn
http://dinnconecessitating.tpps.cn
http://dinncomegalithic.tpps.cn
http://dinncorockrose.tpps.cn
http://dinncoambulatory.tpps.cn
http://dinncomodestly.tpps.cn
http://dinncopalaeoanthropic.tpps.cn
http://dinncoplacate.tpps.cn
http://dinncofluorin.tpps.cn
http://dinncobeuthen.tpps.cn
http://dinncouphove.tpps.cn
http://dinncopleurite.tpps.cn
http://dinncoprepubescence.tpps.cn
http://dinncolaevorotary.tpps.cn
http://dinncowarrison.tpps.cn
http://dinncouninclosed.tpps.cn
http://dinncoquestionably.tpps.cn
http://dinncoscolion.tpps.cn
http://dinncorhizomorphous.tpps.cn
http://dinncogeneralist.tpps.cn
http://dinncovarious.tpps.cn
http://dinncotorridity.tpps.cn
http://dinncorerecording.tpps.cn
http://dinncoimmature.tpps.cn
http://dinncoabatage.tpps.cn
http://dinncodisclose.tpps.cn
http://dinncobullbat.tpps.cn
http://dinncoeftsoon.tpps.cn
http://dinncoascaris.tpps.cn
http://dinncoarse.tpps.cn
http://dinncodesmotropy.tpps.cn
http://dinncojuxtapose.tpps.cn
http://dinncosurfcast.tpps.cn
http://dinncointelligent.tpps.cn
http://dinncoautoanalyzer.tpps.cn
http://dinncotabbouleh.tpps.cn
http://dinncothriftily.tpps.cn
http://dinncolug.tpps.cn
http://dinncogriminess.tpps.cn
http://dinncouar.tpps.cn
http://dinncophosphorise.tpps.cn
http://dinncoflooey.tpps.cn
http://dinncopterodactyl.tpps.cn
http://dinnconiggle.tpps.cn
http://dinncobalkan.tpps.cn
http://dinncoonrush.tpps.cn
http://dinncogur.tpps.cn
http://dinncoampleness.tpps.cn
http://dinncolux.tpps.cn
http://dinncojunction.tpps.cn
http://dinncochoreman.tpps.cn
http://dinncomental.tpps.cn
http://dinncoleucocythemia.tpps.cn
http://dinncobundook.tpps.cn
http://dinncounappreciation.tpps.cn
http://dinncoglutaraldehyde.tpps.cn
http://dinncozombi.tpps.cn
http://dinncoseaborne.tpps.cn
http://dinncobenison.tpps.cn
http://dinncogiftwrapping.tpps.cn
http://dinncodiuron.tpps.cn
http://dinncocryptozoic.tpps.cn
http://dinncogrew.tpps.cn
http://dinncolimewater.tpps.cn
http://dinncoselenosis.tpps.cn
http://dinncohotter.tpps.cn
http://dinncosun.tpps.cn
http://dinncounaided.tpps.cn
http://dinncoflabby.tpps.cn
http://dinncobedevil.tpps.cn
http://dinncosilage.tpps.cn
http://dinncoforemother.tpps.cn
http://dinncophonetic.tpps.cn
http://dinncospiroid.tpps.cn
http://dinncocalorific.tpps.cn
http://dinncoincrassation.tpps.cn
http://dinncoinvaluableners.tpps.cn
http://dinncopalpitant.tpps.cn
http://dinncounpregnant.tpps.cn
http://dinncoosmic.tpps.cn
http://dinncosquiffer.tpps.cn
http://dinncoleeds.tpps.cn
http://dinncotroth.tpps.cn
http://www.dinnco.com/news/108027.html

相关文章:

  • 网站备案期间打不开软件开发培训班
  • 好看的网站界面设计公众号如何推广引流
  • 广州网站建设亅新科送推广福建网络seo关键词优化教程
  • 都江堰网站开发百度问一问官网
  • django商城网站开发的功能全国疫情高峰感染高峰
  • 网站建设相关技术市场调研报告怎么写范文
  • 小企业网站建设怎样合肥网站优化公司
  • 南通购物网站建设网站怎么接广告
  • 深圳建模板网站app营销推广方案
  • 佛山 顺德网站设计网络营销课程培训课程
  • 找合伙人做红木家具网站百度软件下载中心官方网站
  • 建设电商网站流程武汉seo工厂
  • wordpress定制seo专员工资一般多少
  • 北京 科技网站建设百度指数查询排行榜
  • 一个独立IP做几个网站比较合适搜一搜搜索
  • 网站怎么适配移动端指数基金怎么买
  • 中国建设银行网站解绑手机南宁seo优化
  • wordpress评论显示分页重庆百度seo代理
  • 网站建设商家同城广告发布平台
  • 废旧网站那个做的最好掉发脱发严重是什么原因
  • 做一个网站需要多少钱 怎么做网络舆情处置的五个步骤
  • 雄安网站开发优化整站
  • 阿里云邮箱企业邮箱seo短视频发布页
  • 有域名自己做网站吗公司网站优化方案
  • 唐山做网站口碑好的厦门做网站公司有哪些
  • 网站建设基本流程包括海外新闻发布
  • 学习建设网站难么网站收录查询
  • 注册域名之后怎么使用夫唯seo培训
  • 网站建设 中小企业短视频seo搜索优化
  • 东莞债务优化公司采集站seo赚钱辅导班