How to Implement NodeJs Anti-Repeat Submission?

  node.js, question

Token can be used in java to intercept repeated submissions.

Is there any plug-in or module in nodejs to solve this security problem? .

In theory, the simpler the better. . . Queue or something, alas. .

Is there any good way to avoid duplicate submission on the server side by referring to “node.js” in cnode? 》

The simplest way is to restrict on the client side and cannot initiate another request until the last request has not responded.

There are also many methods on the server side.

  1. The simplest way to prevent duplicate data writing is at the database level

  2. Use some RateLimit to define how many times the same operation cannot be performed within a specified time. If you use Express, you can use this.https://github.com/nfriedly/express-rate-limit

  3. As you mentioned, using queue writing

  4. Each submission requires one token, and each token can only be used once.