app.js 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. import { http } from '@/utils/http';
  2. /**
  3. * @description 得到验证码图像
  4. */
  5. export function GetVerificationCodeImage() {
  6. return http.get(`${process.env.VUE_APP_FileServer}?MethodName=login_control-GetVerificationCodeImage`);
  7. }
  8. /**
  9. * @description 得到系统标志
  10. * @param {object} data 请求数据
  11. */
  12. export function GetLogo(data) {
  13. return http.post(`${process.env.VUE_APP_FileServer}?MethodName=sys_config_manager-GetLogo`, data);
  14. }
  15. /**
  16. * 得到文件 ID 与 URL 的映射
  17. */
  18. export function GetFileURLMap(data) {
  19. return http.post(`${process.env.VUE_APP_FileServer}?MethodName=file_store_manager-GetFileURLMap`, data);
  20. }
  21. /**
  22. * 得到文件存储信息
  23. */
  24. export function GetFileStoreInfo(data) {
  25. return http.post(`${process.env.VUE_APP_FileServer}?MethodName=file_store_manager-GetFileStoreInfo`, data);
  26. }
  27. /**
  28. * 得到用户能进入的子系统列表(电脑端)
  29. */
  30. export function GetChildSysList_CanEnter_PC(data) {
  31. return http.post(`${process.env.VUE_APP_FileServer}?MethodName=login_control-GetChildSysList_CanEnter_PC`, data);
  32. }
  33. /**
  34. * 上传文件
  35. * @param {String} SecurityLevel 保密级别
  36. * @param {object} file 文件对象
  37. */
  38. export function fileUpload(SecurityLevel, file) {
  39. let formData = null;
  40. if (file instanceof FormData) {
  41. formData = file;
  42. } else {
  43. formData = new FormData();
  44. formData.append(file.filename, file.file, file.file.name);
  45. }
  46. return http.postForm('/GCLSFileServer/WebFileUpload', formData, {
  47. params: {
  48. SecurityLevel,
  49. },
  50. transformRequest: [
  51. (data) => {
  52. return data;
  53. },
  54. ],
  55. timeout: 0,
  56. });
  57. }