Giter VIP home page Giter VIP logo

wx-node-signature's Introduction

最近开始进行微信开发,最为一个前端,在写一个简单的H5页面时,发现分享也要用微信自己的jssdk。对后台并不精通的我只有用nodejs来搭建一个简单的服务器来处理微信的签名。这里名的appId以及secret都是你自己的微信公众平台。我只是搭建了一个简答的demo,让你了解流程,按照微信公众平台的步骤,就可以完成整体的项目构架。

需要注意的地方:

1.在config中输入你自己的appId和appSecret;

2.ajax上传路径 /wxSignature 的时候,需要上传当前的完整地址。之前做测试的时候发现一个坑,如果你把当前浏览路径写死的话,那二次分享会出现问题,在segmentfalut上查找后发现,是每一次路径微信都会自动添加一个后缀的path,每次路径都会发生改变,只是我们不知道而已。

3.通过acao解决了跨域的问题。

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.