<section id="nice" data-tool="mdnice编辑器" data-website="https://www.mdnice.com" style="font-size: 16px; color: black; padding: 0 10px; line-height: 1.6; word-spacing: 0px; letter-spacing: 0px; word-break: break-word; word-wrap: break-word; text-align: left; font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, 'PingFang SC', Cambria, Cochin, Georgia, Times, 'Times New Roman', serif;"><blockquote data-tool="mdnice编辑器" style="display: block; font-size: 0.9em; overflow: auto; overflow-scrolling: touch; border-left: 3px solid rgba(0, 0, 0, 0.4); color: #6a737d; padding-top: 10px; padding-bottom: 10px; padding-left: 20px; padding-right: 10px; margin-bottom: 20px; margin-top: 20px; border-left-color: #ffb11b; background: #fff5e3;"> <p style="font-size: 16px; padding-top: 8px; padding-bottom: 8px; padding: 0; margin: 0px; line-height: 26px; color: #595959;">本项目中的第三方库作者不再维护,fork后自己进行的维护,如有侵权立刻删除!</p> </blockquote> <p data-tool="mdnice编辑器" style="font-size: 16px; padding-top: 8px; padding-bottom: 8px; margin: 0 0 20px; padding: 0; line-height: 1.8em; color: #3a3a3a;">憨憨本憨,快速开源项目,占山为王。<br> 如何做一个优秀的开源贡献者,只需要四步。</p> <h2 data-tool="mdnice编辑器" style="padding: 0px; font-weight: bold; color: black; font-size: 22px; line-height: 1.5em; margin-top: 2.2em; margin-bottom: 35px;"><span class="prefix" style="display: none;"></span><span class="content" style="display: inline-block; font-weight: bold; background: linear-gradient(#fff 60%, #ffb11b 40%); color: #515151; padding: 2px 13px 2px; margin-right: 3px; height: 50%;">第一步 clone 一个 微信小程序请求库</span><span class="suffix"></span></h2> <p data-tool="mdnice编辑器" style="font-size: 16px; padding-top: 8px; padding-bottom: 8px; margin: 0 0 20px; padding: 0; line-height: 1.8em; color: #3a3a3a;"><a href="https://github.com/notbucai/wechat-request" style="word-wrap: break-word; font-weight: bold; border-bottom: 1px solid #1e6bb8; border: none; text-decoration: none; color: #dda52d;">wechat-request</a></p> <pre class="custom" data-tool="mdnice编辑器" style="margin-top: 10px; margin-bottom: 10px; border-radius: 5px; box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;"><span style="display: block; background: url(https://imgkr.cn-bj.ufileos.com/97e4eed2-a992-4976-acf0-ccb6fb34d308.png); height: 30px; width: 100%; background-size: 40px; background-repeat: no-repeat; background-color: #272822; margin-bottom: -7px; border-radius: 5px; background-position: 10px 10px;"></span><code class="hljs" style="overflow-x: auto; padding: 16px; color: #ddd; display: block; font-family: Operator Mono, Consolas, Monaco, Menlo, monospace; font-size: 12px; -webkit-overflow-scrolling: touch; padding-top: 15px; background: #272822; border-radius: 5px;"><span class="hljs-meta" style="color: #75715e; line-height: 26px;">$</span><span class="bash" style="line-height: 26px;"> git <span class="hljs-built_in" style="color: #a6e22e; line-height: 26px;">clone</span> git@github.com:notbucai/wechat-request.git</span> <span/></code></pre> <h2 data-tool="mdnice编辑器" style="padding: 0px; font-weight: bold; color: black; font-size: 22px; line-height: 1.5em; margin-top: 2.2em; margin-bottom: 35px;"><span class="prefix" style="display: none;"></span><span class="content" style="display: inline-block; font-weight: bold; background: linear-gradient(#fff 60%, #ffb11b 40%); color: #515151; padding: 2px 13px 2px; margin-right: 3px; height: 50%;">第二步 改变主要代码</span><span class="suffix"></span></h2> <p data-tool="mdnice编辑器" style="font-size: 16px; padding-top: 8px; padding-bottom: 8px; margin: 0 0 20px; padding: 0; line-height: 1.8em; color: #3a3a3a;">将<code style="font-size: 14px; word-wrap: break-word; border-radius: 4px; font-family: Operator Mono, Consolas, Monaco, Menlo, monospace; word-break: break-all; color: #9b6e23; background-color: #fff5e3; padding: 3px; margin: 3px;">wx.request</code>改成<code style="font-size: 14px; word-wrap: break-word; border-radius: 4px; font-family: Operator Mono, Consolas, Monaco, Menlo, monospace; word-break: break-all; color: #9b6e23; background-color: #fff5e3; padding: 3px; margin: 3px;">Taro.request</code>;</p> <blockquote data-tool="mdnice编辑器" style="display: block; font-size: 0.9em; overflow: auto; overflow-scrolling: touch; border-left: 3px solid rgba(0, 0, 0, 0.4); color: #6a737d; padding-top: 10px; padding-bottom: 10px; padding-left: 20px; padding-right: 10px; margin-bottom: 20px; margin-top: 20px; border-left-color: #ffb11b; background: #fff5e3;"> <p style="font-size: 16px; padding-top: 8px; padding-bottom: 8px; padding: 0; margin: 0px; line-height: 26px; color: #595959;">dispatchRequest.js -> 34行左右</p> </blockquote> <figure data-tool="mdnice编辑器" style="margin: 0; margin-top: 10px; margin-bottom: 10px; display: flex; flex-direction: column; justify-content: center; align-items: center;"><img src="https://user-gold-cdn.xitu.io/2020/7/17/1735bdf87e595143?w=2048&h=1536&f=png&s=461422" alt style="margin: 0 auto; max-width: 100%; width: 100%; border-radius: 5px; display: block; margin-bottom: 15px; height: auto;"></figure> <h2 data-tool="mdnice编辑器" style="padding: 0px; font-weight: bold; color: black; font-size: 22px; line-height: 1.5em; margin-top: 2.2em; margin-bottom: 35px;"><span class="prefix" style="display: none;"></span><span class="content" style="display: inline-block; font-weight: bold; background: linear-gradient(#fff 60%, #ffb11b 40%); color: #515151; padding: 2px 13px 2px; margin-right: 3px; height: 50%;">第三步 改package.json</span><span class="suffix"></span></h2> <p data-tool="mdnice编辑器" style="font-size: 16px; padding-top: 8px; padding-bottom: 8px; margin: 0 0 20px; padding: 0; line-height: 1.8em; color: #3a3a3a;">改个名字 改个版本 <img src="https://user-gold-cdn.xitu.io/2020/7/17/1735be04ca370ce9?w=1300&h=916&f=png&s=130608" alt style="margin: 0 auto; max-width: 100%; width: 100%; border-radius: 5px; display: block; margin-bottom: 15px; height: auto;"></p> <h2 data-tool="mdnice编辑器" style="padding: 0px; font-weight: bold; color: black; font-size: 22px; line-height: 1.5em; margin-top: 2.2em; margin-bottom: 35px;"><span class="prefix" style="display: none;"></span><span class="content" style="display: inline-block; font-weight: bold; background: linear-gradient(#fff 60%, #ffb11b 40%); color: #515151; padding: 2px 13px 2px; margin-right: 3px; height: 50%;">第四步 发布包</span><span class="suffix"></span></h2> <pre class="custom" data-tool="mdnice编辑器" style="margin-top: 10px; margin-bottom: 10px; border-radius: 5px; box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;"><span style="display: block; background: url(https://imgkr.cn-bj.ufileos.com/97e4eed2-a992-4976-acf0-ccb6fb34d308.png); height: 30px; width: 100%; background-size: 40px; background-repeat: no-repeat; background-color: #272822; margin-bottom: -7px; border-radius: 5px; background-position: 10px 10px;"></span><code class="hljs" style="overflow-x: auto; padding: 16px; color: #ddd; display: block; font-family: Operator Mono, Consolas, Monaco, Menlo, monospace; font-size: 12px; -webkit-overflow-scrolling: touch; padding-top: 15px; background: #272822; border-radius: 5px;"><span class="hljs-meta" style="color: #75715e; line-height: 26px;">$</span><span class="bash" style="line-height: 26px;"> npm publish --access=public</span> <span/></code></pre> <h2 data-tool="mdnice编辑器" style="padding: 0px; font-weight: bold; color: black; font-size: 22px; line-height: 1.5em; margin-top: 2.2em; margin-bottom: 35px;"><span class="prefix" style="display: none;"></span><span class="content" style="display: inline-block; font-weight: bold; background: linear-gradient(#fff 60%, #ffb11b 40%); color: #515151; padding: 2px 13px 2px; margin-right: 3px; height: 50%;">项目引入</span><span class="suffix"></span></h2> <pre class="custom" data-tool="mdnice编辑器" style="margin-top: 10px; margin-bottom: 10px; border-radius: 5px; box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;"><span style="display: block; background: url(https://imgkr.cn-bj.ufileos.com/97e4eed2-a992-4976-acf0-ccb6fb34d308.png); height: 30px; width: 100%; background-size: 40px; background-repeat: no-repeat; background-color: #272822; margin-bottom: -7px; border-radius: 5px; background-position: 10px 10px;"></span><code class="hljs" style="overflow-x: auto; padding: 16px; color: #ddd; display: block; font-family: Operator Mono, Consolas, Monaco, Menlo, monospace; font-size: 12px; -webkit-overflow-scrolling: touch; padding-top: 15px; background: #272822; border-radius: 5px;"><span class="hljs-meta" style="color: #75715e; line-height: 26px;">$</span><span class="bash" style="line-height: 26px;"> npm install @bucai/taro-request</span> <span/></code></pre> <h2 data-tool="mdnice编辑器" style="padding: 0px; font-weight: bold; color: black; font-size: 22px; line-height: 1.5em; margin-top: 2.2em; margin-bottom: 35px;"><span class="prefix" style="display: none;"></span><span class="content" style="display: inline-block; font-weight: bold; background: linear-gradient(#fff 60%, #ffb11b 40%); color: #515151; padding: 2px 13px 2px; margin-right: 3px; height: 50%;">END</span><span class="suffix"></span></h2> <p data-tool="mdnice编辑器" style="font-size: 16px; padding-top: 8px; padding-bottom: 8px; margin: 0 0 20px; padding: 0; line-height: 1.8em; color: #3a3a3a;"><a href="https://github.com/notbucai/wechat-request" style="word-wrap: break-word; font-weight: bold; border-bottom: 1px solid #1e6bb8; border: none; text-decoration: none; color: #dda52d;">wechat-request</a></p> <p data-tool="mdnice编辑器" style="font-size: 16px; padding-top: 8px; padding-bottom: 8px; margin: 0 0 20px; padding: 0; line-height: 1.8em; color: #3a3a3a;"><a href="https://github.com/notbucai" style="word-wrap: break-word; font-weight: bold; border-bottom: 1px solid #1e6bb8; border: none; text-decoration: none; color: #dda52d;">GitHub</a></p> <p data-tool="mdnice编辑器" style="font-size: 16px; padding-top: 8px; padding-bottom: 8px; margin: 0 0 20px; padding: 0; line-height: 1.8em; color: #3a3a3a;"><a href="https://notbucai.com/" style="word-wrap: break-word; font-weight: bold; border-bottom: 1px solid #1e6bb8; border: none; text-decoration: none; color: #dda52d;">blog</a></p> <p id="nice-suffix-juejin-container" class="nice-suffix-juejin-container" data-tool="mdnice编辑器" style="font-size: 16px; padding-top: 8px; padding-bottom: 8px; margin: 0 0 20px; padding: 0; line-height: 1.8em; color: #3a3a3a; margin-top: 20px !important;">本文使用 <a href="https://mdnice.com/?from=juejin" style="word-wrap: break-word; font-weight: bold; border-bottom: 1px solid #1e6bb8; border: none; text-decoration: none; color: #dda52d;">mdnice</a> 排版</p></section>