This commit is contained in:
parent
dde8735899
commit
8049e37d0c
@ -33,20 +33,20 @@ import Icon3 from './Group 107.svg?component'
|
||||
import Icon4 from './Group 108.svg?component'
|
||||
import request from '@/utils/request'
|
||||
import {computed, ref} from "vue";
|
||||
import { getAllQuertString } from "@/utils/url-utils.ts";
|
||||
console.log(getAllQuertString('ic'));
|
||||
import {getAllQueryString} from "@/utils/url-utils.ts";
|
||||
console.log(getAllQueryString('ic'));
|
||||
|
||||
const downLoadWin = ref('')
|
||||
const downLoadMac = ref('')
|
||||
request.get('/api/v1/common/client/download', {
|
||||
invite_code: getAllQuertString('ic'),
|
||||
invite_code: getAllQueryString('ic'),
|
||||
platform: 'mac',
|
||||
}).then((res) => {
|
||||
downLoadMac.value = res.url
|
||||
})
|
||||
|
||||
request.get('/api/v1/common/client/download', {
|
||||
invite_code: getAllQuertString('ic'),
|
||||
invite_code: getAllQueryString('ic'),
|
||||
platform: 'windows',
|
||||
}).then((res) => {
|
||||
downLoadWin.value = res.url
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { getAllQuertString } from '@/utils/url-utils.ts'
|
||||
import { getAllQueryString } from '@/utils/url-utils.ts'
|
||||
|
||||
/**
|
||||
* OpenInstall sdk 用于上报h5邀请参数
|
||||
@ -23,7 +23,7 @@ class OpenInstallSdk {
|
||||
constructor() {
|
||||
this.OI = {}
|
||||
this.urlQuery = window.OpenInstall.parseUrlParams()
|
||||
const id = getAllQuertString('id')
|
||||
const id = getAllQueryString('id')
|
||||
if (id) {
|
||||
this.urlQuery = {
|
||||
platform: 'merchant',
|
||||
@ -42,7 +42,7 @@ class OpenInstallSdk {
|
||||
const m = this
|
||||
const button = document.getElementById('downloadButton_apple')
|
||||
const button1 = document.getElementById('downloadButton_android')
|
||||
const ic = getAllQuertString('ic')
|
||||
const ic = getAllQueryString('ic')
|
||||
if (button) {
|
||||
button.onclick = function () {
|
||||
if (ic) {
|
||||
|
||||
@ -50,7 +50,7 @@ export const getQueryString = name => {
|
||||
* @param {*} name 需要获取的key
|
||||
* @param {*} isMerge 是否合并hash和search,search优先级高
|
||||
*/
|
||||
export const getAllQuertString = (name, isMerge = true) => {
|
||||
export const getAllQueryString = (name, isMerge = true) => {
|
||||
const reg = `(?:^|&)${name}=([^&]*)(?:&|$)`
|
||||
const search = window.location.search.substr(1)
|
||||
const hash = window.location.hash.split('?')[1]
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user