import BaseStore from '@src/stores/base';

export default class CommonStore extends BaseStore {
  /**
   * 发送短信验证码
   * @param {*} mobile 手机号
   */
  sendSms(mobile) {
    return this.apiPost('/common/sms/valid', { mobile });
  }

  /**
   * 上传至本地服务器
   * @param {*} file 图片文件
   */
  upload(file) {
    return this.apiForm('/common/upload/image', { file });
  }
}

export const Common = new CommonStore({ key: 'common' });
