Closed xoptimal closed 3 years ago
@yesmeck help me, please~
interface Data {
...
}
const res = await request<Data>(url, {
method: method,
params: body,
});
抱歉, 这个request 不是纯粹的 umi-request , 经过了一层 extend ~
const request = extend({
errorHandler, // 默认错误处理
timeout: 10 * 1000,
getResponse: true,
// parseResponse: false,
// credentials: 'include', // 默认请求是否带上cookie
});
以上这样调用的, 查看源码后, 是这样的:
export interface Extend {
(options: ExtendOptionsWithoutResponse): RequestMethod<false>;
(options: ExtendOptionsWithResponse): RequestMethod<true>;
(options: ExtendOptionsInit): RequestMethod;
}
请问怎么保留之前的 reqeust
应该是一样的用法。
下面这个T , 我该如何声明 ???