()
| 736 | } |
| 737 | |
| 738 | async function apiUpdate() { |
| 739 | const data = $.toObj($request.body) |
| 740 | const path = data.path.split('.') |
| 741 | const val = data.val |
| 742 | const key = path.shift() |
| 743 | // 必须用 hasOwnProperty:val 为 false 时 data.val && … 会误判为跳过更新 |
| 744 | if (path.join('.') && Object.prototype.hasOwnProperty.call(data, 'val')) { |
| 745 | switch (key) { |
| 746 | case 'usercfgs': |
| 747 | const usercfgs = getUserCfgs() |
| 748 | update(usercfgs, path.join('.'), val) |
| 749 | $.setjson(usercfgs, $.KEY_usercfgs) |
| 750 | break |
| 751 | default: |
| 752 | break |
| 753 | } |
| 754 | } |
| 755 | $.json = getBoxData() |
| 756 | } |
| 757 | |
| 758 | async function apiAddAppSub() { |
| 759 | const sub = $.toObj($request.body) |
nothing calls this directly
no test coverage detected
searching dependent graphs…