<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Js on Margrop Blog</title>
    <link>https://blog.margrop.net/en/tag/js/</link>
    <description>Recent content in Js on Margrop Blog</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en-US</language>
    <lastBuildDate>Sun, 28 Feb 2021 22:28:36 +0800</lastBuildDate>
    <atom:link href="https://blog.margrop.net/en/tag/js/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Three JavaScript Quirks Java/C Developers Should Know</title>
      <link>https://blog.margrop.net/en/post/three-javascript-quirks-java-c-developers-should-know/</link>
      <pubDate>Sun, 28 Feb 2021 22:28:36 +0800</pubDate>
      <guid>https://blog.margrop.net/en/post/three-javascript-quirks-java-c-developers-should-know/</guid>
      <description>JavaScript can be a deceptive language and can cause a lot of pain because it&amp;rsquo;s not 100% consistent. It is known that it does have some bad, confusing or redundant features: the infamous with statement, 隐式全局变量 and 不稳定的比较 are probably the most famous.&#xA;JavaScript is one of the most successful flame generators in history! Aside from its flaws (which are partially addressed in the new ECMAScript specification), most programmers hate JavaScript for two reasons:</description>
    </item>
    <item>
      <title>Swagger-UI adds project dependencies and modifies index.html</title>
      <link>https://blog.margrop.net/en/post/swagger-ui-add-md5/</link>
      <pubDate>Sat, 06 Feb 2021 09:13:39 +0800</pubDate>
      <guid>https://blog.margrop.net/en/post/swagger-ui-add-md5/</guid>
      <description>swagger-bundle packaging First enter the swagger-ui directory&#xA;npm install npm run build How to modify The url in index.html is modified to:&#xA;and add functions&#xA;url: &amp;#34;/v2/api-docs?group=&amp;#34; + getUrlParam(&amp;#34;group&amp;#34;), function getUrlParam(name) { var reg = new RegExp(&amp;#34;(^|&amp;amp;)&amp;#34; + name + &amp;#34;=([^&amp;amp;]*)(&amp;amp;|$)&amp;#34;); //构造一个含有目标参数的正则表达式对象 var r = window.location.search.substr(1).match(reg); //匹配目标参数 if (r != null) return unescape(r[2]); return &amp;#34;&amp;#34;; //返回参数值 } </description>
    </item>
    <item>
      <title>How to add MD5 verification and project dependencies in Swagger-JS</title>
      <link>https://blog.margrop.net/en/post/swagger-js-add-md5/</link>
      <pubDate>Sat, 06 Feb 2021 09:05:25 +0800</pubDate>
      <guid>https://blog.margrop.net/en/post/swagger-js-add-md5/</guid>
      <description>swagger-bundle packaging First enter the swagger-js directory&#xA;npm install npm run build How to modify Add code to the src/execute.js file:&#xA;Add code before the export function buildRequest({ method class mergeInQueryOrForm(req) statement:&#xA;package.json needs to add support for cross-platform compilation&#xA;import md5 from &amp;#39;md5&amp;#39;; //calcSn for server var req = request console.log(req.body); if (req.body) { let bodyObj = JSON.parse(req.body); bodyObj[&amp;#39;header&amp;#39;][&amp;#39;token&amp;#39;] = req[&amp;#39;headers&amp;#39;][&amp;#39;token&amp;#39;]; bodyObj[&amp;#39;header&amp;#39;][&amp;#39;snTime&amp;#39;] = (new Date()).valueOf(); let allData = Object.assign(JSON.parse(JSON.stringify(bodyObj[&amp;#39;body&amp;#39;])), { token: bodyObj[&amp;#39;header&amp;#39;][&amp;#39;token&amp;#39;], snTime: bodyObj[&amp;#39;header&amp;#39;][&amp;#39;snTime&amp;#39;] }); bodyObj[&amp;#39;header&amp;#39;][&amp;#39;sn&amp;#39;] = calcSn(allData); req.</description>
    </item>
  </channel>
</rss>
