1 |
- (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["pages-index-wechat"],{"029f":function(e,t,n){"use strict";n.r(t);var a=n("938f"),r=n("51cc");for(var o in r)["default"].indexOf(o)<0&&function(e){n.d(t,e,(function(){return r[e]}))}(o);n("074d");var i=n("f0c5"),c=Object(i["a"])(r["default"],a["b"],a["c"],!1,null,"0c12b65b",null,!1,a["a"],void 0);t["default"]=c.exports},"074d":function(e,t,n){"use strict";var a=n("f160"),r=n.n(a);r.a},"406d":function(e,t,n){"use strict";n("7a82"),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,n("ac1f"),n("5319"),n("4d63"),n("c607"),n("2c3e"),n("25f0"),n("466d");var a=getApp(),r={data:function(){return{state:0}},onLoad:function(e){this.state=this.getUrlCode("state");var t=this.getUrlCode("code");t?this.getOpenidAndUserinfo(t):this.getCode()},methods:{getCode:function(){if(this.isWechat()){var e=this.getUrlCode("code");null!==e&&""!==e||(window.location.href="https://open.weixin.qq.com/connect/oauth2/authorize?appid="+a.globalData.appId+"&redirect_uri="+encodeURIComponent(a.globalData.redirectUri)+"&response_type=code&scope=snsapi_userinfo&state="+this.state+"#wechat_redirect")}},getUrlCode:function(e){return decodeURIComponent((new RegExp("[?|&]"+e+"=([^&;]+?)(&|#|;|$)").exec(location.href)||[,""])[1].replace(/\+/g,"%20"))||null},isWechat:function(){return"micromessenger"===String(navigator.userAgent.toLowerCase().match(/MicroMessenger/i))},getOpenidAndUserinfo:function(e){var t=this;uni.request({url:a.globalData.serverUrl+"Oauth/checkCode",data:{code:e},method:"GET",header:{"content-type":"application/x-www-form-urlencoded"},success:function(e){if(console.log("通过code获取openid和accessToken",e),0==e.data.code){var n=getApp();uni.setStorageSync(n.globalData.storagePre+"token",e.data.data.token),uni.setStorageSync(n.globalData.storagePre+"userId",e.data.data.userId),n.globalData.userinfo.token=e.data.data.token,n.globalData.userinfo.userId=e.data.data.userId,window.location.href=n.globalData.host+"/ph/#/pages/index/index"}else t.msg=e.data.message},fail:function(e){console.log(e),t.msg="登录失败"}})},goBack:function(){uni.reLaunch({url:"/pages/index/wechat"})}}};t.default=r},"51cc":function(e,t,n){"use strict";n.r(t);var a=n("406d"),r=n.n(a);for(var o in a)["default"].indexOf(o)<0&&function(e){n.d(t,e,(function(){return a[e]}))}(o);t["default"]=r.a},"938f":function(e,t,n){"use strict";n.d(t,"b",(function(){return a})),n.d(t,"c",(function(){return r})),n.d(t,"a",(function(){}));var a=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("v-uni-view",[e.msg?n("v-uni-view",{staticClass:"error-box"},[e._v(e._s(e.msg))]):e._e(),e.msg?n("v-uni-view",{staticClass:"order-btn",on:{click:function(t){arguments[0]=t=e.$handleEvent(t),e.goBack.apply(void 0,arguments)}}},[e._v("返回")]):e._e()],1)},r=[]},c08b:function(e,t,n){var a=n("24fb");t=a(!1),t.push([e.i,'@charset "UTF-8";\r\n/**\r\n * 这里是uni-app内置的常用样式变量\r\n *\r\n * uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量\r\n * 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App\r\n *\r\n */\r\n/**\r\n * 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能\r\n *\r\n * 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件\r\n */\r\n/* 颜色变量 */\r\n/* 行为相关颜色 */\r\n/* 文字基本颜色 */\r\n/* 背景颜色 */\r\n/* 边框颜色 */\r\n/* 尺寸变量 */\r\n/* 文字尺寸 */\r\n/* 图片尺寸 */\r\n/* Border Radius */\r\n/* 水平间距 */\r\n/* 垂直间距 */\r\n/* 透明度 */\r\n/* 文章场景相关 */.error-box[data-v-0c12b65b]{font-size:%?40?%;color:#333;text-align:center;margin-top:%?180?%;margin-bottom:%?80?%}.order-btn[data-v-0c12b65b]{width:%?673?%;height:%?72?%;border-radius:%?10?%;color:#fff;background-color:#284a94;line-height:%?72?%;font-size:%?38?%;text-align:center;margin:0 auto;margin-top:%?40?%}',""]),e.exports=t},f160:function(e,t,n){var a=n("c08b");a.__esModule&&(a=a.default),"string"===typeof a&&(a=[[e.i,a,""]]),a.locals&&(e.exports=a.locals);var r=n("4f06").default;r("51386db6",a,!0,{sourceMap:!1,shadowMode:!1})}}]);
|