import { usePost, stringify, useGet } from "@/.cool"; export type LoginData = { access_token: string; refresh_token: string; } export interface GetInfoResult { permissions: any[] roles: any[] sysRoles: any[] userInfo: any } export interface CONFIG_OPEN_CHILDREN_ALL { code: string name: string id: string content: string description: string type: number openFlag: boolean } export interface DICT_CHILDREN_ALL { code: string label: string value: string } export interface CONFIG_OPEN_VALUE { [key: string]: string } export interface DICT_DATA { 'config:open:children-all': CONFIG_OPEN_CHILDREN_ALL[] 'config:open:value': CONFIG_OPEN_VALUE 'dict:children': { [key: string]: CONFIG_OPEN_VALUE } 'dict:value:obj': { [key: string]: CONFIG_OPEN_VALUE } 'dict:value': { [key: string]: CONFIG_OPEN_VALUE } 'dict:code': { [key: string]: CONFIG_OPEN_VALUE } 'dict:label': { [key: string]: CONFIG_OPEN_VALUE } 'dict:children-all': { [key: string]: DICT_CHILDREN_ALL[] } } export function loginApi(params) { return usePost(`/oauth/token?${stringify(params)}`) as Promise } export function sendSmsCode(params) { return usePost(`/verify/sms/code/send`, params) as Promise } export function getUsersInfo() { return useGet(`/upms/users/info`) as Promise } export function dictData() { return useGet(`/upms/dicts/data`) as Promise }