Detailed explanation of WeChat authorization for WeChat development

怪我咯
Release: 2017-04-08 11:16:16
Original
2069 people have browsed it

This article mainly introduces relevant information on WeChat development and detailed explanation of WeChat authorization. Friends who need it can refer to it

I recently had the opportunity to do a WeChat project; share the notes I compiled with Everyone, please correct me if there are any shortcomings or mistakes!

1 The flow chart for WeChat authorization is as follows

##Some code fragments are for reference only:

var myNickname;
var myHeadimgurl;
var activityId;

function saveData() {
  //$("#pShow").show();
  var obj = {};
  obj.openId = myOpenId;
  obj.nickname = myNickname;// 微信昵称
  obj.headimgurl = myHeadimgurl;// 用户头像
  // obj.activityimg = "xx";//活动图片
}
Copy after login

Use of local storage:

/*
*注明:由于本地存储的东西,一般是可以看到的,所有有一种说法:如果是重*要的数据建议不使用这种方式。
*/
//本地存储的运用 -存值
openId = localStorage.getItem("openId");
accesstoken = localStorage.getItem("accesstoken");

//本地存储的运用 -取值
openId = localStorage.getItem("openId");
accesstoken = localStorage.getItem("accesstoken");
Copy after login

1. When developing WeChat, it is recommended to create some data first and get the corresponding openId to facilitate

debugging in the browser ;

2. The slightly troublesome thing is that every time the adjustment is completed, it needs to be published to the service, otherwise it will have no effect. . .

The above is the detailed content of Detailed explanation of WeChat authorization for WeChat development. For more information, please follow other related articles on the PHP Chinese website!

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!