factory.js 837 B

123456789101112131415161718192021
  1. starter.factory('SigninReport', function ($resource, $q, $filter, cfg, formatFilter, global) {
  2. return {
  3. report: $resource(formatFilter('{0}ext_erp/Attendance/GetAttendance/', cfg.api)),
  4. item: $resource(formatFilter('{0}ext_erp/Query/GetData/?table=SZ_BASE_3&page=0', cfg.api)),
  5. reportdata: [],
  6. filter: {"choice_date": 4, "cz_list": "","trs_dd":""}
  7. }
  8. })
  9. .config(function ($httpProvider) {
  10. $httpProvider.interceptors.push(function ($q, cfg, global) {
  11. return {
  12. 'request': function (config) {
  13. if (config.url.indexOf("ext_erp") != -1) {
  14. config.headers['cid'] = JSON.stringify({"linkid": global.user.compno, "langid": "TW", "phone": global.user.cellphone});
  15. }
  16. return config;
  17. }
  18. };
  19. });
  20. })