import {stringify} from 'qs';
import request from './../utils/request';

export async function authLogin(params) {
    let formdata = new FormData();
    formdata.append('token', params.token);

    return request('/account/token_refresh/', {
        method: 'POST',
        body: formdata,
    });
}

export async function login(params) {
    let formdata = new FormData();
    formdata.append('username', params.username);
    formdata.append('password', params.password);

    return request('/account/login/', {
        method: 'POST',
        body: formdata,
    });
}

export async function loginOut() {
    return request(`/touchd/rn/login_out/`);
}

export async function queryTipsCount() {
    return request(`/customer/list_count/`);
}


//修改密码
export async function changePassword(params) {
    let formdata = new FormData();
    formdata.append('old_password', params.old_password);
    formdata.append('confirm_password', params.new_password_repeat);
    formdata.append('new_password', params.new_password);
    return request(`/account/employee/change_password/?id=` + params.user_id, {
        method: 'POST',
        body: formdata,
    });
}

