Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit

Permalink
perf: update spam
Browse files Browse the repository at this point in the history
  • Loading branch information
Kaviilee committed Dec 3, 2024
1 parent 46c4dcd commit 2d4c76d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
7 changes: 7 additions & 0 deletions src/post/community.vue
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,8 @@ export default {
collection_id: "",
is_self_visit: "0",
is_from_phone: 0
},
currentDecorationId: "",
// 选项
Expand Down Expand Up @@ -213,6 +215,11 @@ export default {
this.loadCommentConfig("community", id);
}
this.post.client = "all";
// 判断提交是否来自手机
if (window.navigator.userAgent.match(/(iPhone|iPod|Android|ios)/i)) {
this.post.is_from_phone = 1;
}
},
methods: {
goShopping(e) {
Expand Down
8 changes: 6 additions & 2 deletions src/utils/cmsMetaMixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,9 @@ export const cmsMetaMixin = {
handler: function(val) {
// 统计外链数量
let count = 0;
let links = val.match(/(https?:\/\/[^\s]+)/g);
const regex = /(?:https?:\/\/)?([a-zA-Z0-9.-]+\.[a-zA-Z]{2,})(\/[a-zA-Z0-9._~:\/?#[\]@!$&'()*+,;=-]*)?/gm;

let links = val.match(regex);
if (links) {
for (let link of links) {
if (this.isExtraLink(link)) {
Expand All @@ -95,7 +97,9 @@ export const cmsMetaMixin = {
handler: function(val) {
// 统计外链数量
let count = 0;
let links = val.match(/(https?:\/\/[^\s]+)/g);
const regex = /(?:https?:\/\/)?([a-zA-Z0-9.-]+\.[a-zA-Z]{2,})(\/[a-zA-Z0-9._~:\/?#[\]@!$&'()*+,;=-]*)?/gm;

let links = val.match(regex);
if (links) {
for (let link of links) {
if (this.isExtraLink(link)) {
Expand Down

0 comments on commit 2d4c76d

Please sign in to comment.