1
0
mirror of https://github.com/ialley-workshop-open/uni-halo.git synced 2026-06-10 11:59:28 +08:00

feat(auth): 限制阅读支持评论后访问

- 引入 getOpenid 和 getNologinEmail 方法统一管理认证信息
- 替换原有直接读取 storage 方式为封装方法调用
- 优化文章详情页按钮文案展示逻辑
- 新增评论后自动刷新限制阅读内容功能
- 调整评论权限提示逻辑,跳转至评论弹窗而非 toast 提示
This commit is contained in:
liuyiwuqing
2025-11-25 21:32:07 +08:00
parent 90f6516f45
commit 21fee2dc9a
3 changed files with 32 additions and 12 deletions
+8 -8
View File
@@ -101,7 +101,7 @@
:loading="true"
:lines="3"
:tip-text="`此处内容已隐藏,「${getRestrictReadTypeName(result)}可见」`"
button-text="查看更多"
:button-text="`${getRestrictReadTypeName(result)}`"
button-color="#1890ff"
skeleton-color="#f0f0f0"
skeleton-highlight="#e0e0e0"
@@ -129,7 +129,7 @@
:loading="true"
:lines="3"
:tip-text="`此处内容已隐藏,「${getRestrictReadTypeName(result)}可见」`"
button-text="查看更多"
:button-text="`${getRestrictReadTypeName(result)}`"
button-color="#1890ff"
skeleton-color="#f0f0f0"
skeleton-highlight="#e0e0e0"
@@ -726,8 +726,10 @@ export default {
this.commentModal.show = true;
},
fnOnCommentModalClose({ refresh, isSubmit }) {
console.log('refresh', refresh);
console.log('isSubmit', isSubmit);
// 评论后自动刷新
if (this.result?.metadata?.annotations?.restrictReadEnable === 'comment') {
this.fnGetData();
}
if (refresh && isSubmit && this.$refs.commentListRef) {
this.$refs.commentListRef.fnGetData();
}
@@ -1236,10 +1238,8 @@ export default {
this.verificationCodeModal.show = true;
return;
} else if (restrictReadEnable === 'comment') {
uni.showToast({
title: '前往web端评论后访问',
icon: 'none'
});
this.fnToComment();
return;
} else if (restrictReadEnable === 'login') {
uni.showToast({
title: '前往web端登录后访问',