quanmndd
v1.0.5
Published
{**see:README**}
Downloads
9
Maintainers
Readme
quanmdnn
简体中文 | English
- tip:This document translation is provided by GPT. If there are any errors, please correct them on Git.
Using NDD Document Database in Node.js and Vue
- API Version: V1
- First Development Document: https://quanmwl.yuque.com/lx4ve0/vcsmy6/gelpzl7sw3pq30qx
- Usage Notice: The API is mainly used to store data such as announcements, version numbers, update instructions, statistical data, and public nicknames. Although it is possible, it is not recommended to use it as a storage space for user confidential data. The API supports data recovery within a limited time frame.
install
To import the latest version in the project.
npm i quanmdnn -s
Use
For detailed usage, please refer to the "examples" folder under the SDK. It contains a sample project. (For debugging convenience, both the demonstration project and the code below have enabled debug output. It is recommended to disable it in a production environment).
var SDK = require('./sdk')
// openID, can be found in the console, please replace it with your own
const open_id = '2'
// lcode, encrypted with the public key of dynamic license obtained from the console, please replace it with your own
const lcode = 'EJnzqJsDTMt1aSaDbhp3zuecv4bia/J1yuna+rTItMinJ3e43Hs0pGR5uyvBaPEL+YeP8gtthzPhAfkoOKpIbbof8VeY4MdZow3HXmgwfNld4xq42QiPAfKCjlJ40H48jxc5Zqg6hIO0p+KfjXp1GST547z2QaieuLEYUS449Kc='
// publickey, public key, please replace it with the content of the pem file downloaded from the console, '\n' represents line breaks
const publickey = '-----BEGIN PUBLIC KEY-----\nMIGfMA0GCSqASIb3DQEBAQUAA4GNADCBiQKBgQC8Ql3WNz2XZyc6ESClqP5LigLk\nPVDUYSBIcremoTFsvBWg50C1uMJebRY1cNyK5o0hg7sdezJiL5D6kwY05x6Lx2Ms\nEX5DCOh/Kp0doSWecl5OdegxNn9M1EWzzjIEydWB9kew7kgYXhIrzhqRuQ1IpyNl\nEL91QP7MuPczwXtlAQIDAQAB\n-----END PUBLIC KEY-----'
// Initialize the SDK and get an instance. Tip: It is recommended to set debug to false in a production environment
const ndd_sdk = new SDK(open_id, lcode, publickey, true)
// The following code snippets are provided as examples. Uncomment them as needed to see the results.
// Check API and account status
ndd_sdk.checkStatus().then(({ success, info, data }) => {
console.log('success:', success)
console.log('info:', info)
console.log('data', data)
}).catch(error => {
console.log('Server Error')
console.error(error)
})
// Get data
ndd_sdk.getData('NodeSDK_Test_003').then((redata) => {
console.log('Read data', redata)
console.log('success:', redata.success)
console.log('info:', redata.info)
console.log('data', redata.data)
console.log('TableID', redata.__id)
}).catch(err => {
console.log('Server Error')
console.error(err)
})