前提:有些需求需要用到微信用户的openID的时候,而又不想用户进行确认授权的时候,就可以进行默认授权
一、微信默认授权
1.1设置网页授权域名--(公众号设置-功能设置-网页授权域名)
1.2.获取APPID和secret
1.3 默认授权页面
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro"
xmlns:th="http://www.thymeleaf.org" lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
</head>
<body>
<script th:inline="javascript">
window.onload = function () {
window.location.href = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=" + [[${appId}]] + "&