Commit f84b5139 by 杨翰文

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

parent e2fa223b
......@@ -186,17 +186,21 @@
z-index: 3;
width: 100%;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
}
.modal-container {
position: relative;
transform: scale(0.9);
}
.poster {
width: 6.51rem;
height: 10.65rem;
position: relative;
margin: 0.56rem auto 0.25rem;
margin: 0rem auto 0.25rem;
}
.poster-img {
......
......@@ -204,21 +204,21 @@
}
.modal-container{
position: relative;
transform: scale(0.9);
/* height: 10.65rem; */
}
.poster, .share-pic{
width: 6.51rem;
position: relative;
}
.share-pic {
z-index: 100;
display: block;
}
.poster {
/* position: absolute;
position: absolute;
top: 0;
left: 50%;
transform: translate(-50%, 0); */
transform: translate(-50%, 0);
}
.poster.hide {
transform: translate(-2000px, -2000px);
......@@ -364,7 +364,7 @@
</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 @click.stop="previewImg" class="poster-action-btn">保存图片并发送给好友</div>
<!-- <div @click.stop="shareToFirends" class="poster-action-btn">分享好友</div>-->
......@@ -457,20 +457,16 @@ var vueInstance = new Vue({
generatePost() {
setTimeout(() => {
// alert('start');
try {
html2canvas(this.$refs.postContent, {
html2canvas(document.body, {
allowTaint: true,
useCORS: true,
backgroundColor: null
}).then((canvas) => {
// alert(canvas);
this.postData = canvas.toDataURL();
// alert(this.postData);
}).catch(e => {
// alert(e);
}).finally(() => {
});
} catch(e) {
// alert(e);
......
......@@ -296,7 +296,18 @@ var vueInstance = new Vue({
},
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)
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