common.js 511 B

12345678910111213141516171819202122
  1. import BaseStore from '@src/stores/base';
  2. export default class CommonStore extends BaseStore {
  3. /**
  4. * 发送短信验证码
  5. * @param {*} area 区域码
  6. * @param {*} mobile 手机号
  7. */
  8. sendSms(area, mobile) {
  9. return this.apiPost('/common/sms/valid', { area, mobile });
  10. }
  11. /**
  12. * 上传至本地服务器
  13. * @param {*} file 图片文件
  14. */
  15. upload(file) {
  16. return this.apiForm('/common/upload/image', { file });
  17. }
  18. }
  19. export const Common = new CommonStore({ key: 'common' });