WeChat Development-WeChat Authorization Issues
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!
1The 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";//活动图片 }
Use of local storage:
/* *注明:由于本地存储的东西,一般是可以看到的,所有有一种说法:如果是重*要的数据建议不使用这种方式。 */ //本地存储的运用 -存值 openId = localStorage.getItem("openId"); accesstoken = localStorage.getItem("accesstoken"); //本地存储的运用 -取值 openId = localStorage.getItem("openId"); accesstoken = localStorage.getItem("accesstoken");
1. For WeChat development, it is recommended to create some data first. 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. . . 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 WeChat Development-WeChat Authorization Issues. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

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

Hot Article

Hot Tools

Atom editor mac version download
The most popular open source editor

SecLists
SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

Dreamweaver CS6
Visual web development tools

SublimeText3 Chinese version
Chinese version, very easy to use

DVWA
Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software
