|
@@ -0,0 +1,41 @@
|
|
|
+<template>
|
|
|
+ <div id="index">
|
|
|
+ <img :src="qc" />
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import dataTable from '@/components/data-table.vue';
|
|
|
+import { mapState, createNamespacedHelpers } from 'vuex';
|
|
|
+import QRCode from 'qrcode';
|
|
|
+export default {
|
|
|
+ name: 'index',
|
|
|
+ props: {},
|
|
|
+ components: {},
|
|
|
+ data: () => ({
|
|
|
+ qc: '',
|
|
|
+ }),
|
|
|
+ created() {
|
|
|
+ this.creatQrCode();
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ async creatQrCode() {
|
|
|
+ console.log(this.user);
|
|
|
+ let url = `http://free.liaoningdoupo.com/api/auth/wxchat?redirect_uri=http://free.liaoningdoupo.com/platmobile/bind/&type=1&uid=${this.user.uid}`; // 需要转换为二维码的内容
|
|
|
+ let el = document.getElementById('qrCodeUrl');
|
|
|
+ this.qc = await QRCode.toDataURL(url, { height: 200, width: 200 });
|
|
|
+ },
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ ...mapState(['user']),
|
|
|
+ pageTitle() {
|
|
|
+ return `${this.$route.meta.title}`;
|
|
|
+ },
|
|
|
+ },
|
|
|
+ metaInfo() {
|
|
|
+ return { title: this.$route.meta.title };
|
|
|
+ },
|
|
|
+};
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="less" scoped></style>
|