Complete main UI #37
@@ -1,9 +1,9 @@
|
||||
import React, { useEffect, useState } from 'react'
|
||||
import FitFullScreen from '@/components/common/FitFullScreen.tsx'
|
||||
import HideScrollbar from '@/components/common/HideScrollbar.tsx'
|
||||
import FlexBox from '@/components/common/FlexBox.tsx'
|
||||
import Icon from '@ant-design/icons'
|
||||
import Card from '@/components/common/Card.tsx'
|
||||
import FitFullScreen from '@/components/common/FitFullScreen'
|
||||
import HideScrollbar from '@/components/common/HideScrollbar'
|
||||
import FlexBox from '@/components/common/FlexBox'
|
||||
import Card from '@/components/common/Card'
|
||||
import {
|
||||
COLOR_ERROR_SECONDARY,
|
||||
COLOR_FONT_SECONDARY,
|
||||
@@ -13,8 +13,8 @@ import {
|
||||
DATABASE_INSERT_SUCCESS,
|
||||
DATABASE_SELECT_SUCCESS,
|
||||
DATABASE_UPDATE_SUCCESS
|
||||
} from '@/constants/common.constants.ts'
|
||||
import { getLocalTime } from '@/utils/common.tsx'
|
||||
} from '@/constants/common.constants'
|
||||
import { getLocalTime } from '@/utils/common'
|
||||
import {
|
||||
r_sys_group_add,
|
||||
r_sys_group_change_status,
|
||||
@@ -23,7 +23,7 @@ import {
|
||||
r_sys_group_get,
|
||||
r_sys_group_update,
|
||||
r_sys_role_get_list
|
||||
} from '@/services/system.tsx'
|
||||
} from '@/services/system'
|
||||
|
||||
const Group: React.FC = () => {
|
||||
const [modal, contextHolder] = AntdModal.useModal()
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import React from 'react'
|
||||
import { r_getUserList } from '@/services/user'
|
||||
import { r_sys_user } from '@/services/system'
|
||||
import { COLOR_BACKGROUND, DATABASE_SELECT_SUCCESS } from '@/constants/common.constants'
|
||||
import { ColumnsType } from 'antd/es/table/interface'
|
||||
|
||||
@@ -32,7 +32,7 @@ const User: React.FC = () => {
|
||||
]
|
||||
|
||||
useEffect(() => {
|
||||
r_getUserList().then((res) => {
|
||||
r_sys_user().then((res) => {
|
||||
const data = res.data
|
||||
if (data.code === DATABASE_SELECT_SUCCESS) {
|
||||
data.data && setUserList(data.data)
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import request from '@/services'
|
||||
import { URL_API_LOGIN, URL_API_LOGOUT } from '@/constants/urls.constants'
|
||||
|
||||
export const r_login = (username: string, password: string) =>
|
||||
export const r_auth_login = (username: string, password: string) =>
|
||||
request.post<TokenVo>(URL_API_LOGIN, {
|
||||
username,
|
||||
password
|
||||
})
|
||||
|
||||
export const r_logout = () => request.post(URL_API_LOGOUT)
|
||||
export const r_auth_logout = () => request.post(URL_API_LOGOUT)
|
||||
|
||||
@@ -1,16 +1,19 @@
|
||||
import React from 'react'
|
||||
import request from '@/services/index'
|
||||
import {
|
||||
URL_API_SYS_LOG,
|
||||
URL_API_SYS_USER_INFO,
|
||||
URL_API_SYS_USER,
|
||||
URL_API_SYS_POWER_LIST,
|
||||
URL_API_SYS_ROLE,
|
||||
URL_API_SYS_ROLE_LIST,
|
||||
URL_API_SYS_GROUP,
|
||||
URL_API_SYS_GROUP_LIST
|
||||
URL_API_SYS_GROUP_LIST,
|
||||
URL_API_SYS_LOG
|
||||
} from '@/constants/urls.constants'
|
||||
|
||||
export const r_sys_log_get = (param: SysLogGetParam) =>
|
||||
request.get<PageVo<SysLogGetVo>>(URL_API_SYS_LOG, { ...param })
|
||||
export const r_sys_user_info = () => request.get<UserWithPowerInfoVo>(URL_API_SYS_USER_INFO)
|
||||
|
||||
export const r_sys_user = () => request.get<UserWithRoleInfoVo[]>(URL_API_SYS_USER)
|
||||
|
||||
export const r_sys_power_get_list = () => request.get<PowerSetVo>(URL_API_SYS_POWER_LIST)
|
||||
|
||||
@@ -51,3 +54,6 @@ export const r_sys_group_delete = (id: string) => request.delete(`${URL_API_SYS_
|
||||
|
||||
export const r_sys_group_delete_list = (ids: React.Key[]) =>
|
||||
request.delete(URL_API_SYS_GROUP, { ids })
|
||||
|
||||
export const r_sys_log_get = (param: SysLogGetParam) =>
|
||||
request.get<PageVo<SysLogGetVo>>(URL_API_SYS_LOG, { ...param })
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
import request from '@/services'
|
||||
import { URL_API_SYS_USER_INFO, URL_API_SYS_USER } from '@/constants/urls.constants'
|
||||
|
||||
export const r_getInfo = () => request.get<UserWithPowerInfoVo>(URL_API_SYS_USER_INFO)
|
||||
|
||||
export const r_getUserList = () => request.get<UserWithRoleInfoVo[]>(URL_API_SYS_USER)
|
||||
@@ -1,6 +1,6 @@
|
||||
import { getCaptcha, getLocalStorage, removeToken, setLocalStorage } from './common'
|
||||
import { r_login, r_logout } from '@/services/auth'
|
||||
import { r_getInfo } from '@/services/user'
|
||||
import { r_auth_login, r_auth_logout } from '@/services/auth'
|
||||
import { r_sys_user_info } from '@/services/system'
|
||||
import {
|
||||
STORAGE_TOKEN_KEY,
|
||||
STORAGE_USER_INFO_KEY,
|
||||
@@ -10,11 +10,11 @@ import {
|
||||
let captcha: Captcha
|
||||
|
||||
export const login = async (username: string, password: string) => {
|
||||
return await r_login(username, password)
|
||||
return await r_auth_login(username, password)
|
||||
}
|
||||
|
||||
export const logout = async () => {
|
||||
return r_logout().finally(() => {
|
||||
return r_auth_logout().finally(() => {
|
||||
removeToken()
|
||||
})
|
||||
}
|
||||
@@ -37,7 +37,7 @@ export const getUserInfo = async (): Promise<UserWithPowerInfoVo> => {
|
||||
export const requestUserInfo = async () => {
|
||||
let user: UserWithPowerInfoVo | null
|
||||
|
||||
await r_getInfo().then((value) => {
|
||||
await r_sys_user_info().then((value) => {
|
||||
const response = value.data
|
||||
if (response.code === DATABASE_SELECT_SUCCESS) {
|
||||
user = response.data
|
||||
|
||||
Reference in New Issue
Block a user