-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAB_GROUP.js
More file actions
36 lines (30 loc) · 860 Bytes
/
AB_GROUP.js
File metadata and controls
36 lines (30 loc) · 860 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
'use strict';
// ab 对照用户
/**
* todo TOOLS
*/
Object.defineProperty(exports, "__esModule", {
value: true
});
var _config = require('./APP/config');
var name = 'AB_GROUP';
var AB_GROUP = function AB_GROUP(ruleId) {
var fn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function (_) {};
if (typeof fn === 'function') {
(0, _config.WinJSDec)(function (_) {
window.WinJSBridge.call('abtest', 'getGroup', { ruleId: ruleId }, function (res) {
var code = res.code,
response = res.response;
if (code == 0) {
fn(response);
} else {
throw new Error('[' + name + '] ' + _config.appError);
}
});
});
} else {
throw new TypeError('[' + name + '] ' + _config.fnError);
}
};
exports.default = AB_GROUP;
//# sourceMappingURL=AB_GROUP.js.map