|
@@ -0,0 +1,215 @@
|
|
|
|
+`
|
|
|
|
+<!DOCTYPE html>
|
|
|
|
+<html>
|
|
|
|
+ <head>
|
|
|
|
+ <meta charset="utf-8">
|
|
|
|
+ <meta name="viewport"
|
|
|
|
+ content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no, minimal-ui">
|
|
|
|
+ <meta name="screen-orientation" content="portrait" />
|
|
|
|
+ <meta name="apple-mobile-web-app-capable" content="yes">
|
|
|
|
+ <meta name="format-detection" content="telephone=no">
|
|
|
|
+ <meta name="full-screen" content="yes">
|
|
|
|
+ <meta name="x5-fullscreen" content="true">
|
|
|
|
+ <script src="./js/jweixin-1.0.0.js"></script>
|
|
|
|
+ <script src="./js/axios.min.js"></script>
|
|
|
|
+ <title>正在授权请稍后</title>
|
|
|
|
+ <style type="text/css">
|
|
|
|
+ html,
|
|
|
|
+ body {
|
|
|
|
+ height: 100%;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ html {
|
|
|
|
+ font-size: calc(100vw/7.5);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .object {
|
|
|
|
+ -moz-border-radius: 50% 50% 50% 50%;
|
|
|
|
+ -webkit-border-radius: 50% 50% 50% 50%;
|
|
|
|
+ border-radius: 50% 50% 50% 50%;
|
|
|
|
+ position: absolute;
|
|
|
|
+ border-left: 0.05rem solid #fff;
|
|
|
|
+ border-right: 0.05rem solid #fff;
|
|
|
|
+ border-top: 0.05rem solid transparent;
|
|
|
|
+ border-bottom: 0.05rem solid transparent;
|
|
|
|
+ -webkit-animation: animate 2s infinite;
|
|
|
|
+ animation: animate 2s infinite;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ #object_one {
|
|
|
|
+ left: 1.25rem;
|
|
|
|
+ top: 0.65rem;
|
|
|
|
+ width: 0.5rem;
|
|
|
|
+ height: 0.5rem;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ #object_two {
|
|
|
|
+ left: 1.15rem;
|
|
|
|
+ top: 0.55rem;
|
|
|
|
+ width: 0.7rem;
|
|
|
|
+ height: 0.7rem;
|
|
|
|
+ -webkit-animation-delay: 0.1s;
|
|
|
|
+ animation-delay: 0.1s;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ #object_three {
|
|
|
|
+ left: 1.05rem;
|
|
|
|
+ top: 0.45rem;
|
|
|
|
+ width: 0.9rem;
|
|
|
|
+ height: 0.9rem;
|
|
|
|
+ -webkit-animation-delay: 0.2s;
|
|
|
|
+ animation-delay: 0.2s;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ #object_four {
|
|
|
|
+ left: 0.95rem;
|
|
|
|
+ top: 0.35rem;
|
|
|
|
+ width: 1.1rem;
|
|
|
|
+ height: 1.1rem;
|
|
|
|
+ -webkit-animation-delay: 0.3s;
|
|
|
|
+ animation-delay: 0.3s;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @-webkit-keyframes animate {
|
|
|
|
+ 50% {
|
|
|
|
+ -ms-transform: rotate(180deg);
|
|
|
|
+ -webkit-transform: rotate(180deg);
|
|
|
|
+ transform: rotate(180deg);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ 100% {
|
|
|
|
+ -ms-transform: rotate(0deg);
|
|
|
|
+ -webkit-transform: rotate(0deg);
|
|
|
|
+ transform: rotate(0deg);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @keyframes animate {
|
|
|
|
+ 50% {
|
|
|
|
+ -ms-transform: rotate(180deg);
|
|
|
|
+ -webkit-transform: rotate(180deg);
|
|
|
|
+ transform: rotate(180deg);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ 100% {
|
|
|
|
+ -ms-transform: rotate(0deg);
|
|
|
|
+ -webkit-transform: rotate(0deg);
|
|
|
|
+ transform: rotate(0deg);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ </style>
|
|
|
|
+ <body>
|
|
|
|
+ <div class="spinner-box" style="z-index: 1000;
|
|
|
|
+ width:100%;
|
|
|
|
+ height: 100%;
|
|
|
|
+ position: absolute;
|
|
|
|
+ top:0;
|
|
|
|
+ left: 0;">
|
|
|
|
+ <div id="loading-center-absolute" style="position: absolute;
|
|
|
|
+ left: 50%;
|
|
|
|
+ top: 40%;
|
|
|
|
+ height: 2.5rem;
|
|
|
|
+ width: 3rem;
|
|
|
|
+ border-radius:0.2rem;
|
|
|
|
+ background:rgba(0,0,0,0.7);
|
|
|
|
+ margin-top: -1rem;
|
|
|
|
+ margin-left: -1.5rem;">
|
|
|
|
+ <div class="object" id="object_four"></div>
|
|
|
|
+ <div class="object" id="object_three"></div>
|
|
|
|
+ <div class="object" id="object_two"></div>
|
|
|
|
+ <div class="object" id="object_one"></div>
|
|
|
|
+ <p style="color:#fff;
|
|
|
|
+ text-align:center;
|
|
|
|
+ font-size:0.35rem;
|
|
|
|
+ font-weight: 700;
|
|
|
|
+ height:1rem;
|
|
|
|
+ line-height:1rem;
|
|
|
|
+ margin-top:1.5rem;">加载中</p>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ <script>
|
|
|
|
+ function getUrlParam(name, explode, url) {
|
|
|
|
+ var param = window.location.search.substr(1);
|
|
|
|
+ if (url) {
|
|
|
|
+ if (explode) {
|
|
|
|
+ param = url.substr(url.indexOf(explode) + 1);
|
|
|
|
+ } else {
|
|
|
|
+ param = url.substr(url.indexOf('?') + 1);
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ if (explode) {
|
|
|
|
+ param = window.location.href.substr(window.location.href.indexOf(explode) + 1);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
|
|
|
|
+ var r = param.match(reg);
|
|
|
|
+ if (r != null) return unescape(r[2]);
|
|
|
|
+ return '';
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (!getUrlParam("code")) {
|
|
|
|
+ // 未携带code时获取agent_id
|
|
|
|
+ let agent_id = getUrlParam("agent_id");
|
|
|
|
+ localStorage.setItem("agent_id", agent_id);
|
|
|
|
+ //获取appId接口
|
|
|
|
+ axios.get("http://zhejiangmiliangxiansheng.zjmlxs.com/wxsite/index/wxConfig", {
|
|
|
|
+ params: {
|
|
|
|
+ 'agent_id': agent_id
|
|
|
|
+ }
|
|
|
|
+ }).then(function(response) {
|
|
|
|
+ if (response.data.code == 1) {
|
|
|
|
+ if (localStorage.getItem("appid") == response.data.data.app_id) {
|
|
|
|
+ if (!localStorage.getItem("openid") || localStorage.getItem("openid") == null || localStorage.getItem(
|
|
|
|
+ "openid") == "undefined") {
|
|
|
|
+ // 获取微信code
|
|
|
|
+ window.location.href = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=" + localStorage
|
|
|
|
+ .getItem("appid") + "&redirect_uri=" + location.href +
|
|
|
|
+ "&response_type=code&scope=snsapi_userinfo&state=123#wechat_redirect";
|
|
|
|
+ } else {
|
|
|
|
+ // 定向到项目H5页面
|
|
|
|
+ window.location.href = "http://zhejiangmiliangxiansheng.zjmlxs.com/H5/index.html#/skip?skipType=home";
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ localStorage.setItem("appid", response.data.data.app_id);
|
|
|
|
+ localStorage.removeItem("token");
|
|
|
|
+ localStorage.removeItem("openid");
|
|
|
|
+ // 获取微信code
|
|
|
|
+ window.location.href = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=" + localStorage
|
|
|
|
+ .getItem("appid") + "&redirect_uri=" + location.href +
|
|
|
|
+ "&response_type=code&scope=snsapi_userinfo&state=123#wechat_redirect";
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ alert(response.data.msg)
|
|
|
|
+ }
|
|
|
|
+ }).catch(function(error) {
|
|
|
|
+ alert(error)
|
|
|
|
+ });
|
|
|
|
+ } else {
|
|
|
|
+ // 携带code时必然为微信跳转回来的地址
|
|
|
|
+ let code = getUrlParam("code");
|
|
|
|
+ // 获取openId接口
|
|
|
|
+ axios.get("http://zhejiangmiliangxiansheng.zjmlxs.com/wxsite/index/getWxInfo", {
|
|
|
|
+ params: {
|
|
|
|
+ 'code': code,
|
|
|
|
+ 'agent_id': localStorage.getItem("agent_id")
|
|
|
|
+ }
|
|
|
|
+ }).then(function(response) {
|
|
|
|
+ if (response.data.code == 1) {
|
|
|
|
+ localStorage.setItem("token", response.data.data.token);
|
|
|
|
+ localStorage.setItem("openid", response.data.data.openid);
|
|
|
|
+ //定向到 项目H5页面
|
|
|
|
+ window.location.href = "http://zhejiangmiliangxiansheng.zjmlxs.com/H5/index.html#/skip?skipType=home";
|
|
|
|
+ } else {
|
|
|
|
+ //重新获取微信code
|
|
|
|
+ alert(response.data.msg)
|
|
|
|
+ window.location.href = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=" + localStorage.getItem(
|
|
|
|
+ "appid") + "&redirect_uri=" + location.href +
|
|
|
|
+ "&response_type=code&scope=snsapi_userinfo&state=123#wechat_redirect";
|
|
|
|
+ }
|
|
|
|
+ }).catch(function(error) {
|
|
|
|
+ alert(error)
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ </script>
|
|
|
|
+ </body>
|
|
|
|
+</html>
|