starter.factory('SigninReport', function ($resource, $q, $filter, cfg, formatFilter, global) { return { report: $resource(formatFilter('{0}ext_erp/Attendance/GetAttendance/', cfg.api)), item: $resource(formatFilter('{0}ext_erp/Query/GetData/?table=SZ_BASE_3&page=0', cfg.api)), reportdata: [], filter: {"choice_date": 4, "cz_list": "","trs_dd":""} } }) .config(function ($httpProvider) { $httpProvider.interceptors.push(function ($q, cfg, global) { return { 'request': function (config) { if (config.url.indexOf("ext_erp") != -1) { config.headers['cid'] = JSON.stringify({"linkid": global.user.compno, "langid": "TW", "phone": global.user.cellphone}); } return config; } }; }); })