Commit 58d817b7 authored by Xuguangxing's avatar Xuguangxing

feat: 修复自由容器金融跳卡包参数携带问题

parent d7b946f8
...@@ -2,8 +2,9 @@ import { Component, Prop, Vue, Mixins } from 'vue-property-decorator'; ...@@ -2,8 +2,9 @@ import { Component, Prop, Vue, Mixins } from 'vue-property-decorator';
import { Action, Mutation, State, Getter } from 'vuex-class'; import { Action, Mutation, State, Getter } from 'vuex-class';
import TransformStyleMixin from '@/page/mixins/transformStyle.mixin'; import TransformStyleMixin from '@/page/mixins/transformStyle.mixin';
import SaMixin from '@/page/mixins/sa.mixin'; import SaMixin from '@/page/mixins/sa.mixin';
import localStorage from '@/service/localStorage.service';
// import { resizeDiv } from '@/service/utils.service'; // import { resizeDiv } from '@/service/utils.service';
import { locationHrefPatchDelay, getTokenFromApp } from '@qg/citrus-ui/src/helper/service/utils'; import { locationHrefPatchDelay, getTokenFromApp, parseSearch } from '@qg/citrus-ui/src/helper/service/utils';
import saTrackMixins from '@qg/citrus-ui/src/helper/mixins/saTrack.mixins'; import saTrackMixins from '@qg/citrus-ui/src/helper/mixins/saTrack.mixins';
@Component({ name: 'FreedomContainer' }) @Component({ name: 'FreedomContainer' })
...@@ -17,13 +18,39 @@ export default class FreedomContainer extends Mixins(TransformStyleMixin, SaMixi ...@@ -17,13 +18,39 @@ export default class FreedomContainer extends Mixins(TransformStyleMixin, SaMixi
@Prop(String) backgroundImage; @Prop(String) backgroundImage;
clickEvent() { clickEvent() {
console.log(this.childItem);
let needLogin = false; let needLogin = false;
try { try {
needLogin = this.childItem.props.needLogin; needLogin = this.childItem.props.needLogin;
} catch (err) { } catch (err) {
console.log(err); console.log(err);
} }
if (this.childItem.props.isFinance) {
let paramsStr = '', url = this.childItem.props.link;
const localStorageParams = [
'token',
'tchannel',
'tenantId',
'appChannel',
'appName'
];
const params = parseSearch(this.childItem.props.link);
localStorageParams.forEach(item => {
let key = item;
if (item == 'token') {
key = 'vccToken';
}
if (item == 'tchannel') {
key = 'vccChannel';
}
const itemVal = localStorage.get(key);
params[item] = itemVal || '';
});
Object.keys(params).forEach(item => {
paramsStr += `&${item}=${params[item]}`;
});
const targetUrl = `${url.split('?')[0]}?${paramsStr.slice(1)}`;
return;
}
if (needLogin) { if (needLogin) {
getTokenFromApp().then(hasLogin => { getTokenFromApp().then(hasLogin => {
if (hasLogin) { if (hasLogin) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment