addressService.js 881 Bytes
import BaseService from '../../../libs/services/baseService.js';

const UFO_ADDRESS_LIST = 'app.address.gethidden';
const UFO_ADDRESS_SET_DEFAULT = 'app.address.setdefault';

export default class AddressService extends BaseService {
  async fetchAddressList(params, complete) {
    return await this.GET(
      {
        ...params,
        method: UFO_ADDRESS_LIST
      },
      {
        complete
      }
    ).then((data) => {
      return data;
    }).catch((error) => {
      // 这里请抛出异常,不要return
      throw error;
    })
  }

  async fetchAddressDefault(params, complete) {
    return await this.GET(
      {
        ...params,
        method: UFO_ADDRESS_SET_DEFAULT
      },
      {
        complete
      }
    ).then((data) => {
      return data;
    }).catch((error) => {
      // 这里请抛出异常,不要return
      throw error;
    })
  }
}