user.js 651 B

12345678910111213141516171819202122
  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 updateUserInfo(name,birthday,avatar){
  11. const res = await this.getRequest(`${this.BASE_URL}User/editUser?name=${name}&birthday=${brithday}&avatar=${avatar}`)
  12. }
  13. static async getUserById(userId){
  14. const res = await this.getRequest(`${this.BASE_URL}User/read?id=${userId}`)
  15. return res.data
  16. }
  17. }
  18. export default store