样式修改完成,待测试
This commit is contained in:
+16
-2
@@ -768,6 +768,19 @@ const ApiClient = {
|
||||
const params = this.normalizePageParams(data || {});
|
||||
const code = params.code || params.suoxie || params.lotteryCode || '';
|
||||
const pageSize = params.pageSize || params.limit || params.count || 100;
|
||||
const normalizeResponse = (res) => {
|
||||
if (!this.isSuccess(res)) return res;
|
||||
const payload = this.pickData(res, {});
|
||||
const list = this.asArray(payload);
|
||||
return Object.assign({}, res, {
|
||||
code: 0,
|
||||
success: true,
|
||||
data: list,
|
||||
rawData: payload,
|
||||
rows: list,
|
||||
records: list,
|
||||
});
|
||||
};
|
||||
if (code && this.API.lotteryTrend) {
|
||||
try {
|
||||
const trendRes = await this.get(this.API.lotteryTrend, {
|
||||
@@ -775,13 +788,14 @@ const ApiClient = {
|
||||
pageSize,
|
||||
});
|
||||
if (this.isSuccess(trendRes) && this.asArray(this.pickData(trendRes, [])).length) {
|
||||
return trendRes;
|
||||
return normalizeResponse(trendRes);
|
||||
}
|
||||
} catch (e) {
|
||||
// Fall back to the older result-list endpoint below.
|
||||
}
|
||||
}
|
||||
return this.requestWithMenu('/api/web/lottery/result/list', data);
|
||||
const listRes = await this.requestWithMenu('/api/web/lottery/result/list', data);
|
||||
return normalizeResponse(listRes);
|
||||
},
|
||||
|
||||
async loadLegacyExpertDetailCompat(data = {}) {
|
||||
|
||||
Reference in New Issue
Block a user