|
|
"use strict";const e=require("../../common/vendor.js"),v=require("../../api/index.js");require("../../utils/request.js");const p={__name:"login",setup(_){const o=e.ref(!1),i=e.ref(""),s=e.ref("1213231");e.onLoad(()=>{e.index.getStorageSync("token")&&e.index.reLaunch({url:"/pages/index/index"})}),e.onShow(()=>{u()});const l=()=>{if(!o.value)return e.index.showToast({title:"请勾选协议",icon:"none"})},g=n=>{n.detail.errMsg=="getPhoneNumber:fail user deny"?e.index.showToast({title:"您已取消授权",icon:"none"}):d(n.detail.encryptedData,n.detail.iv)},u=()=>{e.index.login({provider:"weixin",success:function(n){console.log(n),i.value=n.code}})},d=async(n,c)=>{try{let t={code:i.value,encryptedData:n,iv:c,wxCode:s.value};const a=await v.getLogin(t);e.index.setStorageSync("token",a.token),e.index.setStorageSync("userInfo",a),e.index.reLaunch({url:"/pages/index/index"}),console.log("getLogin",a)}catch(t){console.log("getLogin",t)}},r=n=>{e.index.navigateTo({url:`/pages/index/richText?type=${n}`})},x=()=>{o.value=!o.value};return(n,c)=>e.e({a:!o.value},o.value?{c:e.o(g)}:{b:e.o(l)},{d:!o.value},o.value?{}:{},{e:e.o(x),f:e.o(t=>r(4)),g:e.o(t=>r(5))})}},f=e._export_sfc(p,[["__file","D:/vue/大健康商城/healthMall/pages/login/login.vue"]]);wx.createPage(f); |
|
|
"use strict";const e=require("../../common/vendor.js"),v=require("../../api/index.js");require("../../utils/request.js");const p={__name:"login",setup(_){const o=e.ref(!1),i=e.ref(""),s=e.ref("");e.onLoad(()=>{e.index.getStorageSync("token")&&e.index.reLaunch({url:"/pages/index/index"})}),e.onShow(()=>{u()});const l=()=>{if(!o.value)return e.index.showToast({title:"请勾选协议",icon:"none"})},g=n=>{n.detail.errMsg=="getPhoneNumber:fail user deny"?e.index.showToast({title:"您已取消授权",icon:"none"}):d(n.detail.encryptedData,n.detail.iv)},u=()=>{e.index.login({provider:"weixin",success:function(n){console.log(n),i.value=n.code}})},d=async(n,c)=>{try{let t={code:i.value,encryptedData:n,iv:c,wxCode:s.value};const a=await v.getLogin(t);e.index.setStorageSync("token",a.token),e.index.setStorageSync("userInfo",a),e.index.reLaunch({url:"/pages/index/index"}),console.log("getLogin",a)}catch(t){console.log("getLogin",t)}},r=n=>{e.index.navigateTo({url:`/pages/index/richText?type=${n}`})},x=()=>{o.value=!o.value};return(n,c)=>e.e({a:!o.value},o.value?{c:e.o(g)}:{b:e.o(l)},{d:!o.value},o.value?{}:{},{e:e.o(x),f:e.o(t=>r(4)),g:e.o(t=>r(5))})}},f=e._export_sfc(p,[["__file","D:/vue/大健康商城/healthMall/pages/login/login.vue"]]);wx.createPage(f); |
...
|
...
|
|