Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added visit count | 获取并增加访问计数 #58

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

EasyChris
Copy link

// 获取并增加访问计数
    let count = await LINKS.get(path + "_count");
    if (count === null) {
      await LINKS.put(path + "_count", "1"); // 初始化为1,因为这是首次访问
    } else {
      count = parseInt(count) + 1;
      await LINKS.put(path + "_count", count.toString());
    }

把访问次数 以 key_count 的形式存储在kv里面,方便看特定的访问数据

@qazxcdswe123
Copy link

Please at least remove the self-plug URL before opening this PR 😃

@crazypeace
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants