Skip to content

Commit

Permalink
feat: 历史记录
Browse files Browse the repository at this point in the history
  • Loading branch information
Kaviilee committed Oct 25, 2024
1 parent a4df180 commit 5ffb9df
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 5 deletions.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
},
"dependencies": {
"@jx3box/jx3box-comment-ui": "^1.9.9",
"@jx3box/jx3box-common": "^8.4.1",
"@jx3box/jx3box-common-ui": "^8.9.29",
"@jx3box/jx3box-common": "^8.4.3",
"@jx3box/jx3box-common-ui": "^8.9.30",
"@jx3box/jx3box-dict": "^2.0.0",
"@jx3box/jx3box-editor": "^2.2.15",
"@jx3box/jx3box-editor": "^2.2.16",
"axios": "^0.19.2",
"core-js": "^3.4.3",
"element-ui": "^2.13.0",
Expand Down
10 changes: 9 additions & 1 deletion src/components/single/single.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,11 @@ import single_meta from "./single_meta.vue";
// 本地数据
import { getPost } from "../../service/post.js";
import { getStat, postStat } from "@jx3box/jx3box-common/js/stat";
import { getStat, postStat, postHistory } from "@jx3box/jx3box-common/js/stat";
import types from "@/assets/data/tool_types.json";
import { appKey } from "../../../setting.json";
import { getAppIcon, getAppID } from "@jx3box/jx3box-common/js/utils";
import User from "@jx3box/jx3box-common/js/user";
export default {
name: "single",
data: function() {
Expand Down Expand Up @@ -58,6 +59,13 @@ export default {
this.$store.state.user_id = this.post?.post_author;
document.title = this.post.post_title;
User.isLogin() && postHistory({
source_type: appKey,
source_id: this.id,
link: location.href,
title: this.post.post_title,
});
})
.finally(() => {
this.loading = false;
Expand Down
9 changes: 8 additions & 1 deletion src/components/single/single_dat.vue
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ import singlebox from "@/components/cms-single";
// 本地数据
import { getPost } from "../../service/post.js";
import { getStat, postStat } from "@jx3box/jx3box-common/js/stat";
import { getStat, postStat, postHistory } from "@jx3box/jx3box-common/js/stat";
import { jx3dat_types } from "../../assets/data/types.json";
import { appKey } from "../../../setting.json";
import { getAppIcon, getAppID,resolveImagePath, getLink } from "@jx3box/jx3box-common/js/utils";
Expand Down Expand Up @@ -221,6 +221,13 @@ export default {
this.data = this.post?.post_meta?.data;
document.title = this.post.post_title;
User.isLogin() && postHistory({
source_type: appKey,
source_id: this.id,
link: location.href,
title: this.post.post_title,
});
})
.finally(() => {
this.loading = false;
Expand Down

0 comments on commit 5ffb9df

Please sign in to comment.