Skip to content

Commit f3033ca

Browse files
committed
fix: fix the problem of data mismatch on the friendship link page
1 parent cab22cf commit f3033ca

File tree

14 files changed

+91
-52
lines changed

14 files changed

+91
-52
lines changed

Aurora-plugin/vuepress-plugin-coze/lib/client/components/CozeMood.vue

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
:current-mood-obj="currentMoodObj" @save-data-success="saveDataSuccess" @cancel="cancel"
55
:open-edit-status="openEditStatus"/>
66
<div class="coze-mood-list">
7-
<div :key="index" v-for="(item,index) in moods" class="coze-enter-animate">
7+
<div :key="item.attributes.mood_content" v-for="(item,index) in moods" class="coze-enter-animate">
88
<div class="coze-mood-control" v-if="item.attributes.mood_show">
99
<mood-item @mood-comment="moodComment" @mood-love="moodLove" @mood-poster="moodPoster"
1010
@mood-edit="moodEdit" :mood-item="item">
@@ -90,19 +90,22 @@ export default defineComponent({
9090
mood_photos: [{
9191
objectId: "61869d9b49cd7e59a03e09c8",
9292
photoName: "1GyQsaZ8MhjTVKi.jpg",
93-
photoUrl: "https://lc-gluttony.s3.amazonaws.com/c5GfUYtqdSYx/AeBxej8RVowlnCyR5gcWf8b5A4TcYW2v/1GyQsaZ8MhjTVKi.jpg"
93+
photoUrl: "https://ooszy.cco.vin/img/theme/%E4%B8%BB%E9%A2%98.jpg"
9494
}],
9595
mood_title: "这是标题",
9696
mood_show: true
9797
},
9898
id: "61869da949cd7e59a03e09cc",
9999
}]
100+
this.$emit("cozeSuccess",{
101+
cozeMoods: []
102+
})
100103
}else {
101104
this.moods = talks
105+
this.$emit("cozeSuccess",{
106+
cozeMoods: this.moods
107+
})
102108
}
103-
this.$emit("cozeSuccess",{
104-
cozeMoods: this.moods
105-
})
106109
});
107110
108111
//验证用户是否登录

Aurora-plugin/vuepress-plugin-coze/lib/client/components/MoodItem.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<div class="mood-item-right" id="mood-item-right">
1010
<div class="coze-mood-item-content">
1111
<div id="mood-item-content" class="mood-item-content mood-item-right-common">
12-
<span>{{moodItem.attributes.mood_content}}</span>
12+
<span v-html="moodItem.attributes.mood_content"></span>
1313
<div class="coze-mood-time">
1414
<span>@{{moodItem.attributes.mood_user}}</span>&nbsp;&nbsp;
1515
<span>更新于: {{getUpdatedTime}}</span>
@@ -25,7 +25,7 @@
2525
</div>
2626
<div class="mood-img-right" id="mood-img-right">
2727
<div class="mood-li-control">
28-
<li v-for="(item,index) in moodItem.attributes.mood_photos" :key="index" id="mood-img-li">
28+
<li v-for="(item,index) in moodItem.attributes.mood_photos" :data="item.photoUrl" :key="item.photoUrl" id="mood-img-li">
2929
<img @click="openImg" class="medium-zoom-image" id="mood-bottom-img" :src="item.photoUrl" :alt="item.photoName">
3030
</li>
3131
</div>

Aurora-plugin/vuepress-plugin-coze/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vuepress-plugin-coze",
3-
"version": "1.2.0",
3+
"version": "1.3.1-beta.1",
44
"description": "为Vuepress静态站点提供在线发布,编辑说说功能,支持图片上传,点赞,评论,用户登录,注册等功能 Provide online publishing, editing and talking functions for Vuepress static sites, support image upload, like, comment, user login, registration and other functions",
55
"main": "./lib/node/index.js",
66
"directories": {

Aurora-theme/lib/client/components/About.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<template #center2>
1313
<div class="about">
1414
<div :style="$store.state.borderRadiusStyle + $store.state.opacityStyle"
15-
v-for="(item) in themeProperty.about" class="introduce box">
15+
v-for="(item) in themeProperty.about" :data="item.title" :key="item.title" class="introduce box">
1616
<div class="about-title">
1717
<div class="about-title-single">
1818
<span class="about-title-single-value">{{item.title}}</span>
@@ -29,8 +29,8 @@
2929
/>
3030
</div>
3131
</div>
32-
<li v-if="!item.bar" v-for="(desc,index) in item.describe"
33-
class="about-desc">{{desc}}</li>
32+
<li v-if="!item.bar" :data="desc" :key="desc" v-for="(desc,index) in item.describe"
33+
class="about-desc" v-html="desc"></li>
3434
<li v-if="item.bar" v-for="desc in item.describe" class="about-desc">
3535
<span class="about-bar-title">{{desc.name}}</span>
3636
<span :style="setSpanStyle(desc.score)">{{desc.score}}%</span>

Aurora-theme/lib/client/components/HomeBottom.vue

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,8 @@
33
<div :style="$store.state.borderRadiusStyle +
44
$store.state.opacityStyle + $store.state.fontColorStyle +
55
$store.state.fontFamilyStyle + $store.state.filterBlurStyle" class="home-bottom" id="home-bottom">
6-
<!--<div :style="getHomePageStyle" class="home-bottom" id="home-bottom">-->
76
<div class="home-page-tag" :style="getHomePageStyle" id="home-page-tag">
8-
<home-page-item :index="index" :theme-property="themeProperty" :key="index" v-for="(item,index) in showPageArr" :page-item="item"/>
7+
<home-page-item :index="index" :theme-property="themeProperty" :data="item.articleUrl" :key="item.articleUrl" v-for="(item,index) in showPageArr" :page-item="item"/>
98
<Pagination @changePage="handleCurrentChange"
109
:total="allPageArr.length"
1110
:current-page="$store.state.currentPageNum"

Aurora-theme/lib/client/components/Link.vue

Lines changed: 29 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,16 @@
33
:show-sidebar-link="false"
44
:is-show-top-img="true" :is-show-head-line="false">
55
<template #center1>
6-
<div class="link" v-for="(linkItem,linkIndex) in themeProperty.friendLinks">
6+
<div class="link" :data="linkItem.title" :key="linkItem.title" v-for="(linkItem,linkIndex) in themeProperty.friendLinks">
77
<div :style="$store.state.borderRadiusStyle + $store.state.opacityStyle"
88
class="box link-common" id="c-link">
9-
109
<div>
1110
<div class="about-title link-title">
1211
<div class="about-title-single">
1312
<span class="about-title-single-value">{{linkItem.title}}</span>
1413
</div>
1514
</div>
16-
<div v-for="(item,index) in linkItem.links" :key="index">
15+
<div v-for="(item,index) in linkItem.links" :data="item.url" :key="item.url">
1716
<LinkItem
1817
:theme-property="themeProperty"
1918
:item="item"/>
@@ -40,7 +39,7 @@
4039
</code></pre><div class="line-numbers"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br></div></div>
4140

4241
<ul class="link-info-desc">
43-
<li v-for="(linkItem,index) in siteInformation.otherDescribe" :key="index">{{linkItem}}</li>
42+
<li v-for="(linkItem,index) in siteInformation.otherDescribe" :key="linkItem" v-html="linkItem"></li>
4443
</ul>
4544
</div>
4645
</template>
@@ -80,12 +79,10 @@ export default defineComponent({
8079
computed: {
8180
getRandomLinks() {
8281
return (linkArr) => {
83-
console.log(111111111111)
8482
let linkArrs = []
8583
this.shuffleArray(linkArr).then((arr) => {
8684
linkArrs = arr;
8785
})
88-
8986
}
9087
},
9188
setSpanStyle() {
@@ -113,25 +110,32 @@ export default defineComponent({
113110
shuffleArray(array) {
114111
return new Promise((resolve,reject) => {
115112
for (let i = array.length - 1; i > 0; i--) {
116-
let j = Math.floor(Math.random() * (i + 1));
117-
let temp = array[i];
118-
array[i] = array[j];
119-
array[j] = temp;
113+
let random1 = this.getRandomInt(0,array.length -1)
114+
let temp = array[i]
115+
array[i] = array[random1]
116+
array[random1] = temp
117+
console.log(i + "---> " + array.length)
118+
array[i] = {
119+
name: 'qsyyke',
120+
sex: 'nan'
121+
}
120122
}
121123
resolve(array)
122124
})
123125
},
124126
shuffle(arr){
125-
let l = arr.length
126-
let index, temp
127-
while(l>0){
128-
index = Math.floor(Math.random()*l)
129-
temp = arr[l-1]
130-
arr[l-1] = arr[index]
131-
arr[index] = temp
132-
l--
133-
}
134-
return arr
127+
return new Promise((resolve,reject) => {
128+
let l = arr.length
129+
let index, temp
130+
while(l>0){
131+
index = Math.floor(Math.random()*l)
132+
temp = arr[l-1]
133+
arr[l-1] = arr[index]
134+
arr[index] = temp
135+
l--
136+
}
137+
resolve(arr)
138+
})
135139
}
136140
},
137141
created() {
@@ -143,11 +147,13 @@ export default defineComponent({
143147
}
144148
145149
this.themeProperty = useThemeData().value
150+
// console.log(this.themeProperty.friendLinks)
146151
if (this.themeProperty.friendLinks !== undefined && this.themeProperty.friendLinks != null) {
147152
for (let i = 0; i < this.themeProperty.friendLinks.length; i++) {
148-
this.shuffleArray(this.themeProperty.friendLinks[i].links).then((arr) => {
149-
this.themeProperty.friendLinks[i].links = arr
150-
})
153+
console.log(this.themeProperty.friendLinks[i].links)
154+
/*this.shuffleArray(this.themeProperty.friendLinks[i].links).then((arr) => {
155+
// this.themeProperty.friendLinks[i].links = arr
156+
})*/
151157
}
152158
}
153159

Aurora-theme/lib/client/components/Tag.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,8 @@
6161
<div class="tag-bottom">
6262
<TagPage v-for="(item,index) in showPageArr"
6363
:page-map="item"
64-
:key="index"
64+
:key="item.articleUrl"
65+
:data="item.articleUrl"
6566
:theme-property="themeProperty"
6667
/>
6768
</div>

Aurora-theme/lib/client/components/child/Catalog.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<template>
22
<div class="">
33
<!--一级标题-->
4-
<div :date="getCatalogLevel1" v-for="(itemLevel1,itemLevel1Index) in currentCatalog"
4+
<div :date="getCatalogLevel1" :data="getCatalogLevel1" v-for="(itemLevel1,itemLevel1Index) in currentCatalog"
55
id="catalog-single" :class="getCatalogOpenStatus(itemLevel1Index)"
66
class="catalog-single sidebar-catalog-item">
77
<!--展示一级标题-->
@@ -19,7 +19,7 @@
1919
<!--展示二级标题-->
2020
<div class="page-catalog-children-parent">
2121
<div class="page-catalog-children">
22-
<div v-for="(itemLevel2,itemLevel2Index) in itemLevel1.headers"
22+
<div :data="itemLevel2.slug" :key="itemLevel2.slug" v-for="(itemLevel2,itemLevel2Index) in itemLevel1.headers"
2323
:class="{catalogChildrenActive: catalogChildrenActive === itemLevel2Index }"
2424
class="catalog-page-children-item">
2525
<div class="catalog-page-children-title">
@@ -32,7 +32,7 @@
3232
<!--展示三级标题-->
3333
<div class="page-catalog-children-level3-parent">
3434
<div :style="setLevel3Style(itemLevel2Index)" class="page-catalog-children-level3">
35-
<div v-for="item in itemLevel2.children"
35+
<div :data="item.slug" v-for="item in itemLevel2.children"
3636
class="page-catalog-children-level3-title">
3737
<router-link :to="itemLevel1.path + '#' + item.title">
3838
<span @click="clickCatalogTitle" :slug="item.slug">{{item.title}}</span>

Aurora-theme/lib/client/components/child/LinkItem.vue

Lines changed: 31 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@
33
<div class="link-item" :style="setTopBg" id="link-item">
44
<div class="link-top">
55
<div class="link-img">
6-
<img id="link-img" :src="item.logo" :alt="item.title">
6+
<img id="link-img" :src="getLinkLogo(item.logo)" :alt="item.title">
77
</div>
88
</div>
99
<div class="link-bottom" :style="setLinkColor(item.cover)">
1010
<div class="link-bottom-title link-bottom-common">
11-
<span>{{item.title}}</span>
11+
<span :key="item.title" :data="item.title">{{getLinkTitle(item.title,getRandomIntNum)}}</span>
1212
</div>
1313
<div class="link-bottom-describe link-bottom-common">
14-
<span id="link-bottom-describe">{{item.describe}}</span>
14+
<span id="link-bottom-describe" :data="item.describe" :key="item.describe">{{getLinkDescribe(item.describe,getRandomIntNum)}}</span>
1515
</div>
1616
</div>
1717
</div>
@@ -32,6 +32,7 @@ export default {
3232
item: null
3333
},
3434
created() {
35+
//console.log(this.item)
3536
let bgColor = ''
3637
if (this.themeProperty.randomColor !== undefined) {
3738
bgColor = this.themeProperty.randomColor[this.getRandomInt(0,this.themeProperty.randomColor.length -1)]
@@ -56,6 +57,29 @@ export default {
5657
}
5758
},
5859
computed: {
60+
getRandomIntNum() {
61+
let min = Math.ceil(0);
62+
let max = Math.floor(999999999);
63+
return Math.floor(Math.random() * (max - min)) + min; //不含最大值,含最小值
64+
},
65+
getLinkTitle() {
66+
return (title,num) => {
67+
return title
68+
}
69+
},
70+
getLinkDescribe() {
71+
return (describe,num) => {
72+
return describe
73+
}
74+
},
75+
getLinkLogo() {
76+
return (logo) => {
77+
let randomNum1 = this.getRandomInt(0,9999999999)
78+
let randomNum2 = this.getRandomInt(0,9999999999)
79+
let logoPath = logo + "?time=" + randomNum1 + logo + randomNum2
80+
return logoPath
81+
}
82+
},
5983
setTopBg() {
6084
return 'background-color: rgba(' + this.hexRgb.r +"," + this.hexRgb.g + "," + this.hexRgb.b + ",.85);"
6185
},
@@ -65,7 +89,10 @@ export default {
6589
if (cover === undefined || cover === "") {
6690
return "background-color: white;" + 'color: rgb(' + this.hexRgb.r +"," + this.hexRgb.g + "," + this.hexRgb.b + ");"
6791
}else {
68-
return "background-image: url("+ cover +");"
92+
let randomNum1 = this.getRandomInt(0,9999999999)
93+
let randomNum2 = this.getRandomInt(0,9999999999)
94+
let logoPath = cover + "?time=" + randomNum1 + cover + randomNum2
95+
return "background-image: url("+ logoPath +");"
6996
}
7097
}
7198
}

Aurora-theme/lib/client/components/child/side/HomeSidebar.vue

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
<div class="sidebar-social">
4242
<HomeSidebarSocialItem :sidebar-row-var="sidebarRowVar"
4343
:sidebar-width-var="sidebarWidthVar"
44-
:social-item="item" v-for="item in socialsArr"/>
44+
:social-item="item" :data="item.aHref" :key="item.aHref" v-for="(item,index) in socialsArr"/>
4545
<slot name="sidebar-son2"/>
4646
</div>
4747
</div>
@@ -50,7 +50,7 @@
5050
<!--侧边栏友情链接-->
5151
<div :id="customId" v-if="getShowSidebarLink" class="sidebar-single-common">
5252
<div class="sidebar-link">
53-
<a :href="item.url" target="_blank" :key="index" v-for="(item,index) in friendLinks">
53+
<a :href="item.url" target="_blank" :data="item.url" :key="item.url" v-for="(item,index) in friendLinks">
5454
<div class="sidebar-link-single">
5555
<div class="sidebar-link-avatar">
5656
<img :src="item.logo" alt="">
@@ -92,7 +92,7 @@
9292
<catalog :is-show-catalog="isShowCatalog" v-show="changePageIndex === '1'" />
9393
<!--最新文章-->
9494
<div v-show="changePageIndex === '2'">
95-
<div v-for="item in getLatestPage" class="sidebar-page-item sidebar-hover-bg-common">
95+
<div v-for="item in getLatestPage" :key="item.articleUrl" :data="item.articleUrl" class="sidebar-page-item sidebar-hover-bg-common">
9696
<div class="sidebar-page-title">
9797
<a :href="item.articleUrl">
9898
<span>{{item.title === "" ? getRecommendNoTitle : item.title}}</span>
@@ -114,7 +114,7 @@
114114
<span>公告</span>
115115
</div>
116116
<div class="sidebar-message">
117-
<li id="sidebar-message" v-for="(item,index) in themeProperty.message" class="sidebar-hover-bg-common">
117+
<li id="sidebar-message" :key="item" v-for="(item,index) in themeProperty.message" class="sidebar-hover-bg-common">
118118
<span v-html="item"></span>
119119
</li>
120120
</div>
@@ -141,7 +141,7 @@
141141
</div>
142142

143143
<div class="sidebar-tag-item">
144-
<router-link v-for="(item,index) in getSidebarTagArr" :to="'/tag?tag=' + item">
144+
<router-link :key="item" v-for="(item,index) in getSidebarTagArr" :to="'/tag?tag=' + item">
145145
<div class="sidebar-tag-single">
146146
<span class="home-sidebar-tag-hover" :key="index" :style="setTagItemStyle(index)">{{item}}</span>
147147
</div>

0 commit comments

Comments
 (0)