Loading…

Lock

```javascript WXAPI.distributedLock(key, seconds) ``` + key custom lock name + seconds is the maximum locking time (unit is seconds). If the lock is not actively unlocked after this time, the system will automatically unlock it. ```json { "code": 0, "msg": "success" } { "code": 10000, "msg": "The lock is occupied, please try again later" } ``` Determine whether you are eligible for locking based on whether `code` returns 0.