user.js 842 B

1234567891011121314151617181920212223242526272829
  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.BASE_URL}User/save`, 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. }
  23. export default store