feat:添加文章页评论权限

This commit is contained in:
Xwen
2023-12-22 00:21:13 +08:00
parent 1f74334c92
commit 2a172b0c0b
2 changed files with 22 additions and 4 deletions

View File

@@ -15,14 +15,19 @@
</div>
<el-divider />
<div v-hasPer="['bbs:comment:add']">
<div>
<el-input
:disabled="!isAddComment"
v-model="topContent"
placeholder="发表一个友善的评论吧~"
:rows="5"
type="textarea"
></el-input>
<el-button @click="addTopComment" type="primary" class="btn-top-comment"
<el-button
@click="addTopComment"
type="primary"
class="btn-top-comment"
:disabled="!isAddComment"
>发表评论</el-button
>
<el-button class="btn-top-comment">其他</el-button>
@@ -134,10 +139,23 @@
/>
</template>
<script setup>
import { onMounted, reactive, ref } from "vue";
import { onMounted, reactive, ref, defineProps } from "vue";
import { useRoute, useRouter } from "vue-router";
import { getListByDiscussId, add, del } from "@/apis/commentApi.js";
import AvatarInfo from "./AvatarInfo.vue";
import { getPermission } from "@/utils/auth";
const props = defineProps({
isComment: {
type: Boolean,
default: false,
},
});
const { isHasPermission: isAddComment } = getPermission(
"bbs:comment:add",
props.isComment
);
//数据定义
const route = useRoute();
const router = useRouter();

View File

@@ -83,7 +83,7 @@
</el-col>
<el-col :span="24" class="comment">
<CommentInfo />
<CommentInfo :isComment="isDisabledCreateComment" />
</el-col>
</el-row>
<BottomInfo />