|
@@ -109,6 +109,9 @@ app.config(['$httpProvider', '$stateProvider', '$urlRouterProvider', 'ADDRESS',
|
109
|
109
|
app.config(function ($httpProvider) {
|
110
|
110
|
$httpProvider.interceptors.push('sessionInjector');
|
111
|
111
|
});
|
|
112
|
+app.run(['$rootScope', function ($rootScope) {
|
|
113
|
+ $rootScope.serverIp = serverIp;
|
|
114
|
+}]);
|
112
|
115
|
|
113
|
116
|
//拦截器
|
114
|
117
|
//$httpProvider.interceptors 不能注入$http和引用了$http的服务,否则会报依赖注入错误。
|
|
@@ -444,6 +447,27 @@ app.factory('api_bpm', ['BpmRestangular', function (BpmRestangular) {
|
444
|
447
|
|
445
|
448
|
};
|
446
|
449
|
}]);
|
|
450
|
+app.factory('WechatRestangularSeimin', ['Restangular', 'ADDRESS', function(Restangular, address) {
|
|
451
|
+ return Restangular.withConfig(function(RestangularConfigurer) {
|
|
452
|
+ // RestangularConfigurer.setBaseUrl(address.serverIp + address.serverIpPort + address.api + '/common/');
|
|
453
|
+ RestangularConfigurer.setBaseUrl(address.serverIp + address.serverIpPort + '/service' + '/common/');
|
|
454
|
+ });
|
|
455
|
+}]);
|
|
456
|
+app.factory('api_wechatfile', ['WechatRestangularSeimin', function(WechatRestangularSeimin) {
|
|
457
|
+ var dataService = WechatRestangularSeimin.all("common");
|
|
458
|
+ return {
|
|
459
|
+ listAttachments: function(type, model) {
|
|
460
|
+ return dataService.customGET('listAttachment/' + type + "/" + model, {});
|
|
461
|
+ // return dataService.one('listAttachment/' + type + "/" + model);
|
|
462
|
+ },
|
|
463
|
+ downloadAttachment: function(model) {
|
|
464
|
+ return dataService.one('downloadAttachment/' + model, {});
|
|
465
|
+ },
|
|
466
|
+ getDictionary: function(data) {
|
|
467
|
+ return dataService.customPOST(data, 'getDictionary', {});
|
|
468
|
+ }
|
|
469
|
+ };
|
|
470
|
+}]);
|
447
|
471
|
|
448
|
472
|
app.factory('api_bpm_domain', ['BpmRestangular', 'CommonRestangular', 'WeChatRestangular', 'WeChatApply', function (BpmRestangular, CommonRestangular, WeChatRestangular, WeChatApply) {
|
449
|
473
|
var bpmService = BpmRestangular.all("bpm");
|
|
@@ -501,7 +525,7 @@ app.factory('api_bpm_domain', ['BpmRestangular', 'CommonRestangular', 'WeChatRes
|
501
|
525
|
return weChatService.one('saveAttachments/' + processId + '/' + taskId + '/' + userId);
|
502
|
526
|
},
|
503
|
527
|
uploadAttachment: function (processId, taskId, userId, data) {
|
504
|
|
- return commonService.one('uploadAttachment/' + 'webRequesterIncident/' + processId);
|
|
528
|
+ return commonService.one('uploadAttachment/' + 'wechatRequesterIncident/' + processId);
|
505
|
529
|
},
|
506
|
530
|
download: function (attachmentId) {
|
507
|
531
|
return bpmService.one('getAttachmentContent/' + attachmentId);
|