import request from '../utils/request.js'

class store extends request{

    // static errorHandel(res) {
    //     console.log(res);
    // }

    static async userLogin(data) {
        const res = await this.postRequest(`${this.BASE_URL}User/save`, data)
        return res.data;
    }
    static async updateUserInfo(name,birthday,avatar,sex){
        const res = await this.getRequest(`${this.BASE_URL}User/editUser?name=${name}&birthday=${birthday}&avatar=${avatar}&sex=${sex}`)
    }
    static async getUserById(userId){
        const res = await this.getRequest(`${this.BASE_URL}User/read?id=${userId}`)
        return res.data
    }
}
export default store
