search
HomeWeChat AppletWeChat DevelopmentDetailed introduction to WeChat authorization for WeChat development

This article mainly introduces the relevant information about the detailed introduction of WeChat authorization for WeChat development. Friends who need it can refer to it

I recently had the opportunity to do a WeChat project; I compiled the notes myself Share it with everyone, please correct me if there are any shortcomings or errors!

1The flow chart for WeChat authorization is as follows

Detailed introduction to WeChat authorization for WeChat development

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";//活动图片
}


Use of local storage:


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

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


1. When doing WeChat development, 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 each adjustment is completed , needs to be published to the service, otherwise it will have no effect. . . This lz was very hurt at the beginning. If it is something that is online, everyone knows it. You'd better agree with the customer and adjust it tonight

Thanks for reading, I hope it can help everyone, thank you everyone Support this site!

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

Statement
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

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

WebStorm Mac version

WebStorm Mac version

Useful JavaScript development tools