fix: 修复bug
parent
d75d571637
commit
d194009324
|
@ -174,27 +174,30 @@
|
|||
// #endif
|
||||
},
|
||||
computed: mapGetters(['tenantId']),
|
||||
async mounted() {
|
||||
this.isQRCode()
|
||||
if (this.$store.getters.isLogin && !this.$Cache.get('USER_INFO')) {
|
||||
await this.$store.dispatch('USERINFO');
|
||||
}
|
||||
if (!this.$Cache.get('TENANT_ID') || this.$route.query.tenantId) {
|
||||
this.getTenantId()
|
||||
} else {
|
||||
this.getTenantInfo()
|
||||
}
|
||||
if (!this.$Cache.get('OPEN_ID') && this.$route.query.code) {
|
||||
this.getWxChatCode()
|
||||
}
|
||||
this.setSpreadId()
|
||||
setInterval(() => {
|
||||
if (this.$store.getters.isLogin) {
|
||||
this.setRefreshToken()
|
||||
}
|
||||
}, 60000)
|
||||
mounted() {
|
||||
this.initLoad()
|
||||
},
|
||||
methods: {
|
||||
async initLoad(){
|
||||
this.isQRCode()
|
||||
this.setSpreadId()
|
||||
if (this.$store.getters.isLogin && !this.$Cache.get('USER_INFO')) {
|
||||
await this.$store.dispatch('USERINFO');
|
||||
}
|
||||
if (!this.$Cache.get('TENANT_ID') || this.$route.query.tenantId) {
|
||||
this.getTenantId()
|
||||
} else {
|
||||
this.getTenantInfo()
|
||||
}
|
||||
if (!this.$Cache.get('OPEN_ID') && this.$route.query.code) {
|
||||
this.getWxChatCode()
|
||||
}
|
||||
setInterval(() => {
|
||||
if (this.$store.getters.isLogin) {
|
||||
this.setRefreshToken()
|
||||
}
|
||||
}, 60000)
|
||||
},
|
||||
// 是否扫码跳转
|
||||
isQRCode() {
|
||||
const redirectUrl = this.$route.query.redirectUrl || ''
|
||||
|
@ -226,6 +229,7 @@
|
|||
// 获取推广员ID
|
||||
setSpreadId() {
|
||||
const spreadId = this.$route.query.spreadId || ''
|
||||
console.log('spreadId', spreadId)
|
||||
if (spreadId) {
|
||||
this.$store.commit("SET_SPREADID", spreadId);
|
||||
}
|
||||
|
|
|
@ -8,6 +8,8 @@ module.exports = {
|
|||
TENANT_ID: 'TENANT_ID',
|
||||
// 微信openId
|
||||
OPEN_ID: 'OPEN_ID',
|
||||
// 推广员ID
|
||||
SPREAD_ID: 'SPREAD_ID',
|
||||
//用户信息
|
||||
USER_INFO: 'USER_INFO',
|
||||
//租户信息
|
||||
|
|
|
@ -61,7 +61,7 @@
|
|||
realName: '',
|
||||
mobile: '',
|
||||
code: '',
|
||||
spreadId: ''
|
||||
promoterId: ''
|
||||
}
|
||||
}
|
||||
},
|
||||
|
@ -69,7 +69,7 @@
|
|||
async onRegister() {
|
||||
this.loading = true
|
||||
try {
|
||||
this.registerForm.spreadId = store.state.app.spreadId || ''
|
||||
this.registerForm.promoterId = store.state.app.spreadId || ''
|
||||
const res = await register(this.registerForm)
|
||||
this.$util.Tips({
|
||||
title: res.code === 0 ? '注册成功' : res.msg
|
||||
|
|
|
@ -59,10 +59,7 @@
|
|||
</view>
|
||||
</view>
|
||||
<button class='modifyBnt bg-color' formType="submit">保存修改</button>
|
||||
<!-- #ifdef H5 -->
|
||||
<view class="logOut cart-color acea-row row-center-wrapper" @click="outLogin"
|
||||
v-if="!this.$wechat.isWeixin()">退出登录</view>
|
||||
<!-- #endif -->
|
||||
<view class="logOut cart-color acea-row row-center-wrapper" @click="outLogin">退出登录</view>
|
||||
</view>
|
||||
</form>
|
||||
<!-- #ifdef MP -->
|
||||
|
|
|
@ -203,8 +203,10 @@
|
|||
let that = this;
|
||||
let href = '';
|
||||
// href = window.location.href.split('/pages')[0];
|
||||
console.log('uid', that.uid)
|
||||
const baseUrl = 'http://yuxy.perrymake.com';
|
||||
const url =`${baseUrl}/pages/index/index?redirectUrl=${baseUrl}&tenantId=${that.tenantId}&spreadId=${that.uid}`
|
||||
console.log('url', url)
|
||||
uQRCode.make({
|
||||
canvasId: 'qrcode',
|
||||
// text: href + '/pages/index/index?spreadId=' + that.uid,
|
||||
|
@ -212,7 +214,6 @@
|
|||
size: this.qrcodeSize,
|
||||
margin: 10,
|
||||
success: res => {
|
||||
console.log('res', res)
|
||||
that.PromotionCode = res;
|
||||
setTimeout(() => {
|
||||
that.PosterCanvas(this.base64List[0], that.PromotionCode, that.userInfo
|
||||
|
|
|
@ -7,6 +7,7 @@ import {
|
|||
UID,
|
||||
TENANT_ID,
|
||||
OPEN_ID,
|
||||
SPREAD_ID,
|
||||
PLATFORM
|
||||
} from '../../config/cache';
|
||||
import Cache from '../../utils/cache';
|
||||
|
@ -23,7 +24,7 @@ const state = {
|
|||
tenantInfo: Cache.get(TENANT_INFO)?JSON.parse(Cache.get(TENANT_INFO)):null,
|
||||
uid: Cache.get(UID) || null,
|
||||
tenantId: Cache.get(TENANT_ID) || '',
|
||||
spreadId: '',
|
||||
spreadId: Cache.get(SPREAD_ID) || '',
|
||||
openId: Cache.get(OPEN_ID) || '',
|
||||
homeActive: false,
|
||||
chatUrl: Cache.get('chatUrl') || '',
|
||||
|
@ -52,6 +53,7 @@ const mutations = {
|
|||
},
|
||||
SET_SPREADID(state, val){
|
||||
state.spreadId = val;
|
||||
Cache.set(SPREAD_ID, val);
|
||||
},
|
||||
SET_OPENID(state, val){
|
||||
state.openId = val;
|
||||
|
|
Loading…
Reference in New Issue