diff --git a/App.vue b/App.vue index a698ab4..e4bc92c 100644 --- a/App.vue +++ b/App.vue @@ -6,6 +6,9 @@ import { getConfig } from '@/api/app' + import { + sendMsg + } from '@/api/shop' import { strToParams } from '@/utils/tools' @@ -14,6 +17,7 @@ } from '@/api/user' import {INVITE_CODE} from '@/config/cachekey' import Cache from '@/utils/cache' + import { getWxCode } from "@/utils/login"; export default { onLaunch: function(options) { //#ifdef MP-WEIXIN @@ -44,19 +48,21 @@ } this.wxShare() } - }, async bindCode(options) { if(!options.query) return let invite_code = options.query.invite_code || strToParams(decodeURIComponent(options.query.scene)) .invite_code if (invite_code) { + const wxCode = await getWxCode(); const { data, code } = await bindSuperior({ - code: invite_code + code: wxCode, + invite_code }) + if (code == -1) { Cache.set(INVITE_CODE, invite_code) }