Discuz修改默认排序为评论方法

首先下载 DiscuzQ 的 PC 和手机端源码

PC

找到 index.vue里面

sort: '', // 排序

修改为

sort: '3', // 排序

手机端 src/components/

H5 qui-page-home-h5/qui-page-home-h5.vue

找到

params = {
        page: this.pageNum,
        perPage: 10,
        filter: {
          sticky: 0,
          essence: this.threadEssence || 0,
          attention: this.threadFollow,
        },
      };

改成

params = {
        page: this.pageNum,
        perPage: 10,
        filter: {
          sticky: 0,
          sort: 3,
          essence: this.threadEssence || 0,
          attention: this.threadFollow,
        },
      };

有2处

小程序 qui-page-home/qui-page-home.vue

找到

const sun = {
        page: this.pageNum + 1,
        perPage: 10,
        filter: {
          sticky: 0,
          essence: this.threadEssence || 0,
          attention: this.threadFollow,
        },
      };

修改为

const sun = {
        page: this.pageNum + 1,
        perPage: 10,
        filter: {
          sticky: 0,
          sort: 3,
          essence: this.threadEssence || 0,
          attention: this.threadFollow,
        },
      };

有3处

改完编译上传就行了,discuzQ 常用编译命令

原创文章,作者:技术大师,如若转载,请注明出处:https://www.xingkongweb.com/4579.html