fix
This commit is contained in:
15
src/main.ts
15
src/main.ts
@@ -13,12 +13,23 @@ import VueLazyload from "vue-lazyload";
|
||||
import i18n from './lang/index'
|
||||
import GO from './tool/GO'
|
||||
import "../node_modules/@flaticon/flaticon-uicons/css/all/all.css"
|
||||
import Fingerprint2 from 'fingerprintjs2';//获取浏览器唯一标识
|
||||
flexible()
|
||||
import { useI18n } from 'vue-i18n';
|
||||
// console.log(process.env)
|
||||
|
||||
Fingerprint2.get(function(components) {
|
||||
const values = components.map(function(component,index) {
|
||||
if (index === 0) { //把微信浏览器里UA的wifi或4G等网络替换成空,不然切换网络会ID不一样
|
||||
return component.value.replace(/\bNetType\/\w+\b/, '')
|
||||
}
|
||||
return component.value
|
||||
})
|
||||
// 生成最终id murmur
|
||||
const murmur = Fingerprint2.x64hash128(values.join(''), 31);
|
||||
console.log('浏览器指纹码:'+murmur )
|
||||
})
|
||||
let loadingParam = {
|
||||
loading: require('./assets/images/homePage/loading.gif'),
|
||||
attempt: 1
|
||||
}
|
||||
}
|
||||
createApp(App).use(store).use(router).use(Antd).use(VueLazyload,loadingParam).use(i18n).mount('#app')
|
||||
|
||||
Reference in New Issue
Block a user