123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990 |
- import {
- http
- } from '@/utils/http';
- import {
- getToken
- } from '@/utils/auth';
- import ENV from '@/config/env.js';
- /**
- * 解开访问令牌
- * @param {object} data 请求数据
- * @param {string} data.access_token 访问令牌
- */
- export function ParseAccessToken(data) {
- return http.post(ENV.VUE_APP_FileServer + `?MethodName=login_control-ParseAccessToken`, data);
- }
- /**
- * @description 得到验证码图像
- */
- export function GetVerificationCodeImage() {
- return http.get(ENV.VUE_APP_FileServer + `?MethodName=login_control-GetVerificationCodeImage`);
- }
- /**
- * @description 得到系统标志
- * @param {object} data 请求数据
- */
- export function GetLogo(data) {
- return http.post(ENV.VUE_APP_FileServer + `?MethodName=sys_config_manager-GetLogo`, data);
- }
- /**
- * @description 得到文件 ID 与 URL 的映射
- * @param {object} data 请求数据
- */
- export function GetFileURLMap(data) {
- return http.post(ENV.VUE_APP_FileServer + `?MethodName=file_store_manager-GetFileURLMap`, data);
- }
- /**
- * @description 得到文件存储信息
- * @param {object} data 请求数据
- */
- export function GetFileStoreInfo(data) {
- return http.post(ENV.VUE_APP_FileServer + `?MethodName=file_store_manager-GetFileStoreInfo`, data);
- }
- /**
- * @description 上传文件
- * @param {String} SecurityLevel 保密级别
- * @param {object} file 文件对象
- */
- export function fileUpload(SecurityLevel, file) {
- let formData = null;
- if (file instanceof FormData) {
- formData = file;
- } else if (file instanceof Array) {
- formData = new FormData();
- file.map(p => {
- formData.append(p.filename, p.file, p.file.name);
- })
- } else {
- formData = new FormData();
- formData.append(file.filename, file.file, file.file.name);
- }
- return http.postForm('/GCLSFileServer/WebFileUpload', formData, {
- params: {
- SecurityLevel,
- },
- transformRequest: [
- (data) => {
- return data;
- },
- ],
- timeout: 0,
- });
- }
- /**
- * @description 获取静态资源
- * @param {String} MethodName 方法名称
- * @param {object} data 请求数据:base64_text(需要生成文件的 Base64 编码文本),file_suffix_name(文件后缀名)
- */
- export function GetStaticResources(MethodName, data) {
- return http.post(ENV.VUE_APP_FileServer + `?MethodName=${MethodName}`, data);
- }
|