Git Product home page Git Product logo

wx-client's Introduction

wx-client

微信公众号接口wx-api前端项目,包含微信登录、微信分享、CMS文章示例功能

开发环境

  • node.js

启动步骤

  1. 启动wx-api项目,具体流程参考对应项目介绍
  2. 安装依赖
npm install
  1. 修改.env.development开发环境配置文件
  2. 编译构建
# 开发环境
npm run serve

# 生产环境
npm run build
  1. 浏览器打开如下地址:

体验微信分享、微信授权登录等功能

由于微信分享和微信登录功能需在正式域名下使用,有如下两种方式体验

方式一:部署到生产环境再看

生产环境建议打包后将文件部署到nginx,后端请求使用nginx转发功能 nginx.conf配置

location /wx/ { #转发后端接口
    proxy_pass   http://127.0.0.1:8088/wx/;
}

方式二:使用ngrok穿透到内网

然后配置ngrok映射到nginx端口:http://xxx.ngrok.io -> http://localhost:8080

ngrok http  8080

不管哪种方式都需要检查如下配置:

  • 公众号/测试号后台:接口配置是否成功
  • 公众号/测试号后台:JS接口安全域名,只填域名,不要带协议及URL,如:xxx.ngrok.io
  • 公众号/测试号后台:网页授权回调域名,只填域名,不要带协议及URL,如:xxx.ngrok.io

然后可以微信访问开发环境页面或者使用微信开发者工具打开 - 文章(微信分享)示例:http://xxx.ngrok.io/client/article/1 - 微信登录示例:http://xxx.ngrok.io/client/wxLogin

截图

首页 订阅 关注 文章

生产环境如何部署(需先部署wx-api)

  1. 配置wx-client目录下.env.production文件
  2. 编译打包:npm run build
  3. 将打包后的dist目录内文件上传到服务器nginx的资源目录(默认目录名是html)
  4. 修改nginx.conf配置,将/wx/ 请求转发到wx-api生产环境接口地址
  5. 域名映射到nginx所在服务器,前往微信公众号后台配置做开发配置

wx-client's People

Contributors

dependabot[bot] avatar niefy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

wx-client's Issues

用户注册功能

请问一下,这边有提供类似用户注册与绑定功能吗?就是用户关注后,再通过某种操作,可以绑定这个用户到我们自己的业务系统中的某个用户。类似这样的功能。

cookie:appid=问题

c.g.n.c.exception.RRExceptionHandler : Missing cookie 'appid' for method parameter of type String
跨域问题,cookie丢失,手动设置报
w3c规定,当请求的header匹配以下不安全字符时,将被终止
Accept-Charset
Accept-Encoding
Connection
Content-Length
Cookie
Cookie2
Content-Transfer-Encoding
Date
Expect
Host
Keep-Alive
Referer
TE
Trailer
Transfer-Encoding
Upgrade
User-Agent
Via
,所以一直报错:fly.min.js:1 Refused to set unsafe header "Cookie"
wx-client部署问题

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.