提交 fe15de9c 编写于 作者: taohebin@dcloud.io's avatar taohebin@dcloud.io

fix: request请求改为泛型

上级 4d6d19f9
......@@ -62,19 +62,17 @@
let data = {
column: 'id,post_id,title,author_name,cover,published_at' //需要的字段名
};
uni.request({
uni.request<Banner>({
url: 'https://unidemo.dcloud.net.cn/api/banner/36kr',
data: data,
success: data => {
if(this.pageVisible){
this.refresherTriggered = false
if (data.statusCode == 200) {
let result = data.data as UTSJSONObject;
this.banner = {
cover: result["cover"] as string,
title: result["title"] as string,
post_id: result["post_id"] as string
} as Banner;
const result = data.data
if(result != null){
this.banner = result;
}
}
}
},
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册