修改友链

This commit is contained in:
2020-09-26 19:03:34 +08:00
parent dbebc68cb0
commit 0e2e8ca254
13 changed files with 100 additions and 631 deletions

View File

@ -2,11 +2,6 @@
.pageList
.articleContent(ref='articleImgs', v-if='Articels')
article.articleList(v-for='(post, index) in Articels', :key='index')
.articleImgs(v-if='post.postImages.length')
nuxt-link(:to='"/post/" + post.ID')
Swiper(:style='"height: " + imageHeight + "px"')
Slide(v-for='(imgUrl, inx) in post.postImages', :key='inx')
img(:src='imgUrl')
.articleAbstract
nuxt-link(:to='"/post/" + post.ID')
.articleTitle(v-html='post.post_title')
@ -80,8 +75,6 @@ export default {
Articels[n].postmetum = {}
Articels[n].postmetum.meta_value = 0
}
Articels[n].postImages = []
}
} else if (data.status === 404) {
Info = '未找到文章。'
@ -100,25 +93,6 @@ export default {
},
mounted () {
this.$finishLoad()
this.analyseImages()
},
methods: {
async analyseImages () { // 图片大小分析及处理
const articleImgsWidth = this.$refs.articleImgs.getBoundingClientRect().width
this.imageHeight = articleImgsWidth * 0.5625
for (const n in this.Articels) {
if (this.Articels[n].postimages.length !== 0) {
for (const i in this.Articels[n].postimages) {
const data = await this.$axios.$get(this.Articels[n].postimages[i].guid + '?x-oss-process=image/info')
const widthValue = data.ImageWidth.value
const heightValue = data.ImageHeight.value
if (widthValue > articleImgsWidth && (articleImgsWidth * heightValue / widthValue > this.imageHeight) && this.Articels[n].postImages.length < 10) {
this.Articels[n].postImages.push(this.Articels[n].postimages[i].guid + '?x-oss-process=image/resize,m_lfit,w_' + articleImgsWidth)
}
}
}
}
}
}
}
</script>

View File

@ -2,11 +2,6 @@
.pageList
.articleContent(ref='articleImgs', v-if='Articels')
article.articleList(v-for='(post, index) in Articels', :key='index')
.articleImgs(v-if='post.postImages.length')
nuxt-link(:to='"/post/" + post.ID')
Swiper(:style='"height: " + imageHeight + "px"')
Slide(v-for='(imgUrl, inx) in post.postImages', :key='inx')
img(:src='imgUrl')
.articleAbstract
nuxt-link(:to='"/post/" + post.ID')
.articleTitle(v-html='post.post_title')
@ -77,8 +72,6 @@ export default {
Articels[n].postmetum = {}
Articels[n].postmetum.meta_value = 0
}
Articels[n].postImages = []
}
} else if (data.status === 404) {
Info = '未找到文章。'
@ -97,25 +90,6 @@ export default {
},
mounted () {
this.$finishLoad()
this.analyseImages()
},
methods: {
async analyseImages () { // 图片大小分析及处理
const articleImgsWidth = this.$refs.articleImgs.getBoundingClientRect().width
this.imageHeight = articleImgsWidth * 0.5625
for (const n in this.Articels) {
if (this.Articels[n].postimages.length !== 0) {
for (const i in this.Articels[n].postimages) {
const data = await this.$axios.$get(this.Articels[n].postimages[i].guid + '?x-oss-process=image/info')
const widthValue = data.ImageWidth.value
const heightValue = data.ImageHeight.value
if (widthValue > articleImgsWidth && (articleImgsWidth * heightValue / widthValue > this.imageHeight) && this.Articels[n].postImages.length < 10) {
this.Articels[n].postImages.push(this.Articels[n].postimages[i].guid + '?x-oss-process=image/resize,m_lfit,w_' + articleImgsWidth)
}
}
}
}
}
}
}
</script>

View File

@ -2,11 +2,6 @@
.pageList
.articleContent(ref='articleImgs', v-if='Articels')
article.articleList(v-for='(post, index) in Articels', :key='index')
.articleImgs(v-if='post.postImages.length')
nuxt-link(:to='"/post/" + post.ID')
Swiper(:style='"height: " + imageHeight + "px"')
Slide(v-for='(imgUrl, inx) in post.postImages', :key='inx')
img(:src='imgUrl')
.articleAbstract
nuxt-link(:to='"/post/" + post.ID')
.articleTitle(v-html='post.post_title')
@ -78,8 +73,6 @@ export default {
Articels[n].postmetum = {}
Articels[n].postmetum.meta_value = 0
}
Articels[n].postImages = []
}
} else if (data.status === 404) {
Info = '未找到文章。'
@ -98,25 +91,6 @@ export default {
},
mounted () {
this.$finishLoad()
this.analyseImages()
},
methods: {
async analyseImages () { // 图片大小分析及处理
const articleImgsWidth = this.$refs.articleImgs.getBoundingClientRect().width
this.imageHeight = articleImgsWidth * 0.5625
for (const n in this.Articels) {
if (this.Articels[n].postimages.length !== 0) {
for (const i in this.Articels[n].postimages) {
const data = await this.$axios.$get(this.Articels[n].postimages[i].guid + '?x-oss-process=image/info')
const widthValue = data.ImageWidth.value
const heightValue = data.ImageHeight.value
if (widthValue > articleImgsWidth && (articleImgsWidth * heightValue / widthValue > this.imageHeight) && this.Articels[n].postImages.length < 10) {
this.Articels[n].postImages.push(this.Articels[n].postimages[i].guid + '?x-oss-process=image/resize,m_lfit,w_' + articleImgsWidth)
}
}
}
}
}
}
}
</script>

63
pages/links.vue Normal file
View File

@ -0,0 +1,63 @@
<template lang="pug">
.links
.Info(v-if='Info')
| {{ Info }}
h1.title
| 首页友链
ul
li
a(href='https://wintc.top/', target='_blank') 沐码小站
li
a(href='https://johnsonlee.site/', target='_blank') Johnson Blog
li
a(href='https://www.lfhacks.com/', target='_blank') LFhacks
li
a(href='https://www.ixiqin.com/', target='_blank') 西秦公子
h1.title
| 内页友链
ul
li
a(href='https://www.lzhpo.com/', target='_blank') 会打篮球的程序猿
li
a(href='http://www.zzfly.net/', target='_blank') 烟花易冷
h1.title
| 暂时取消的友链
ul
li
| 前端视角 网站无法访问
h1.title
| 友链说明
p
| 本站友链遵循对等原则即您的友链放置于首页我的友链也放置于首页
p
| 交换友链请通过左侧头像下方的联系方式与我联系只要网站/博客能正常打开不定时更新原创文章即可
</template>
<script>
export default {
asyncData ({ app, params, $axios }) {
return {
Info: ''
}
},
mounted () {
this.$finishLoad()
}
}
</script>
<style lang="stylus" scoped>
.links
width 100%
height 100%
padding 50px
.title
margin-top 60px
margin-bottom 20px
font-weight 500
</style>

View File

@ -2,11 +2,6 @@
.pageList
.articleContent(ref='articleImgs', v-if='Articels')
article.articleList(v-for='(post, index) in Articels', :key='index')
.articleImgs(v-if='post.postImages.length')
nuxt-link(:to='"/post/" + post.ID')
Swiper(:style='"height: " + imageHeight + "px"')
Slide(v-for='(imgUrl, inx) in post.postImages', :key='inx')
img(:src='imgUrl')
.articleAbstract
nuxt-link(:to='"/post/" + post.ID')
.articleTitle(v-html='post.post_title')
@ -77,8 +72,6 @@ export default {
Articels[n].postmetum = {}
Articels[n].postmetum.meta_value = 0
}
Articels[n].postImages = []
}
} else if (data.status === 404) {
Info = '未找到文章。'
@ -97,25 +90,6 @@ export default {
},
mounted () {
this.$finishLoad()
this.analyseImages()
},
methods: {
async analyseImages () { // 图片大小分析及处理
const articleImgsWidth = this.$refs.articleImgs.getBoundingClientRect().width
this.imageHeight = articleImgsWidth * 0.5625
for (const n in this.Articels) {
if (this.Articels[n].postimages.length !== 0) {
for (const i in this.Articels[n].postimages) {
const data = await this.$axios.$get(this.Articels[n].postimages[i].guid + '?x-oss-process=image/info')
const widthValue = data.ImageWidth.value
const heightValue = data.ImageHeight.value
if (widthValue > articleImgsWidth && (articleImgsWidth * heightValue / widthValue > this.imageHeight) && this.Articels[n].postImages.length < 10) {
this.Articels[n].postImages.push(this.Articels[n].postimages[i].guid + '?x-oss-process=image/resize,m_lfit,w_' + articleImgsWidth)
}
}
}
}
}
}
}
</script>

View File

@ -2,11 +2,6 @@
.pageList
.articleContent(ref='articleImgs', v-if='Articels')
article.articleList(v-for='(post, index) in Articels', :key='index')
.articleImgs(v-if='post.postImages.length')
nuxt-link(:to='"/post/" + post.ID')
Swiper(:style='"height: " + imageHeight + "px"')
Slide(v-for='(imgUrl, inx) in post.postImages', :key='inx')
img(:src='imgUrl')
.articleAbstract
nuxt-link(:to='"/post/" + post.ID')
.articleTitle(v-html='post.post_title')
@ -97,25 +92,6 @@ export default {
},
mounted () {
this.$finishLoad()
this.analyseImages()
},
methods: {
async analyseImages () { // 图片大小分析及处理
const articleImgsWidth = this.$refs.articleImgs.getBoundingClientRect().width
this.imageHeight = articleImgsWidth * 0.5625
for (const n in this.Articels) {
if (this.Articels[n].postimages.length !== 0) {
for (const i in this.Articels[n].postimages) {
const data = await this.$axios.$get(this.Articels[n].postimages[i].guid + '?x-oss-process=image/info')
const widthValue = data.ImageWidth.value
const heightValue = data.ImageHeight.value
if (widthValue > articleImgsWidth && (articleImgsWidth * heightValue / widthValue > this.imageHeight) && this.Articels[n].postImages.length < 10) {
this.Articels[n].postImages.push(this.Articels[n].postimages[i].guid + '?x-oss-process=image/resize,m_lfit,w_' + articleImgsWidth)
}
}
}
}
}
}
}
</script>

View File

@ -2,11 +2,6 @@
.pageList
.articleContent(ref='articleImgs', v-if='Articels')
article.articleList(v-for='(post, index) in Articels', :key='index')
.articleImgs(v-if='post.postImages.length')
nuxt-link(:to='"/post/" + post.ID')
Swiper(:style='"height: " + imageHeight + "px"')
Slide(v-for='(imgUrl, inx) in post.postImages', :key='inx')
img(:src='imgUrl')
.articleAbstract
nuxt-link(:to='"/post/" + post.ID')
.articleTitle(v-html='post.post_title')
@ -77,8 +72,6 @@ export default {
Articels[n].postmetum = {}
Articels[n].postmetum.meta_value = 0
}
Articels[n].postImages = []
}
} else if (data.status === 404) {
Info = '未找到文章。'
@ -97,25 +90,6 @@ export default {
},
mounted () {
this.$finishLoad()
this.analyseImages()
},
methods: {
async analyseImages () { // 图片大小分析及处理
const articleImgsWidth = this.$refs.articleImgs.getBoundingClientRect().width
this.imageHeight = articleImgsWidth * 0.5625
for (const n in this.Articels) {
if (this.Articels[n].postimages.length !== 0) {
for (const i in this.Articels[n].postimages) {
const data = await this.$axios.$get(this.Articels[n].postimages[i].guid + '?x-oss-process=image/info')
const widthValue = data.ImageWidth.value
const heightValue = data.ImageHeight.value
if (widthValue > articleImgsWidth && (articleImgsWidth * heightValue / widthValue > this.imageHeight) && this.Articels[n].postImages.length < 10) {
this.Articels[n].postImages.push(this.Articels[n].postimages[i].guid + '?x-oss-process=image/resize,m_lfit,w_' + articleImgsWidth)
}
}
}
}
}
}
}
</script>

View File

@ -2,11 +2,6 @@
.pageList
.articleContent(ref='articleImgs', v-if='Articels')
article.articleList(v-for='(post, index) in Articels', :key='index')
.articleImgs(v-if='post.postImages.length')
nuxt-link(:to='"/post/" + post.ID')
Swiper(:style='"height: " + imageHeight + "px"')
Slide(v-for='(imgUrl, inx) in post.postImages', :key='inx')
img(:src='imgUrl')
.articleAbstract
nuxt-link(:to='"/post/" + post.ID')
.articleTitle(v-html='post.post_title')
@ -97,25 +92,6 @@ export default {
},
mounted () {
this.$finishLoad()
this.analyseImages()
},
methods: {
async analyseImages () { // 图片大小分析及处理
const articleImgsWidth = this.$refs.articleImgs.getBoundingClientRect().width
this.imageHeight = articleImgsWidth * 0.5625
for (const n in this.Articels) {
if (this.Articels[n].postimages.length !== 0) {
for (const i in this.Articels[n].postimages) {
const data = await this.$axios.$get(this.Articels[n].postimages[i].guid + '?x-oss-process=image/info')
const widthValue = data.ImageWidth.value
const heightValue = data.ImageHeight.value
if (widthValue > articleImgsWidth && (articleImgsWidth * heightValue / widthValue > this.imageHeight) && this.Articels[n].postImages.length < 10) {
this.Articels[n].postImages.push(this.Articels[n].postimages[i].guid + '?x-oss-process=image/resize,m_lfit,w_' + articleImgsWidth)
}
}
}
}
}
}
}
</script>