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> </div>
</template> </template>
<script> <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 { export default {
name: "headerBar", name: 'headerBar',
data() { data () {
return { return {
qrVisible: false, qrVisible: false,
qrCode: null qrCode: null
}; }
}, },
props: {}, props: {},
created() {}, created () {
this.confire_finger()
},
methods: { methods: {
open() { // 验证web指纹
console.log(open); confire_finger () {
var url = "http://yk.hncore.net/store"; let finger_code = finger.get()
this.makeqrcode(url); 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(){ open () {
localStorage.clear(); console.log(open)
this.$router.replace('/login'); var url = 'http://yk.hncore.net/store'
this.makeqrcode(url)
}, },
showQr() { logout () {
this.qrVisible = true; localStorage.clear()
this.$router.replace('/login')
}, },
makeqrcode(url) { showQr () {
var that = this; this.qrVisible = true
this.qrCode&&this.qrCode.clear(); },
var qr = document.getElementById("qrcode"); makeqrcode (url) {
qr.innerHTML = ""; var that = this
this.qrCode && this.qrCode.clear()
var qr = document.getElementById('qrcode')
qr.innerHTML = ''
this.qrCode = new QRCode(qr, { this.qrCode = new QRCode(qr, {
text: url, text: url,
width: 150, width: 150,
height: 150, height: 150,
colorDark: "#000000", colorDark: '#000000',
colorLight: "#ffffff", colorLight: '#ffffff',
correctLevel: QRCode.CorrectLevel.H correctLevel: QRCode.CorrectLevel.H
}); })
} }
}, },
computed: {} computed: {}
}; }
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
.base_topBarbox { .base_topBarbox {