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