jiangping
2024-05-31 bf8d85d5f83c2036fb4239d764d33e99c1b62bd3
h5/App.vue
@@ -1,4 +1,5 @@
<script>
import { wxAuthorize } from '@/api'
export default {
   onLaunch: function () {
      var that = this
@@ -7,15 +8,16 @@
         let code = ''
         if (url.indexOf('code=') !== -1) {
            const query = url.split('?')
            console.log('app-app', url);
            for (const q of query) {
               if (q.indexOf('code=') !== -1) {
                  code = q.substring(q.indexOf('code=') + 5, q.length)
               }
            }
            that.$u.api.wxAuthorize({
            wxAuthorize({
               code: code
            }).then(res => {
               console.log('app_ress', res);
               if (res.code === 200) {
                  that.$store.commit('setOpenId', res.data.openid)
                  if (res.data.member) {