starter.config(function ($stateProvider, $httpProvider) { $stateProvider.state('erpbx', { url: '/index', templateUrl: 'templates/erpbx.html', controller: 'ErpBxCtrl' }) .state('erpbx-record', { url: '/erpbx-record/:id', templateUrl: 'templates/erpbx-record.html', controller: 'ErpBxRecordCtrl' }) .state('erpbx-bill', { url: '/erpbx-bill/:id', templateUrl: 'templates/erpbx-bill.html', controller: 'ErpBxBillCtrl' }) .state('erpbx-list', { url: '/erpbx-list/', templateUrl: 'templates/erpbx-list.html', controller: 'ErpBxListCtrl' }) $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; } }; }); });