|
@@ -12,6 +12,7 @@
|
|
|
<script>
|
|
|
import { mapState, createNamespacedHelpers } from 'vuex';
|
|
|
import QRCode from 'qrcode';
|
|
|
+const { mapActions: dock } = createNamespacedHelpers('dock');
|
|
|
export default {
|
|
|
name: 'index',
|
|
|
props: {},
|
|
@@ -19,12 +20,20 @@ export default {
|
|
|
data: function() {
|
|
|
return {
|
|
|
qc: '',
|
|
|
+ dockid: '',
|
|
|
};
|
|
|
},
|
|
|
- created() {},
|
|
|
+ created() {
|
|
|
+ this.search();
|
|
|
+ },
|
|
|
methods: {
|
|
|
+ ...dock(['fetch', 'query', 'delete', 'update', 'fetch']),
|
|
|
+ async search() {
|
|
|
+ let res = await this.fetch(this.user.uid);
|
|
|
+ this.$set(this, `dockid`, res.data.id);
|
|
|
+ },
|
|
|
async creatQrCode() {
|
|
|
- let url = `http://free.liaoningdoupo.com/api/auth/wxchat?redirect_uri=http://free.liaoningdoupo.com/platmobile/bind/&type=1&uid=${this.user.uid}`; // 需要转换为二维码的内容
|
|
|
+ let url = `http://free.liaoningdoupo.com/api/auth/wxchat?redirect_uri=http://free.liaoningdoupo.com/platmobile/followbind/&type=2&qrcode=${this.dockid}`; // 需要转换为二维码的内容
|
|
|
let el = document.getElementById('qrCodeUrl');
|
|
|
this.qc = await QRCode.toDataURL(url, { height: 200, width: 200 });
|
|
|
},
|