recently, I learned the node.js + koa + mysql backend. When I write a page, I always see that the requested interface has some string-based unique Id,. I don"t know how to do it myself. Please give me some advice
.recently, I learned the node.js + koa + mysql backend. When I write a page, I always see that the requested interface has some string-based unique Id,. I don"t know how to do it myself. Please give me some advice
.there are many ways to globally unique strings, such as time-based, network card mac address, cpu id and so on. The standard is that the uuid, generation algorithm is standardized, and almost all languages have readily available methods.
method for MySQL to generate uuid
select uuid();
there are many ways for nodejs to generate uuid, such as using the node-uuid module.
execute: npm install node-uuid first
var uuid = require('node-uuid');
console.log(uuid.v1())
console.log(uuid.v4())
1. After logging in for the first time, return to the front-end token, and then the front-end takes the token to get the corresponding data 2. When you log in for the second time, you don t need to enter the account password again and jump directly to...