You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

38 lines
704 B

import { fetch } from '../../../utils/util';
export class PathParams {
/** fileName */
fileName = '';
[key: string]: any;
}
export type ResponseType = Promise<any>;
export const URL = '/api/image/get/{fileName}';
/**
* @desc 获取文件
*/
export function request(
pathParams: PathParams,
options?: WechatMiniprogram.RequestOption,
): ResponseType {
let url = '/api/image/get/{fileName}';
for (let key in pathParams) {
url.replace('{' + key + '}', pathParams[key]);
}
const fetchOption = Object.assign(
{
url: url,
method: 'GET',
headers: {
'Content-Type': 'application/json',
},
},
options,
);
return fetch(fetchOption);
}