This commit is contained in:
wanyongkang
2020-12-02 23:38:15 +08:00
parent a5e48dccae
commit 4ca40a7528

View File

@@ -16,48 +16,66 @@
</div>
</template>
<script>
import QRCode from "qrcodejs2";
var that = null;
import QRCode from 'qrcodejs2'
import Fingerprint from './../../../../static/js/fingerprint.js'
let finger = new Fingerprint()
var that = null
export default {
name: "headerBar",
data() {
name: 'headerBar',
data () {
return {
qrVisible: false,
qrCode: null
};
}
},
props: {},
created() {},
created () {
this.confire_finger()
},
methods: {
open() {
console.log(open);
var url = "http://yk.hncore.net/store";
this.makeqrcode(url);
// 验证web指纹
confire_finger () {
let finger_code = finger.get()
this.$api.post(this.$api.phpURL + 'api/Verify/index', {code: finger_code}).then(res => {
if (res.msg == 'false') {
// eslint-disable-next-line camelcase
alert('访问错误!错误码:' + finger_code)
window.location.href = 'http://www.juip.com'
}
})
},
logout(){
localStorage.clear();
this.$router.replace('/login');
open () {
console.log(open)
var url = 'http://yk.hncore.net/store'
this.makeqrcode(url)
},
showQr() {
this.qrVisible = true;
logout () {
localStorage.clear()
this.$router.replace('/login')
},
makeqrcode(url) {
var that = this;
this.qrCode&&this.qrCode.clear();
var qr = document.getElementById("qrcode");
qr.innerHTML = "";
showQr () {
this.qrVisible = true
},
makeqrcode (url) {
var that = this
this.qrCode && this.qrCode.clear()
var qr = document.getElementById('qrcode')
qr.innerHTML = ''
this.qrCode = new QRCode(qr, {
text: url,
width: 150,
height: 150,
colorDark: "#000000",
colorLight: "#ffffff",
colorDark: '#000000',
colorLight: '#ffffff',
correctLevel: QRCode.CorrectLevel.H
});
})
}
},
computed: {}
};
}
</script>
<style lang="less" scoped>
.base_topBarbox {