import { request } from '../../utils/umiExport'; // @ts-ignore import bcrypt from 'bcryptjs'; const V4_LOGIN = '/api/af-auth/login' const V3_LOGIN = '/rs/logic/getLogin' // const V4_LOGOUT = '/auth/logout' const ROUTES = `/rs/user/userLogin/` export async function V4_Login(username: string, password: string) { return request(V4_LOGIN, { method: 'POST', data: { username, password: bcrypt.hashSync(password, 10), } }); } export async function V3_Login(username: string, password: string) { return request(V3_LOGIN, { method: 'POST', data: { name: username, password } }); } export async function getRoutesConfig(data: string | false, moduls: string) { return request(ROUTES + moduls, { method: 'POST', data }); }