login.js 533 B

123456789101112131415
  1. import request from './request.js';
  2. import { BASE_URL } from '../env.js';
  3. const login = async (data) => {
  4. const res = await request.post({ url: `/user/login`, data });
  5. return res.data;
  6. }
  7. const getPhone = async (data) => {
  8. const res = await request.post({ url: `/wxa/business/getuserphonenumber?appid=${data.appid}`, data: { code: data.code } });
  9. return res.data;
  10. }
  11. const getJson = async () => {
  12. const res = await request.get({ url: `${BASE_URL.imgUrl}/config.json` });
  13. return res;
  14. }
  15. export default { login, getPhone, getJson };