12345678910111213141516171819202122232425262728293031323334353637383940 |
- import { RSA } from "@/utils/crypto";
- import { post, Result } from "../base";
- /**
- * 用户登录换取token
- * @param username 用户名
- * @param password 密码
- */
- export function login(username: string, password: string) {
- return post<any, Result<any>>("/auth/login", {
- username: username,
- password: RSA.encrypt(password)
- });
- }
- /**
- * 登出
- *
- * @returns .
- */
- export function logout() {
- return post<any, Result<any>>("/auth/logout", {});
- }
- /**
- * 验证谷歌验证器
- *
- * @returns .
- */
- export function createGoogleOtp() {
- return get<any, Result<any>>("/auth/googleOtp/create", {});
- }
- /**
- * 验证谷歌验证器
- *
- * @returns .
- */
- export function save(data: any) {
- return post<any, Result<any>>("/auth/googleOtp/save", data);
- }
|