personInfo.js 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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() {
  38. //导出xls
  39. //return request.post(constant.serverUrl + "/base/personInfo/exportXls");
  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 enabledCard(formData) {
  47. //刷卡授权
  48. return request.post(constant.serverUrl + "/base/personInfo/enabledCard", formData);
  49. }
  50. function enabledApp(formData) {
  51. //手机授权
  52. return request.post(constant.serverUrl + "/base/personInfo/enabledApp", formData);
  53. }
  54. function enabledGuest(formData) {
  55. //访客授权
  56. return request.post(constant.serverUrl + "/base/personInfo/EnabledGuest", formData);
  57. }
  58. export default {
  59. pageList, create, edit, add, update, remove, batchRemove, exportXls,
  60. enabledFace,enabledCard,enabledApp,enabledGuest
  61. }