关注公众号进行中
parent
f588163560
commit
4fc1384b49
@ -0,0 +1,30 @@
|
|||||||
|
import {
|
||||||
|
service
|
||||||
|
} from "../../utils/service";
|
||||||
|
import {
|
||||||
|
localPath
|
||||||
|
} from "../api.js";
|
||||||
|
|
||||||
|
// 获取微信公众号access_token
|
||||||
|
export function getAccessToken() {
|
||||||
|
return service({
|
||||||
|
url: "/weixinApi" + "/cgi-bin/token?grant_type=client_credential&appid=wx3c108aae98b1433c&secret=9ed5097e93b5a0e909dbe2b347d068ac",
|
||||||
|
method: "get",
|
||||||
|
});
|
||||||
|
}
|
||||||
|
// 根据微信公众号access_token获取ticket
|
||||||
|
export function getTicket(accessToken, data) {
|
||||||
|
return service({
|
||||||
|
url: "/weixinApi" + "/cgi-bin/qrcode/create?access_token=" + accessToken,
|
||||||
|
method: "post",
|
||||||
|
data
|
||||||
|
});
|
||||||
|
}
|
||||||
|
// 通过ticket换取二维码
|
||||||
|
export function getQrCode(data) {
|
||||||
|
return service({
|
||||||
|
url: "/weixinMp" + "/cgi-bin/showqrcode?ticket=" + data,
|
||||||
|
method: "get",
|
||||||
|
responseType: "blob"
|
||||||
|
});
|
||||||
|
}
|
||||||
@ -0,0 +1,37 @@
|
|||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<iframe src="https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx3c108aae98b1433c&redirect_uri=www.decaisoft.com&response_type=code&scope=snsapi_userinfo&connect_redirect=1#wechat_redirect" id="mobsf" scrolling="no" frameborder="0" style="border: 1px solid #ccc"></iframe>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
};
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
/**
|
||||||
|
* iframe-宽高自适应显示
|
||||||
|
*/
|
||||||
|
function changeMobsfIframe() {
|
||||||
|
const mobsf = document.getElementById('mobsf');
|
||||||
|
const deviceWidth = document.body.clientWidth;
|
||||||
|
const deviceHeight = document.body.clientHeight;
|
||||||
|
// mobsf.style.width = (Number(deviceWidth) - 240) + 'px'; //数字是页面布局宽度差值
|
||||||
|
// mobsf.style.height = (Number(deviceHeight) - 64) + 'px'; //数字是页面布局高度差
|
||||||
|
mobsf.style.width = '150px'; //数字是页面布局宽度差值
|
||||||
|
mobsf.style.height = '150px'; //数字是页面布局高度差
|
||||||
|
}
|
||||||
|
|
||||||
|
changeMobsfIframe()
|
||||||
|
|
||||||
|
window.onresize = function () {
|
||||||
|
changeMobsfIframe()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
},
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<style scoped>
|
||||||
|
</style>
|
||||||
Loading…
Reference in New Issue