Loading…

Distributed unique ID

# Preface This tutorial is based on the "apifm-wxapi" module and teaches you how to quickly implement small program development, so you may need to understand the following knowledge points first: ["Creating HelloWorld Project"](https://www.yuque.com/apifm/doc/hezlrm) ["Use "apifm-wxapi" to quickly develop small programs"](https://www.yuque.com/apifm/doc/mdldsd) ["Register for free to open the backend and obtain an exclusive domain name"](https://www.yuque.com/apifm/doc/qr6l4m) # Requirements description The applet obtains the unique ID of the distributed system; # budget 0 yuan, free implementation # Requirements realization ### Write small program code: ```plain const WXAPI = require('apifm-wxapi') WXAPI.init('gooking') Page({ data: { }, onLoad: function (options) { // Get the unique ID of the distributed system WXAPI.uniqueId().then(res => { console.log('Distributed system unique ID:', res.data) }) } }) ``` **Run results:** ```plain Distributed system unique ID: 190805104520005 ``` > WXAPI.init('gooking') This code links your mini program to your backend, where gooking is your exclusive domain name (please check the chapter about exclusive domain names in the preface); > _This method supports passing in a type parameter. Each type parameter maintains a queue independently without interfering with each other. It can be used when needed_ ```plain WXAPI.uniqueId('gooking') WXAPI.uniqueId('zansan') WXAPI.uniqueId('order') ... ``` Looking forward to your progress! Thanks!