personInfo.js 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. import request from '@/utils/request'
  2. import constant from '@/constant'
  3. import { getToken } from "@/utils/auth"; // get token from cookie
  4. function pageList(formData) {
  5. return request.post(constant.serverUrl + "/base/personInfo/pageList", formData);
  6. }
  7. function create() {
  8. return request.get(constant.serverUrl + "/base/personInfo/create");
  9. }
  10. function edit(id) {
  11. return request.get(constant.serverUrl + "/base/personInfo/edit/" + id);
  12. }
  13. function add(formModel) {
  14. return request.post(constant.serverUrl + "/base/personInfo/add", formModel, {
  15. headers: {
  16. "Content-Type": "application/json"
  17. }
  18. });
  19. }
  20. function update(formModel) {
  21. return request.post(constant.serverUrl + "/base/personInfo/update", formModel, {
  22. headers: {
  23. "Content-Type": "application/json"
  24. }
  25. });
  26. }
  27. function remove(id) {
  28. return request.post(constant.serverUrl + "/base/personInfo/delete/" + id);
  29. }
  30. function batchRemove(idList) {
  31. return request.post(constant.serverUrl + "/base/personInfo/batchDelete", idList, {
  32. headers: {
  33. "Content-Type": "application/json"
  34. }
  35. });
  36. }
  37. function exportXls(formData) {
  38. //导出xls
  39. return request.post(constant.serverUrl + "/base/personInfo/exportXls", formData);
  40. //window.open(constant.serverUrl + "/base/personInfo/exportXls?token=" + getToken());
  41. }
  42. function enabledFace(formData) {
  43. //人脸授权
  44. return request.post(constant.serverUrl + "/base/personInfo/enabledFace", formData);
  45. }
  46. function enabledFaceList(ids) {
  47. //批量人脸授权
  48. return request.post(constant.serverUrl + "/base/personInfo/enabledFaceList", ids, {
  49. headers: {
  50. "Content-Type": "application/json"
  51. }
  52. });
  53. }
  54. function enabledCard(formData) {
  55. //刷卡授权
  56. return request.post(constant.serverUrl + "/base/personInfo/enabledCard", formData);
  57. }
  58. function enabledApp(formData) {
  59. //手机授权
  60. return request.post(constant.serverUrl + "/base/personInfo/enabledApp", formData);
  61. }
  62. function enabledWechatNotice(formData) {
  63. //接收微信通知
  64. return request.post(constant.serverUrl + "/base/personInfo/enabledWechatNotice", formData);
  65. }
  66. function enabledGuest(formData) {
  67. //访客授权
  68. return request.post(constant.serverUrl + "/base/personInfo/enabledGuest", formData);
  69. }
  70. function dataSync(idList) {
  71. //数据同步
  72. return request.post(constant.serverUrl + "/base/personInfo/dataSync", idList, {
  73. headers: {
  74. "Content-Type": "application/json"
  75. }
  76. });
  77. }
  78. export default {
  79. pageList, create, edit, add, update, remove, batchRemove, exportXls,
  80. enabledFace, enabledCard, enabledApp, enabledGuest, dataSync, enabledFaceList,
  81. enabledWechatNotice
  82. }