Commit 82df6b7c by Sweet Zhang

生成的分享码不一致问题解决

parent ff98b8a6
import {Injectable} from '@angular/core'; import {Injectable} from '@angular/core';
import {DatePipe} from '@angular/common'; import {DatePipe} from '@angular/common';
import {Meta, Title} from '@angular/platform-browser'; import {Meta, Title} from '@angular/platform-browser';
import * as uuid from 'uuid';
@Injectable({ @Injectable({
providedIn: 'root' providedIn: 'root'
}) })
...@@ -48,7 +47,6 @@ export class LifeCommonService { ...@@ -48,7 +47,6 @@ export class LifeCommonService {
*/ */
generateShareCode(jsonParams?: any) { generateShareCode(jsonParams?: any) {
const shareCode = { const shareCode = {
shareCode: uuid.v4(),
shareType: '1', shareType: '1',
os: this.checkOs(), os: this.checkOs(),
channel: '0', channel: '0',
......
...@@ -4,6 +4,7 @@ import {environment} from '../../../environments/environment'; ...@@ -4,6 +4,7 @@ import {environment} from '../../../environments/environment';
import {LifeCommonService} from '../../common/life-common.service'; import {LifeCommonService} from '../../common/life-common.service';
import {MyService} from '../my.service'; import {MyService} from '../my.service';
declare var QRCode: any; declare var QRCode: any;
import * as uuid from 'uuid';
@Component({ @Component({
selector: 'ydlife-mk-material-detail', selector: 'ydlife-mk-material-detail',
templateUrl: './mk-material-detail.component.html', templateUrl: './mk-material-detail.component.html',
...@@ -24,11 +25,13 @@ export class MkMaterialDetailComponent implements OnInit { ...@@ -24,11 +25,13 @@ export class MkMaterialDetailComponent implements OnInit {
this.materialItemId = this.activateRoute.snapshot.paramMap.get('itemId'); this.materialItemId = this.activateRoute.snapshot.paramMap.get('itemId');
this.lifeCustomerInfo = localStorage.getItem('lifeCustomerInfo') ? JSON.parse(localStorage.getItem('lifeCustomerInfo')) : null; this.lifeCustomerInfo = localStorage.getItem('lifeCustomerInfo') ? JSON.parse(localStorage.getItem('lifeCustomerInfo')) : null;
// 分享信息 // 分享信息
const shareCodeUuid = uuid.v4();
this.shareInfo = { this.shareInfo = {
...this.lifeCommonService.generateShareCode(), ...this.lifeCommonService.generateShareCode(),
shareCode: shareCodeUuid,
customerId: this.lifeCustomerInfo.customerId, customerId: this.lifeCustomerInfo.customerId,
productId: this.materialItemId, productId: this.materialItemId,
url: `${environment.ORIGINNAME}/life/${this.materialItemId}?shareCode=${this.lifeCommonService.generateShareCode().shareCode}` url: `${environment.ORIGINNAME}/life/${this.materialItemId}?shareCode=${shareCodeUuid}`
}; };
// 发送请求保存分享码 // 发送请求保存分享码
this.shareCallBack(); this.shareCallBack();
......
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