factory.js 633 B

123456789101112131415
  1. starter.factory('User', function ($resource, $q, $filter, cfg, formatFilter, global,cfg) {
  2. global.erp_api = "http://192.168.1.36:13210/api/";
  3. return {
  4. user: function (actionname) {
  5. return $resource(formatFilter('{0}ext_erp/Comp/{1}/0/', cfg.api, actionname == undefined ? "" : actionname), {},
  6. {
  7. post: {
  8. method: "POST",
  9. headers: {"cid": JSON.stringify({"linkid": global.user.compno, "langid": "TW", "phone": global.user.cellphone}), "sn": "DEMO2017TW654327"}
  10. }
  11. })
  12. }
  13. };
  14. })