route.js 1.1 KB

123456789101112131415161718192021222324252627282930313233343536
  1. starter.config(function ($stateProvider, $httpProvider) {
  2. $stateProvider.state('erpbx', {
  3. url: '/index',
  4. templateUrl: 'templates/erpbx.html',
  5. controller: 'ErpBxCtrl'
  6. })
  7. .state('erpbx-record', {
  8. url: '/erpbx-record/:id',
  9. templateUrl: 'templates/erpbx-record.html',
  10. controller: 'ErpBxRecordCtrl'
  11. })
  12. .state('erpbx-bill', {
  13. url: '/erpbx-bill/:id',
  14. templateUrl: 'templates/erpbx-bill.html',
  15. controller: 'ErpBxBillCtrl'
  16. })
  17. .state('erpbx-list', {
  18. url: '/erpbx-list/',
  19. templateUrl: 'templates/erpbx-list.html',
  20. controller: 'ErpBxListCtrl'
  21. })
  22. $httpProvider.interceptors.push(function ($q, cfg, global) {
  23. return {
  24. 'request': function (config) {
  25. if (config.url.indexOf("ext_erp") != -1) {//分页时自带了请求路径
  26. config.headers['cid'] = JSON.stringify({"linkid": global.user.compno, "langid": "TW", "phone": global.user.cellphone});
  27. }
  28. return config;
  29. }
  30. };
  31. });
  32. });