(id, har)
| 100 | } |
| 101 | |
| 102 | function accept(id, har) { |
| 103 | const key = har.url.replace(/(.*accounts\/)(.*)(\/apps)/, '$2') |
| 104 | return $.http |
| 105 | .post({ |
| 106 | url: `https://testflight.apple.com/v3/accounts/${key}/ru/${id}/accept`, |
| 107 | headers: getHeaders(har) |
| 108 | }) |
| 109 | .then((resp) => { |
| 110 | const result = JSON.parse(resp.body) |
| 111 | return [true, '加入成功', result] |
| 112 | }) |
| 113 | .catch(() => { |
| 114 | return [false, '加入失败', null] |
| 115 | }) |
| 116 | } |
| 117 | |
| 118 | function getHeaders(har) { |
| 119 | const userAgent = har.headers['user-agent'] |
no test coverage detected