搜索功能完善

This commit is contained in:
2023-07-06 13:58:57 +08:00
parent d8e6771cfe
commit 9017864f82
13 changed files with 736 additions and 83 deletions

View File

@@ -211,7 +211,7 @@
<span style="font-size: 14px;color: #9ca3af">{{item.commentTime}}</span>
<div style="display: flex;align-items: center">
<span style="margin-right: 5px;font-size: 14px; color: rgb(156, 163, 175);">{{ formatNumber(item.likeNum) }}</span>
<el-link @click="addLike(item.commentId)" icon="el-icon-star-off" :underline="false">点赞</el-link>
<el-link @click.once="addLike(item.commentId)" icon="el-icon-star-off" :underline="false">点赞</el-link>
</div>
</div>
@@ -250,7 +250,7 @@
<span style="font-size: 14px;color: #9ca3af">{{item.commentTime}}</span>
<div style="display: flex;align-items: center">
<span style="margin-right: 5px;font-size: 14px; color: rgb(156, 163, 175);">{{ formatNumber(item.likeNum) }}</span>
<el-link @click="addLike(item.commentId)" icon="el-icon-star-off" :underline="false">点赞</el-link>
<el-link @click.once="addLike(item.commentId)" icon="el-icon-star-off" :underline="false">点赞</el-link>
</div>
</div>
@@ -419,41 +419,48 @@ export default {
publishComment(){
var that=this;
if(this.$cookie.get('username')!=null){
axios({
method: 'post',
// 请求的地址
url: 'http://localhost:8082/helloGithub_war_exploded/comment',
// URL 中的查询参数
params: {
id:that.$route.query.id,
star:that.startValue,
content:that.textarea,
isUsed: that.radio,
}
}).then(function (res) {
if (res.data.code === 200) {
Vue.prototype.$notify({
title: '成功',
message: ('i', {style: 'color: teal'}, res.data.msg),
type: 'success',
offset: 50
});
that.getLastComment();
that.reload();
} else {
Vue.prototype.$notify.error({
title: '错误',
message: res.data.msg,
offset: 50
});
}
});
if(this.textarea !==''){
axios({
method: 'post',
// 请求的地址
url: 'http://localhost:8082/helloGithub_war_exploded/comment',
// URL 中的查询参数
params: {
id:that.$route.query.id,
star:that.startValue,
content:that.textarea,
isUsed: that.radio,
}
}).then(function (res) {
if (res.data.code === 200) {
Vue.prototype.$notify({
title: '成功',
message: ('i', {style: 'color: teal'}, res.data.msg),
type: 'success',
offset: 50
});
that.getLastComment();
that.reload();
} else {
Vue.prototype.$notify.error({
title: '错误',
message: res.data.msg,
offset: 50
});
}
});
}else{
Vue.prototype.$notify.error({
title: '错误',
message: "请填写评论内容!",
offset: 50
});
}
}else{
Vue.prototype.$notify.error({
title: '错误',
message: "你还未登录!",
offset: 50
});
}