Commit f84b5139 by 杨翰文

fix: 浮层样式,token失效后提示登录

parent e2fa223b
...@@ -186,17 +186,21 @@ ...@@ -186,17 +186,21 @@
z-index: 3; z-index: 3;
width: 100%; width: 100%;
height: 100%; height: 100%;
display: flex;
align-items: center;
justify-content: center;
} }
.modal-container { .modal-container {
position: relative;
transform: scale(0.9);
} }
.poster { .poster {
width: 6.51rem; width: 6.51rem;
height: 10.65rem; height: 10.65rem;
position: relative; position: relative;
margin: 0.56rem auto 0.25rem; margin: 0rem auto 0.25rem;
} }
.poster-img { .poster-img {
......
...@@ -204,21 +204,21 @@ ...@@ -204,21 +204,21 @@
} }
.modal-container{ .modal-container{
position: relative; position: relative;
transform: scale(0.9);
/* height: 10.65rem; */ /* height: 10.65rem; */
} }
.poster, .share-pic{ .poster, .share-pic{
width: 6.51rem; width: 6.51rem;
position: relative; position: relative;
} }
.share-pic { .share-pic {
z-index: 100; z-index: 100;
display: block; display: block;
} position: absolute;
.poster {
/* position: absolute;
top: 0; top: 0;
left: 50%; left: 50%;
transform: translate(-50%, 0); */ transform: translate(-50%, 0);
} }
.poster.hide { .poster.hide {
transform: translate(-2000px, -2000px); transform: translate(-2000px, -2000px);
...@@ -364,7 +364,7 @@ ...@@ -364,7 +364,7 @@
</div> </div>
</div> </div>
</div> </div>
<!-- <img :src="postData" alt="" v-if="postData" class="share-pic"> --> <img :src="postData" alt="" v-if="postData" class="share-pic">
<div class="poster-action-box"> <div class="poster-action-box">
<div @click.stop="previewImg" class="poster-action-btn">保存图片并发送给好友</div> <div @click.stop="previewImg" class="poster-action-btn">保存图片并发送给好友</div>
<!-- <div @click.stop="shareToFirends" class="poster-action-btn">分享好友</div>--> <!-- <div @click.stop="shareToFirends" class="poster-action-btn">分享好友</div>-->
...@@ -457,20 +457,16 @@ var vueInstance = new Vue({ ...@@ -457,20 +457,16 @@ var vueInstance = new Vue({
generatePost() { generatePost() {
setTimeout(() => { setTimeout(() => {
// alert('start');
try { try {
html2canvas(document.body, {
html2canvas(this.$refs.postContent, {
allowTaint: true, allowTaint: true,
useCORS: true, useCORS: true,
backgroundColor: null backgroundColor: null
}).then((canvas) => { }).then((canvas) => {
// alert(canvas);
this.postData = canvas.toDataURL(); this.postData = canvas.toDataURL();
// alert(this.postData);
}).catch(e => { }).catch(e => {
// alert(e); }).finally(() => {
}); });
} catch(e) { } catch(e) {
// alert(e); // alert(e);
......
...@@ -296,7 +296,18 @@ var vueInstance = new Vue({ ...@@ -296,7 +296,18 @@ var vueInstance = new Vue({
}, },
async _init_func(){ async _init_func(){
this.slides = await $get('/category/list').then(res=>res.data).catch(err=>{throw err}) try {
this.slides = await $get('/category/list').then(res=>res.data).catch(err=>{throw err})
} catch(e) {
localStorage.removeItem('accessToken');
var code = getQueryByString(location.href,'code')
//没有登录情况下
alert('登录已失效,点击确认后重新登录');
const {url,appid} = await $get('/weixin/info').then(res=>res.data).catch(err=>{throw err})
location.href = url
}
console.log(this.slides) console.log(this.slides)
this.loadReady = true this.loadReady = true
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment