user.js 1000 B

1234567891011121314151617181920212223242526272829303132333435
  1. import request from '../utils/request.js'
  2. class store extends request{
  3. // static errorHandel(res) {
  4. // console.log(res);
  5. // }
  6. static async userLogin(data) {
  7. const res = await this.postRequest(`${this.COUPON_URL}tiktok/decode-login`, data)
  8. return res.data;
  9. }
  10. static async getMobile(data) {
  11. const res = await this.postRequest(`${this.BASE_URL}User/getMobile`, data)
  12. return res.data;
  13. }
  14. static async updateUserInfo(name,birthday,avatar,sex){
  15. const res = await this.postRequest(`${this.BASE_URL}User/editUser?name=${name}&birthday=${birthday}&avatar=${avatar}&sex=${sex}`)
  16. return res.data
  17. }
  18. static async getUserById(userId){
  19. const res = await this.getRequest(`${this.BASE_URL}User/read?id=${userId}`)
  20. return res.data
  21. }
  22. static async recharge(data){
  23. const res = await this.postRequest(`${this.BASE_URL}User/recharge`,data)
  24. return res.data
  25. }
  26. }
  27. export default store