fix
This commit is contained in:
@@ -96,6 +96,11 @@ export const loginByPassword = (data: LoginByPasswordDTO) => {
|
||||
return http.request<ResponseData<TokenDTO>>("post", "/auth/login", { data });
|
||||
};
|
||||
|
||||
/** 登出接口 */
|
||||
export const userLogout = () => {
|
||||
return http.request<ResponseData<Boolean>>("post", "/auth/logout");
|
||||
};
|
||||
|
||||
/** 获取当前登录用户接口 */
|
||||
export const getLoginUserInfo = () => {
|
||||
return http.request<ResponseData<TokenDTO>>("get", "/getLoginUserInfo");
|
||||
|
||||
@@ -39,13 +39,9 @@ export interface UpdateConfigRequest {
|
||||
|
||||
/** 获取配置列表 */
|
||||
export const getConfigListApi = (params?: ConfigQuery) => {
|
||||
return http.request<ResponseData<PageDTO<ConfigDTO>>>(
|
||||
"get",
|
||||
"/system/configs",
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
return http.request<PageDTO<ConfigDTO>>("get", "/system/configs", {
|
||||
params
|
||||
});
|
||||
};
|
||||
|
||||
/** 获取配置信息 */
|
||||
|
||||
@@ -18,13 +18,9 @@ export interface OnlineUserInfo {
|
||||
|
||||
/** 获取操作日志列表 */
|
||||
export const getOnlineUserListApi = (params?: OnlineUserQuery) => {
|
||||
return http.request<ResponseData<PageDTO<OnlineUserInfo>>>(
|
||||
"get",
|
||||
"/monitor/onlineUsers",
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
return http.request<PageDTO<OnlineUserInfo>>("get", "/monitor/onlineUsers", {
|
||||
params
|
||||
});
|
||||
};
|
||||
|
||||
/** 强制登出用户 */
|
||||
|
||||
@@ -26,13 +26,9 @@ export type SystemNoticeRequest = {
|
||||
|
||||
/** 获取系统通知列表 */
|
||||
export const getSystemNoticeListApi = (params?: SystemNoticeQuery) => {
|
||||
return http.request<ResponseData<PageDTO<SystemNoticeDTO>>>(
|
||||
"get",
|
||||
"/system/notices",
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
return http.request<PageDTO<SystemNoticeDTO>>("get", "/system/notices", {
|
||||
params
|
||||
});
|
||||
};
|
||||
|
||||
/** 添加系统通知 */
|
||||
|
||||
@@ -21,13 +21,9 @@ export interface RoleDTO {
|
||||
}
|
||||
|
||||
export function getRoleListApi(params: RoleQuery) {
|
||||
return http.request<ResponseData<PageDTO<RoleDTO>>>(
|
||||
"get",
|
||||
"/system/role/list",
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
return http.request<PageDTO<RoleDTO>>("get", "/system/role/list", {
|
||||
params
|
||||
});
|
||||
}
|
||||
|
||||
export function getRoleInfoApi(roleId: number) {
|
||||
|
||||
@@ -86,7 +86,7 @@ export interface PasswordRequest {
|
||||
|
||||
/** 获取用户列表 */
|
||||
export const getUserListApi = (params?: UserQuery) => {
|
||||
return http.request<ResponseData<PageDTO<UserDTO>>>("get", "/system/users", {
|
||||
return http.request<PageDTO<UserDTO>>("get", "/system/users", {
|
||||
params
|
||||
});
|
||||
};
|
||||
|
||||
@@ -40,8 +40,8 @@ export function setTokenFromBackend(data: TokenDTO): void {
|
||||
const cookieString = JSON.stringify(data);
|
||||
Cookies.set(tokenKey, cookieString);
|
||||
|
||||
// useUserStoreHook().SET_USERNAME(data.currentUser.userInfo.username);
|
||||
// useUserStoreHook().SET_ROLES([data.currentUser.roleKey]);
|
||||
useUserStoreHook().SET_USERNAME(data.currentUser.userInfo.username);
|
||||
useUserStoreHook().SET_ROLES([data.currentUser.roleKey]);
|
||||
storageSession().setItem(sessionKey, data);
|
||||
}
|
||||
|
||||
|
||||
@@ -101,14 +101,14 @@ export function useHook() {
|
||||
CommonUtils.fillPaginationParams(searchFormParams, pagination);
|
||||
|
||||
pageLoading.value = true;
|
||||
const { data } = await getConfigListApi(toRaw(searchFormParams)).finally(
|
||||
() => {
|
||||
pageLoading.value = false;
|
||||
}
|
||||
);
|
||||
const { rows, total } = await getConfigListApi(
|
||||
toRaw(searchFormParams)
|
||||
).finally(() => {
|
||||
pageLoading.value = false;
|
||||
});
|
||||
|
||||
dataList.value = data.rows;
|
||||
pagination.total = data.total;
|
||||
dataList.value = rows;
|
||||
pagination.total = total;
|
||||
}
|
||||
|
||||
async function handleRefresh() {
|
||||
|
||||
@@ -86,14 +86,14 @@ export function useHook() {
|
||||
|
||||
pageLoading.value = true;
|
||||
|
||||
const { data } = await getOnlineUserListApi(
|
||||
const { rows } = await getOnlineUserListApi(
|
||||
toRaw(searchFormParams)
|
||||
).finally(() => {
|
||||
pageLoading.value = false;
|
||||
});
|
||||
|
||||
originalDataList = data.rows;
|
||||
pagination.total = data.rows.length;
|
||||
originalDataList = rows;
|
||||
pagination.total = rows.length;
|
||||
|
||||
getList();
|
||||
}
|
||||
|
||||
@@ -153,14 +153,14 @@ export function useNoticeHook() {
|
||||
CommonUtils.fillPaginationParams(searchFormParams, pagination);
|
||||
|
||||
pageLoading.value = true;
|
||||
const { data } = await getSystemNoticeListApi(
|
||||
const { rows, total } = await getSystemNoticeListApi(
|
||||
toRaw(searchFormParams)
|
||||
).finally(() => {
|
||||
pageLoading.value = false;
|
||||
});
|
||||
|
||||
dataList.value = data.rows;
|
||||
pagination.total = data.total;
|
||||
dataList.value = rows;
|
||||
pagination.total = total;
|
||||
}
|
||||
|
||||
async function handleDelete(row) {
|
||||
|
||||
@@ -151,10 +151,10 @@ export function useRole() {
|
||||
async function onSearch() {
|
||||
try {
|
||||
loading.value = true;
|
||||
const { data } = await getRoleListApi(toRaw(form));
|
||||
console.log("role list", data);
|
||||
dataList.value = data.rows;
|
||||
pagination.total = data.total;
|
||||
const { rows, total } = await getRoleListApi(toRaw(form));
|
||||
console.log("role list", rows);
|
||||
dataList.value = rows;
|
||||
pagination.total = total;
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
ElMessage.error((e as Error)?.message || "加载失败");
|
||||
|
||||
@@ -338,14 +338,14 @@ export function useHook() {
|
||||
CommonUtils.fillTimeRangeParams(searchFormParams, timeRange.value);
|
||||
|
||||
pageLoading.value = true;
|
||||
const { data } = await getUserListApi(toRaw(searchFormParams)).finally(
|
||||
() => {
|
||||
pageLoading.value = false;
|
||||
}
|
||||
);
|
||||
const { rows, total } = await getUserListApi(
|
||||
toRaw(searchFormParams)
|
||||
).finally(() => {
|
||||
pageLoading.value = false;
|
||||
});
|
||||
|
||||
dataList.value = data.rows;
|
||||
pagination.total = data.total;
|
||||
dataList.value = rows;
|
||||
pagination.total = total;
|
||||
}
|
||||
|
||||
const resetForm = formEl => {
|
||||
@@ -366,7 +366,7 @@ export function useHook() {
|
||||
postOptions.value = postResponse.data.rows;
|
||||
|
||||
const roleResponse = await getRoleListApi({});
|
||||
roleOptions.value = roleResponse.data.rows;
|
||||
roleOptions.value = roleResponse.rows;
|
||||
});
|
||||
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user