小红 针对该问题特意看了一下,评论必须指定到一个文章或者自定义界面上,否则评论时将抛出 页面不存在异常
,所以不能简单的通过将id修改为一个不存在的页面的id给友链界面创建自己的评论区,评论区必须依赖已创建的自定义页面。
已添加自定义id功能,但是目前没有想到更好的解决方法。
建议方法:
创建一个空白的自定义页面,不对外公布这个界面,然后将这个界面的id用于友链界面的评论。
2021-09-26 10:53:26.377 WARN 2220 --- [1379207867-3732] run.halo.app.cache.AbstractCacheStore : Cache key: [cache_lock_public run.halo.app.model.dto.BaseCommentDTO run.halo.app.controller.content
2021-09-26 10:53:26.382 ERROR 2220 --- [1379207867-3732] r.h.app.core.ControllerExceptionHandler : Captured an exception:
run.halo.app.exception.NotFoundException: 查询不到该页面的信息
at run.halo.app.service.impl.SheetCommentServiceImpl.lambda$validateTarget$0(SheetCommentServiceImpl.java:56) ~[classes!/:1.4.8]
at java.base/java.util.Optional.orElseThrow(Optional.java:408) ~[na:na]
at run.halo.app.service.impl.SheetCommentServiceImpl.validateTarget(SheetCommentServiceImpl.java:56) ~[classes!/:1.4.8]
at run.halo.app.service.impl.BaseCommentServiceImpl.create(BaseCommentServiceImpl.java:305) ~[classes!/:1.4.8]
at run.halo.app.service.impl.BaseCommentServiceImpl.createBy(BaseCommentServiceImpl.java:392) ~[classes!/:1.4.8]
at run.halo.app.service.impl.BaseCommentServiceImpl$$FastClassBySpringCGLIB$$a47714c0.invoke(<generated>) ~[classes!/:1.4.8]
at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218) ~[spring-core-5.3.5.jar!/:5.3.5]
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:688) ~[spring-aop-5.3.5.jar!/:5.3.5]
at run.halo.app.service.impl.SheetCommentServiceImpl$$EnhancerBySpringCGLIB$$17b3b6a9.createBy(<generated>) ~[classes!/:1.4.8]
at run.halo.app.controller.content.api.SheetController.comment(SheetController.java:164) ~[classes!/:1.4.8]
at run.halo.app.controller.content.api.SheetController$$FastClassBySpringCGLIB$$ee838e1c.invoke(<generated>) ~[classes!/:1.4.8]
at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218) ~[spring-core-5.3.5.jar!/:5.3.5]
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:779) ~[spring-aop-5.3.5.jar!/:5.3.5]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163) ~[spring-aop-5.3.5.jar!/:5.3.5]
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:750) ~[spring-aop-5.3.5.jar!/:5.3.5]
at org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:89) ~[spring-aop-5.3.5.jar!/:5.3.5]
at run.halo.app.cache.lock.CacheLockInterceptor.interceptCacheLock(CacheLockInterceptor.java:71) ~[classes!/:1.4.8]