公众号绑定

msb_beta
ch 3 years ago
parent 376030a1a6
commit 4a9887eae8

@ -2,7 +2,7 @@
* @Author: ch * @Author: ch
* @Date: 2022-04-28 16:30:54 * @Date: 2022-04-28 16:30:54
* @LastEditors: ch * @LastEditors: ch
* @LastEditTime: 2022-05-06 20:58:31 * @LastEditTime: 2022-05-17 19:49:08
* @Description: file content * @Description: file content
*/ */
@ -25,7 +25,14 @@ export const ApiGetAuthUrl = (params) =>
* @param {*} data * @param {*} data
*/ */
export const ApiGetOpenId = ({code}) => export const ApiGetOpenId = ({code}) =>
ToAsyncAwait(MsbRequest.get(`${AUTH_URL}/wx/mp/getOpenId/${APPID}`, {code})); ToAsyncAwait(MsbRequest.get(`${AUTH_URL}/wx/mp/getOpenId/${APPID}`, { code }));
/**
* 微信OPENID绑定用户
* @param {*} data
*/
export const ApiPostThirdInfo = (data) =>
ToAsyncAwait(MsbRequestTk.post(`${AUTH_URL}/third/saveThirdInfo`, {...data, appid:APPID}));
/** /**
* 微信h5支付获取支付URL * 微信h5支付获取支付URL

@ -2,7 +2,7 @@
* @Author: ch * @Author: ch
* @Date: 2022-03-22 15:36:46 * @Date: 2022-03-22 15:36:46
* @LastEditors: ch * @LastEditors: ch
* @LastEditTime: 2022-05-16 20:33:11 * @LastEditTime: 2022-05-17 19:50:10
* @Description: file content * @Description: file content
--> -->
<template> <template>
@ -33,6 +33,7 @@
<script> <script>
import { IsPhone,MsbWebSkt, MsbWebSktInit, createUUID } from '@/common/utils'; import { IsPhone,MsbWebSkt, MsbWebSktInit, createUUID } from '@/common/utils';
import { ApiGetCode, ApiPostLogin } from '@/common/api/index'; import { ApiGetCode, ApiPostLogin } from '@/common/api/index';
import { ApiPostThirdInfo } from '@/common/api/base';
import UiButton from '../components/UiButton.vue'; import UiButton from '../components/UiButton.vue';
export default { export default {
components: { UiButton }, components: { UiButton },
@ -104,6 +105,14 @@ export default {
} }
this.$store.commit('SET_TOKEN',result.token); this.$store.commit('SET_TOKEN',result.token);
this.$store.commit('SET_USER_INFO',result.user); this.$store.commit('SET_USER_INFO',result.user);
if(store.state.openId){
ApiPostThirdInfo({
appUserId: store.state.openId,
platformType: 1
});
}
MsbWebSktInit().then(()=>{ MsbWebSktInit().then(()=>{
MsbWebSkt.send({ MsbWebSkt.send({
data : JSON.stringify({ data : JSON.stringify({

Loading…
Cancel
Save