页面UI更新
This commit is contained in:
@@ -1,6 +1,15 @@
|
||||
import http from './request'
|
||||
import { get } from './http'
|
||||
|
||||
/** 将 xk-api 的 code/result 格式转为旧版 errcode/data,兼容现有页面 */
|
||||
function normalizeXkApiResponse(res) {
|
||||
if (res && res.data && (res.data.code === 0 || res.data.code === '0')) {
|
||||
res.data.errcode = 0;
|
||||
res.data.data = res.data.result;
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
// 登录 授权 其他手机号授权
|
||||
export async function getsLogin(params) {
|
||||
let data = await http('/oldApi/v1/user/login', params)
|
||||
@@ -34,20 +43,20 @@ export async function getAgreem(params) {
|
||||
|
||||
// 首页 门店 门店切换
|
||||
export async function storeChange(params) {
|
||||
let data = await http('/oldApi/v1/store/store-change', params)
|
||||
return data
|
||||
let data = await http('/xkApi/store/store-change', params)
|
||||
return normalizeXkApiResponse(data)
|
||||
}
|
||||
|
||||
// 首页 门店 用户所有门店
|
||||
export async function storeList(params) {
|
||||
let data = await http('/oldApi/v1/store/list', params)
|
||||
return data
|
||||
let data = await http('/xkApi/store/list', params)
|
||||
return normalizeXkApiResponse(data)
|
||||
}
|
||||
|
||||
// 首页 门店 门店信息
|
||||
export async function storeInfo(params) {
|
||||
let data = await http('/oldApi/v1/store/info', params)
|
||||
return data
|
||||
let data = await http('/xkApi/store/info', params)
|
||||
return normalizeXkApiResponse(data)
|
||||
}
|
||||
|
||||
// 医生列表
|
||||
|
||||
Reference in New Issue
Block a user