# 微信公众号 **Repository Path**: sanbo49/mp-vue ## Basic Information - **Project Name**: 微信公众号 - **Description**: 微信公众号项目 - **Primary Language**: JavaScript - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2021-11-19 - **Last Updated**: 2021-11-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # mp-vue > 开发微信公众号

1.https://natapp.cn/ 内外网映射工具,注册,登录一下

2.左侧选择我的隧道点击配置

3.authtoken复制一下

4.本地地址输入当前vue项目运行地址不要加端口号

5.本地端口号写当前项目的运行端口号,点击修改

6.下载客户端,然后在软件安装目录下运行cmd(shift+鼠标右键)然后输入./natapp -authtoken=这里写刚刚复制的authtoken

7.复制映射的网址

8.登录微信工作平台-->设置与开发-->开发者工具-->工作平台测试账号

9.JS接口安全域名修改为映射之后的地址记住只要域名,不要http://

10.下拉页面找到网页服务-->网页账号-->修改也不要http://

11.打开链接(注意,要在已授权该公众号的账号登入微信开发者工具)'https://open.weixin.qq.com/connect/oauth2/authorize?appid=你的公众号appid&redirect_uri=映射的网址&response_type=code&scope=获取用户信息的方式&state=重定向到映射域名之后的所带入的参数#wechat_redirect'

微信官方教程:https://developers.weixin.qq.com/doc/oplatform/Website_App/WeChat_Login/Wechat_Login.html

## 运行方式 ``` bash # install dependencies npm install # serve with hot reload at localhost:8080 npm run dev # build for production with minification npm run build # build for production and view the bundle analyzer report npm run build --report ``` For a detailed explanation on how things work, check out the [guide](http://vuejs-templates.github.io/webpack/) and [docs for vue-loader](http://vuejs.github.io/vue-loader).