feat: 接入 UserHome 前端业务代码(含真实 src/依赖,保留 projman 标准 CI)
This commit is contained in:
@@ -0,0 +1,63 @@
|
||||
import Abstract from "@/utils/axios/abstract";
|
||||
import { PageData, PageParams } from "@/types/Basics";
|
||||
|
||||
const path = "/api";
|
||||
|
||||
export interface AppCategoryItem {
|
||||
id?: number;
|
||||
name: string;
|
||||
apiUrl: string;
|
||||
dataKey: string;
|
||||
paramsKey: string;
|
||||
roleType: number;
|
||||
cId?: number;
|
||||
cDate?: string;
|
||||
resDate?: string;
|
||||
}
|
||||
|
||||
/** 系统设置-应用管理(应用类别 CRUD + 模板管理) */
|
||||
class AppSettingApi extends Abstract {
|
||||
/** 应用分页列表 */
|
||||
getAppCategoryList(params: PageParams & { roleType: number; name?: string }) {
|
||||
const url = path + "/GetAppCategoryList";
|
||||
return this.getRequest<PageData>({ url, params });
|
||||
}
|
||||
|
||||
/** 保存应用(新增/编辑) */
|
||||
saveAppCategory(data: AppCategoryItem) {
|
||||
const url = path + "/SaveAppCategory";
|
||||
return this.postRequest({ url, data });
|
||||
}
|
||||
|
||||
/** 删除应用 */
|
||||
deleteAppCategory(id: number) {
|
||||
const url = path + "/DelAppCategory";
|
||||
return this.postRequest({ url, params: { id } });
|
||||
}
|
||||
|
||||
/** 查询应用详情 */
|
||||
findAppCategory(id: number) {
|
||||
const url = path + "/FindAppCategory";
|
||||
return this.getRequest<AppCategoryItem>({ url, params: { id } });
|
||||
}
|
||||
|
||||
/** 刷新资源时间戳(上传模板后调用) */
|
||||
updateResDate(id: number) {
|
||||
const url = path + "/UpdateResDate";
|
||||
return this.postRequest({ url, params: { id } });
|
||||
}
|
||||
|
||||
/** 模板文件列表 */
|
||||
getTempList(appModId: number) {
|
||||
const url = path + "/GetTempList";
|
||||
return this.getRequest<any[]>({ url, params: { appModId } });
|
||||
}
|
||||
|
||||
/** 保存模板文件内容(JSON body,避免大文件内容超出 URL/请求头长度限制) */
|
||||
saveTempFile(appModId: number, fileName: string, content: string) {
|
||||
const url = path + "/SaveTempFile";
|
||||
return this.postRequest({ url, data: { appModId, fileName, content } });
|
||||
}
|
||||
}
|
||||
|
||||
export default new AppSettingApi();
|
||||
@@ -0,0 +1,113 @@
|
||||
import { PageData, PageParams } from "@/types/Basics";
|
||||
import Abstract from "@/utils/axios/abstract";
|
||||
import { BschResponse } from "axios";
|
||||
|
||||
const path = "/api";
|
||||
|
||||
class Base extends Abstract {
|
||||
/**
|
||||
*获取个人信息
|
||||
* @memberof Basic
|
||||
*/
|
||||
getUserInfo() {
|
||||
const url = path + "/user/GetUserInfo";
|
||||
return this.getRequest({ url, isMsg: false });
|
||||
}
|
||||
|
||||
/**
|
||||
*获取用户全部角色
|
||||
* @memberof Basic
|
||||
*/
|
||||
getUserRole() {
|
||||
const url = path + "/user/getUserRole";
|
||||
return this.getRequest<Array<any>>({ url });
|
||||
}
|
||||
|
||||
/**
|
||||
*获取用户当前角色
|
||||
* @memberof Basic
|
||||
*/
|
||||
findUserRole() {
|
||||
const url = path + "/user/findUserRole";
|
||||
return this.getRequest({ url });
|
||||
}
|
||||
|
||||
/**
|
||||
*获取用户所有应用
|
||||
* @memberof Basic
|
||||
*/
|
||||
getUserApp(userId: number, schId: number) {
|
||||
const url = path + "/user/GetUserApp";
|
||||
return this.getRequest<any[]>({ url, params: { userId, schId } });
|
||||
}
|
||||
|
||||
/**
|
||||
*获取用户常用应用
|
||||
* @memberof Basic
|
||||
*/
|
||||
getUsedApp(roleId: number, schId: number) {
|
||||
const url = path + "/usedapp/getUsedApp";
|
||||
return this.getRequest<any[]>({ url, params: { roleType: roleId, schId } });
|
||||
}
|
||||
|
||||
/**
|
||||
*获取应用详情
|
||||
* @memberof Basic
|
||||
*/
|
||||
GetAppInfoById(appId: number) {
|
||||
const url = path + "/user/GetAppInfoById";
|
||||
return this.getRequest<any>({ url, params: { id: appId } });
|
||||
}
|
||||
|
||||
/**
|
||||
*获取用户消息
|
||||
* @memberof Basic
|
||||
*/
|
||||
getMessageList() {
|
||||
const url = path + "/getMessageByUserId";
|
||||
return this.getRequest<PageData>({ url, params: { page: 1, count: 10 } });
|
||||
}
|
||||
|
||||
/**
|
||||
*获取用户消息
|
||||
* @memberof Basic
|
||||
*/
|
||||
getMessagePageList(params: PageParams) {
|
||||
const url = path + "/getMessageByUserId";
|
||||
return this.getRequest<PageData>({ url, params });
|
||||
}
|
||||
|
||||
/**
|
||||
* 已读某一条消息
|
||||
* @memberof Basic
|
||||
*/
|
||||
readMessage(id: number) {
|
||||
const url = path + "/readMessage";
|
||||
return this.postRequest({ url, params: { id } });
|
||||
}
|
||||
|
||||
/**
|
||||
* 已读全部消息
|
||||
* @memberof Basic
|
||||
*/
|
||||
readMessageAll() {
|
||||
const url = path + "/readMessageAll";
|
||||
return this.postRequest({ url });
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改密码
|
||||
* @memberof Basic
|
||||
*/
|
||||
updatePassword(oldPassword: string, password: string) {
|
||||
const url = path + "/updateUserPassword";
|
||||
return this.postRequest({ url, data: { oldPassword, password } });
|
||||
}
|
||||
|
||||
savUserRole(info: any) {
|
||||
const url = path + "/user/savUserRole";
|
||||
return this.postRequest({ url, data: info as any });
|
||||
}
|
||||
}
|
||||
|
||||
export default new Base();
|
||||
@@ -0,0 +1,39 @@
|
||||
import { DesktopAppTypeEnum } from "@/types";
|
||||
import { BaseDict, PageData, PageParams } from "@/types/Basics";
|
||||
import Abstract from "@/utils/axios/abstract";
|
||||
|
||||
const path = "/api";
|
||||
|
||||
class MenuBar extends Abstract {
|
||||
getMenuBarSchList() {
|
||||
const url = path + "/getMenuBarSchList";
|
||||
return this.getRequest<any[]>({ url });
|
||||
}
|
||||
|
||||
getMenuBarUserList() {
|
||||
const url = path + "/getMenuBarList";
|
||||
return this.getRequest<any[]>({ url });
|
||||
}
|
||||
|
||||
saveMenuBar(item: any) {
|
||||
const url = path + "/saveMenuBar";
|
||||
return this.postRequest<any>({ url, data: item });
|
||||
}
|
||||
|
||||
toggleMenuBarShow(id: number) {
|
||||
const url = path + "/toggleMenuBarShow";
|
||||
return this.postRequest<any>({ url, params: { id } });
|
||||
}
|
||||
|
||||
saveMenuBarOrderNum(id: number, orderNum: number) {
|
||||
const url = path + "/saveMenuBarOrderNum";
|
||||
return this.postRequest<any>({ url, data: { id, orderNum } });
|
||||
}
|
||||
|
||||
deleteMenuBar(id: number) {
|
||||
const url = path + "/deleteMenuBar";
|
||||
return this.postRequest<any>({ url, params: { id } });
|
||||
}
|
||||
}
|
||||
|
||||
export default new MenuBar();
|
||||
@@ -0,0 +1,37 @@
|
||||
import Abstract from "@/utils/axios/abstract";
|
||||
|
||||
const path = "/api";
|
||||
|
||||
class StatsBar extends Abstract {
|
||||
getStatsBarSchList() {
|
||||
const url = path + "/getStatsBarSchList";
|
||||
return this.getRequest<any[]>({ url });
|
||||
}
|
||||
|
||||
getStatsBarUserList() {
|
||||
const url = path + "/getStatsBarList";
|
||||
return this.getRequest<any[]>({ url });
|
||||
}
|
||||
|
||||
saveStatsBar(item: any) {
|
||||
const url = path + "/saveStatsBar";
|
||||
return this.postRequest<any>({ url, data: item });
|
||||
}
|
||||
|
||||
toggleStatsBarShow(id: number) {
|
||||
const url = path + "/toggleStatsBarShow";
|
||||
return this.postRequest<any>({ url, params: { id } });
|
||||
}
|
||||
|
||||
saveStatsBarOrderNum(id: number, orderNum: number) {
|
||||
const url = path + "/saveStatsBarOrderNum";
|
||||
return this.postRequest<any>({ url, data: { id, orderNum } });
|
||||
}
|
||||
|
||||
deleteStatsBar(id: number) {
|
||||
const url = path + "/deleteStatsBar";
|
||||
return this.postRequest<any>({ url, params: { id } });
|
||||
}
|
||||
}
|
||||
|
||||
export default new StatsBar();
|
||||
@@ -0,0 +1,39 @@
|
||||
import Abstract from "@/utils/axios/abstract";
|
||||
import { PageData, PageParams } from "@/types/Basics";
|
||||
|
||||
const path = "/api";
|
||||
|
||||
/** 系统设置-基础设置(机构树 / 壁纸 / Logo 管理视图) */
|
||||
class SysSettingApi extends Abstract {
|
||||
/** 机构树(仅超管),已裁剪到学校层 */
|
||||
getSchTree() {
|
||||
const url = path + "/getSchTree";
|
||||
return this.getRequest<any>({ url });
|
||||
}
|
||||
|
||||
/** 壁纸管理列表(系统 + 目标学校,不含个人壁纸) */
|
||||
getSchWallpaperManageList(schId?: number) {
|
||||
const url = path + "/getSchWallpaperManageList";
|
||||
return this.getRequest<any[]>({ url, params: { schId } });
|
||||
}
|
||||
|
||||
/** Logo 管理列表(系统 + 目标学校) */
|
||||
getSchLogoManageList(schId?: number) {
|
||||
const url = path + "/getSchLogoManageList";
|
||||
return this.getRequest<any[]>({ url, params: { schId } });
|
||||
}
|
||||
|
||||
/** 删除壁纸(复用 Header 弹窗同接口,属主校验后端完成) */
|
||||
deleteWallById(id: number) {
|
||||
const url = path + "/deleteWallById";
|
||||
return this.postRequest({ url, params: { id } });
|
||||
}
|
||||
|
||||
/** 删除 Logo */
|
||||
deleteLogoById(id: number) {
|
||||
const url = path + "/deleteLogoById";
|
||||
return this.postRequest({ url, params: { id } });
|
||||
}
|
||||
}
|
||||
|
||||
export default new SysSettingApi();
|
||||
@@ -0,0 +1,40 @@
|
||||
import Abstract from "@/utils/axios/abstract";
|
||||
|
||||
const path = "/api/TeacherCopilot";
|
||||
|
||||
/**
|
||||
* 教师助手相关
|
||||
*/
|
||||
class TeacherCopilot extends Abstract {
|
||||
getSchList() {
|
||||
const url = path + "/getSchList";
|
||||
return this.getRequest<any[]>({ url });
|
||||
}
|
||||
|
||||
getUserList() {
|
||||
const url = path + "/getUserList";
|
||||
return this.getRequest<any[]>({ url });
|
||||
}
|
||||
|
||||
save(item: any) {
|
||||
const url = path + "/save";
|
||||
return this.postRequest<any>({ url, data: item });
|
||||
}
|
||||
|
||||
toggleShow(id: number) {
|
||||
const url = path + "/toggleShow";
|
||||
return this.postRequest<any>({ url, params: { id } });
|
||||
}
|
||||
|
||||
saveOrderNum(id: number, orderNum: number) {
|
||||
const url = path + "/saveOrderNum";
|
||||
return this.postRequest<any>({ url, data: { id, orderNum } });
|
||||
}
|
||||
|
||||
delete(id: number) {
|
||||
const url = path + "/delete";
|
||||
return this.postRequest<any>({ url, params: { id } });
|
||||
}
|
||||
}
|
||||
|
||||
export default new TeacherCopilot();
|
||||
@@ -0,0 +1,97 @@
|
||||
import { DesktopAppTypeEnum, LightApp, UserSettingInfo, WidgetPositionResp } from "@/types";
|
||||
import { BaseDict, PageData, PageParams } from "@/types/Basics";
|
||||
import Abstract from "@/utils/axios/abstract";
|
||||
|
||||
const path = "/api";
|
||||
|
||||
class UserSettings extends Abstract {
|
||||
getUserWallpaperList(schId: number) {
|
||||
const url = path + "/getUserWallpaperList";
|
||||
return this.getRequest<any[]>({ url, params: { schId } });
|
||||
}
|
||||
|
||||
deleteWallById(id: number) {
|
||||
const url = path + "/deleteWallById";
|
||||
return this.postRequest({ url, params: { id } });
|
||||
}
|
||||
|
||||
checkWallpaper(schId: number, wallpaperUrl: string) {
|
||||
const url = path + "/checkWallpaper";
|
||||
return this.postRequest({ url, data: { schId, wallpaperUrl } });
|
||||
}
|
||||
|
||||
getLogoList() {
|
||||
const url = path + "/getLogoList";
|
||||
return this.getRequest<any[]>({ url });
|
||||
}
|
||||
|
||||
deleteLogoById(id: number) {
|
||||
const url = path + "/deleteLogoById";
|
||||
return this.postRequest({ url, params: { id } });
|
||||
}
|
||||
|
||||
getUserSettings() {
|
||||
const url = path + "/getUserSettings";
|
||||
return this.getRequest<UserSettingInfo>({ url });
|
||||
}
|
||||
|
||||
toggleWidgetShow(id?: number) {
|
||||
const url = path + "/toggleWidgetShow";
|
||||
return this.postRequest<any>({ url, data: { id } });
|
||||
}
|
||||
saveUserWidget(info: WidgetPositionResp) {
|
||||
const url = path + "/saveUserWidget";
|
||||
return this.postRequest<any>({ url, data: info as any });
|
||||
}
|
||||
|
||||
saveUserAppIds(id: number | undefined, appIds: string) {
|
||||
const url = path + "/saveUserAppIds";
|
||||
return this.postRequest<any>({ url, data: { id, appIds } });
|
||||
}
|
||||
|
||||
getLightAppSel() {
|
||||
const url = path + "/getLightAppGroup";
|
||||
return this.getRequest<any[]>({ url });
|
||||
}
|
||||
|
||||
getLightAppList(): Promise<any[]> {
|
||||
const url = path + "/getLightAppList";
|
||||
return new Promise(async (resolve, reject) => {
|
||||
let result: any[] = await this.getRequest<any[]>({ url });
|
||||
result.forEach(element => {
|
||||
if (!!element.layout) element.layout = JSON.parse(element.layout);
|
||||
});
|
||||
resolve(result);
|
||||
});
|
||||
}
|
||||
saveLightApp(lightapp: LightApp) {
|
||||
const url = path + "/saveLightApp";
|
||||
lightapp.layout = JSON.stringify(lightapp.layout);
|
||||
return this.postRequest<any[]>({ url, data: lightapp as any });
|
||||
}
|
||||
deleteLightAppById(id: number) {
|
||||
const url = path + "/deleteLightAppById";
|
||||
return this.postRequest({ url, params: { id } });
|
||||
}
|
||||
|
||||
getUserDesktopAppList() {
|
||||
const url = path + "/getUserDesktopAppList";
|
||||
return this.getRequest<any[]>({ url });
|
||||
}
|
||||
|
||||
saveUserDesktopAppById(appId: number, type: DesktopAppTypeEnum) {
|
||||
const url = path + "/saveUserDesktopAppById";
|
||||
return this.postRequest<any>({ url, data: { id: appId, type } });
|
||||
}
|
||||
|
||||
deleteUserDesktopAppById(id: number, appId: number) {
|
||||
const url = path + "/deleteDesktopAppById";
|
||||
return this.postRequest<any>({ url, data: { id, appId } });
|
||||
}
|
||||
sortUserDesktopApp(ids: number[]) {
|
||||
const url = path + "/sortUserDesktopApp";
|
||||
return this.postRequest<any>({ url, data: { ids: ids.join(",") } });
|
||||
}
|
||||
}
|
||||
|
||||
export default new UserSettings();
|
||||
@@ -1,119 +0,0 @@
|
||||
/// <reference types='./globals.d.ts' />
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* 用户中心接口文档 - version 0.0.1
|
||||
*
|
||||
* UserBase 用户中心 OpenAPI 文档(springdoc-openapi)
|
||||
*
|
||||
* OpenAPI version: 3.0.1
|
||||
*
|
||||
*
|
||||
* NOTE: This file is auto generated by the alova's vscode plugin.
|
||||
*
|
||||
* https://alova.js.org/devtools/vscode
|
||||
*
|
||||
* **Do not edit the file manually.**
|
||||
*/
|
||||
export default {
|
||||
'SysUser.enable': ['POST', '/api/sysuser/Enable/{id}'],
|
||||
'SysUser.edit': ['POST', '/api/sysuser/Edit/{id}'],
|
||||
'SysUser.disable': ['POST', '/api/sysuser/Disable/{id}'],
|
||||
'SysUser.deleteFromGroup': ['POST', '/api/sysuser/DeleteFromGroup/{userId}/{groupId}'],
|
||||
'SysUser.changeSortNo': ['POST', '/api/sysuser/ChangeSortNo/{userId}'],
|
||||
'SysUser.changeGroups': ['POST', '/api/sysuser/ChangeGroups'],
|
||||
'SysUser.batchImport': ['POST', '/api/sysuser/BatchImport'],
|
||||
'SysUser.batchDelete': ['POST', '/api/sysuser/BatchDelete'],
|
||||
'SysUser.batchChangeStatus': ['POST', '/api/sysuser/BatchChangeStatus'],
|
||||
'SysUser.add': ['POST', '/api/sysuser/Add'],
|
||||
'SysGroup.sortChildren': ['POST', '/api/sysgroup/SortChildren'],
|
||||
'SysGroup.move': ['POST', '/api/sysgroup/Move'],
|
||||
'SysGroup.sysGroupEdit': ['POST', '/api/sysgroup/Edit/{id}'],
|
||||
'SysGroup.sysGroupRemove': ['POST', '/api/sysgroup/Delete/{id}'],
|
||||
'SysGroup.batchAdd': ['POST', '/api/sysgroup/BatchAdd'],
|
||||
'SysGroup.sysGroupAdd': ['POST', '/api/sysgroup/Add'],
|
||||
'PushSubscription.test': ['POST', '/api/push/Test'],
|
||||
'PushSubscription.retry': ['POST', '/api/push/Retry/{id}'],
|
||||
'GroupAuthz.setSchoolApp': ['POST', '/api/groupauthz/SetSchoolApp'],
|
||||
'GroupAuthz.setGroupModule': ['POST', '/api/groupauthz/SetGroupModule'],
|
||||
'GroupAuthz.saveModulePerms': ['POST', '/api/groupauthz/SaveModulePerms'],
|
||||
'GroupAuthz.assignApps': ['POST', '/api/groupauthz/AssignApps'],
|
||||
'Base.uploadFile': ['POST', '/api/base/UploadFile'],
|
||||
'AppRole.saveUserRoles': ['POST', '/api/approle/SaveUserRoles'],
|
||||
'AppRole.saveRoleUsers': ['POST', '/api/approle/SaveRoleUsers'],
|
||||
'AppRole.saveRoleModules': ['POST', '/api/approle/SaveRoleModules'],
|
||||
'AppRole.roleEdit': ['POST', '/api/approle/RoleEdit/{id}'],
|
||||
'AppRole.roleDelete': ['POST', '/api/approle/RoleDelete/{id}'],
|
||||
'AppRole.roleAdd': ['POST', '/api/approle/RoleAdd'],
|
||||
'AppRole.removeRoleUser': ['POST', '/api/approle/RemoveRoleUser'],
|
||||
'AppSettings.savePushSetting': ['POST', '/api/app/SavePushSetting/{id}'],
|
||||
'AppSettings.resetAppSecret': ['POST', '/api/app/ResetAppSecret/{id}'],
|
||||
'AppSettings.refreshSignKeys': ['POST', '/api/app/RefreshSignKeys'],
|
||||
'AppSettings.editType': ['POST', '/api/app/EditType/{id}'],
|
||||
'AppSettings.editModule': ['POST', '/api/app/EditModule/{id}'],
|
||||
'AppSettings.editApp': ['POST', '/api/app/EditApp/{id}'],
|
||||
'AppSettings.deleteType': ['POST', '/api/app/DeleteType/{id}'],
|
||||
'AppSettings.deleteModule': ['POST', '/api/app/DeleteModule/{id}'],
|
||||
'AppSettings.deleteApp': ['POST', '/api/app/DeleteApp/{id}'],
|
||||
'AppSettings.appTypeSort': ['POST', '/api/app/AppTypeSort'],
|
||||
'AppSettings.appSort': ['POST', '/api/app/AppSort'],
|
||||
'AppSettings.addType': ['POST', '/api/app/AddType'],
|
||||
'AppSettings.addModule': ['POST', '/api/app/AddModule'],
|
||||
'AppSettings.addApp': ['POST', '/api/app/AddApp'],
|
||||
'User.moveToGroup': ['POST', '/oapi/user/moveToGroup'],
|
||||
'User.edit_1': ['POST', '/oapi/user/edit/{id}'],
|
||||
'User.delete_': ['POST', '/oapi/user/delete/{id}/{groupId}'],
|
||||
'User.batchAdd_1': ['POST', '/oapi/user/batchAdd'],
|
||||
'User.add_1': ['POST', '/oapi/user/add'],
|
||||
'Group.edit_2': ['POST', '/oapi/group/edit/{id}'],
|
||||
'Group.delete_1': ['POST', '/oapi/group/delete/{id}'],
|
||||
'Group.batchAdd_2': ['POST', '/oapi/group/batchAdd'],
|
||||
'Group.add_2': ['POST', '/oapi/group/add'],
|
||||
'SysUser.list': ['GET', '/api/sysuser/List'],
|
||||
'SysUser.getUserGroups': ['GET', '/api/sysuser/Groups/{userId}'],
|
||||
'SysUser.userIdentity': ['GET', '/api/sysuser/UserIdentity'],
|
||||
'SysUser.export_': ['GET', '/api/sysuser/Export'],
|
||||
'SysUser.downloadTemplate': ['GET', '/api/sysuser/DownloadTemplate'],
|
||||
'SysGroup.sysGroupList': ['GET', '/api/sysgroup/List'],
|
||||
'SysGroup.getTree': ['GET', '/api/sysgroup/GetTree'],
|
||||
'SysGroup.getSchoolTree': ['GET', '/api/sysgroup/GetSchoolTree'],
|
||||
'PushSubscription.recordList': ['GET', '/api/push/RecordList'],
|
||||
'PushSubscription.download': ['GET', '/api/push/Download/{id}'],
|
||||
'SysOperationLog.operationLogList': ['GET', '/api/oplog/List'],
|
||||
'SysOperationLog.operationLogDownload': ['GET', '/api/oplog/Download/{id}'],
|
||||
'SysOapiLog.oapiLogList': ['GET', '/api/oapilog/List'],
|
||||
'SysOapiLog.oapiLogDownload': ['GET', '/api/oapilog/Download/{id}'],
|
||||
'GroupAuthz.userRoles': ['GET', '/api/groupauthz/UserRoles'],
|
||||
'GroupAuthz.userPermissionTree': ['GET', '/api/groupauthz/UserPermissionTree'],
|
||||
'GroupAuthz.userGroupTree': ['GET', '/api/groupauthz/UserGroupTree'],
|
||||
'GroupAuthz.searchUsers': ['GET', '/api/groupauthz/SearchUsers'],
|
||||
'GroupAuthz.hasModulePerm': ['GET', '/api/groupauthz/HasModulePerm'],
|
||||
'GroupAuthz.groupUsers': ['GET', '/api/groupauthz/GroupUsers'],
|
||||
'GroupAuthz.groupModuleTree': ['GET', '/api/groupauthz/GroupModuleTree'],
|
||||
'GroupAuthz.groupModuleTreeByCategory': ['GET', '/api/groupauthz/GroupModuleTreeByCategory'],
|
||||
'GroupAuthz.groupAppList': ['GET', '/api/groupauthz/GroupAppList'],
|
||||
'GroupAuthz.getSchoolAppId': ['GET', '/api/groupauthz/GetSchoolAppId'],
|
||||
'Base.RedirectTo': ['GET', '/api/base/RedirectTo/{id}'],
|
||||
'Base.manualHashCacheDemo': ['GET', '/api/base/ManualHashCacheDemo'],
|
||||
'Base.getUserInfo': ['GET', '/api/base/GetUserInfo'],
|
||||
'Base.getUserScope': ['GET', '/api/base/GetUserScope'],
|
||||
'Base.getSysDict': ['GET', '/api/base/GetSysDict'],
|
||||
'AppSettings.schoolList': ['GET', '/api/app/SchoolList'],
|
||||
'AppRole.roleUsers': ['GET', '/api/approle/RoleUsers'],
|
||||
'AppRole.roleModuleTree': ['GET', '/api/approle/RoleModuleTree'],
|
||||
'AppRole.roleList': ['GET', '/api/approle/RoleList'],
|
||||
'AppSettings.moduleList': ['GET', '/api/app/ModuleList'],
|
||||
'AppSettings.getPushSetting': ['GET', '/api/app/GetPushSetting/{id}'],
|
||||
'AppSettings.appTypeList': ['GET', '/api/app/AppTypeList'],
|
||||
'AppSettings.appSortList': ['GET', '/api/app/AppSortList'],
|
||||
'AppSettings.appList': ['GET', '/api/app/AppList'],
|
||||
'AppSettings.appAuthzList': ['GET', '/api/app/AppAuthzList'],
|
||||
'User.modules': ['GET', '/oapi/user/modules'],
|
||||
'User.byPhone': ['GET', '/oapi/user/byPhone'],
|
||||
'User.byLoginName': ['GET', '/oapi/user/byLoginName'],
|
||||
'User.byId': ['GET', '/oapi/user/byId'],
|
||||
'SignKeyInternal.signKey': ['GET', '/oapi/internal/sign-key/{appId}'],
|
||||
'Group.tree': ['GET', '/oapi/group/tree'],
|
||||
'Group.list_1': ['GET', '/oapi/group/list'],
|
||||
'Group.byId_1': ['GET', '/oapi/group/byId']
|
||||
};
|
||||
@@ -1,96 +0,0 @@
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* 用户中心接口文档 - version 0.0.1
|
||||
*
|
||||
* UserBase 用户中心 OpenAPI 文档(springdoc-openapi)
|
||||
*
|
||||
* OpenAPI version: 3.0.1
|
||||
*
|
||||
*
|
||||
* NOTE: This file is auto generated by the alova's vscode plugin.
|
||||
*
|
||||
* https://alova.js.org/devtools/vscode
|
||||
*
|
||||
* **Do not edit the file manually.**
|
||||
*/
|
||||
import { Method } from 'alova';
|
||||
import apiDefinitions from './apiDefinitions';
|
||||
|
||||
const cache = Object.create(null);
|
||||
const createFunctionalProxy = (
|
||||
array: (string | symbol)[],
|
||||
alovaInstance: Alova<any, any, any, any, any>,
|
||||
configMap: any
|
||||
) => {
|
||||
const apiPathKey = array.join('.') as keyof typeof apiDefinitions;
|
||||
if (cache[apiPathKey]) {
|
||||
return cache[apiPathKey];
|
||||
}
|
||||
// create a new proxy instance
|
||||
const proxy = new Proxy(function () {}, {
|
||||
get(_, property) {
|
||||
// record the target property, so that it can get the completed accessing paths
|
||||
const newArray = [...array, property];
|
||||
// always return a new proxy to continue recording accessing paths.
|
||||
return createFunctionalProxy(newArray, alovaInstance, configMap);
|
||||
},
|
||||
apply(_, __, [config]) {
|
||||
const apiItem = apiDefinitions[apiPathKey];
|
||||
if (!apiItem) {
|
||||
throw new Error(`the api path of \`${apiPathKey}\` is not found`);
|
||||
}
|
||||
const mergedConfig = {
|
||||
...configMap[apiPathKey],
|
||||
...config
|
||||
};
|
||||
const [method, url] = apiItem;
|
||||
const pathParams = mergedConfig.pathParams;
|
||||
const urlReplaced = url!.replace(/\{([^}]+)\}/g, (_, key) => {
|
||||
const pathParam = pathParams[key];
|
||||
return pathParam;
|
||||
});
|
||||
delete mergedConfig.pathParams;
|
||||
let data = mergedConfig.data;
|
||||
if (Object.prototype.toString.call(data) === '[object Object]' && typeof FormData !== 'undefined') {
|
||||
let hasBlobData = false;
|
||||
const formData = new FormData();
|
||||
for (const key in data) {
|
||||
if (Array.isArray(data[key])) {
|
||||
for (const ele of data[key]) {
|
||||
formData.append(key, ele);
|
||||
if (ele instanceof Blob) {
|
||||
hasBlobData = true;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
formData.append(key, data[key]);
|
||||
if (data[key] instanceof Blob) {
|
||||
hasBlobData = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
data = hasBlobData ? formData : data;
|
||||
}
|
||||
return new Method(method!.toUpperCase() as MethodType, alovaInstance, urlReplaced, mergedConfig, data);
|
||||
}
|
||||
});
|
||||
cache[apiPathKey] = proxy;
|
||||
return proxy;
|
||||
};
|
||||
|
||||
export const createApis = (alovaInstance: Alova<any, any, any, any, any>, configMap: any) => {
|
||||
const Apis = new Proxy({} as Apis, {
|
||||
get(_, property) {
|
||||
return createFunctionalProxy([property], alovaInstance, configMap);
|
||||
}
|
||||
});
|
||||
return Apis;
|
||||
};
|
||||
|
||||
export const mountApis = (Apis: Apis) => {
|
||||
// define global variable `Apis`
|
||||
(globalThis as any).Apis = Apis;
|
||||
};
|
||||
|
||||
export const withConfigType = <Config extends MethodsConfigMap>(config: Config) => config;
|
||||
Vendored
-5406
File diff suppressed because it is too large
Load Diff
@@ -1,11 +0,0 @@
|
||||
import { createApis, withConfigType, mountApis } from "./createApis";
|
||||
|
||||
import { alovaInstance } from "@/utils/alova/alova-iview";
|
||||
|
||||
export const $$userConfigMap = withConfigType({});
|
||||
|
||||
const Apis = createApis(alovaInstance, $$userConfigMap);
|
||||
|
||||
mountApis(Apis);
|
||||
|
||||
export default Apis;
|
||||
@@ -1,67 +0,0 @@
|
||||
import { alovaInstance } from "@/utils/alova/alova-iview";
|
||||
|
||||
/**
|
||||
* 通过网关转发 GET 开放请求
|
||||
* @param baseHost 真实接口的域名
|
||||
* @param url 真实接口的路径(含 query)
|
||||
* @param params query 参数(可选)
|
||||
*/
|
||||
export function createRelayGet<T = any>(url: string, params?: any) {
|
||||
return alovaInstance.Get<T>("/api/relay/doGet", {
|
||||
params,
|
||||
headers: {
|
||||
RelayUrl: url, // 网关需要
|
||||
},
|
||||
cacheFor: 0,
|
||||
});
|
||||
}
|
||||
/**
|
||||
* 通过网关转发 POST 开放请求
|
||||
* @param baseHost 真实接口的域名
|
||||
* @param url 真实接口的路径(含 query)
|
||||
* @param params query 参数(可选)
|
||||
*/
|
||||
|
||||
export function createRelayPost<T = any>(url: string, params?: any, data?: any) {
|
||||
const gatewayPath = data != null ? "/api/relay/doPost" : "/api/relay/doPost2";
|
||||
return alovaInstance.Post<T>(gatewayPath, data, {
|
||||
params: params ?? {},
|
||||
headers: {
|
||||
RelayUrl: url,
|
||||
},
|
||||
cacheFor: 0,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过网关转发 GET 授权请求
|
||||
* @param baseHost 真实接口的域名
|
||||
* @param url 真实接口的路径(含 query)
|
||||
* @param params query 参数(可选)
|
||||
*/
|
||||
export function createRelayAuthGet<T = any>(url: string, params?: any) {
|
||||
return alovaInstance.Get<T>("/api/relayAuth/doGet", {
|
||||
params,
|
||||
headers: {
|
||||
RelayUrl: url, // 网关需要
|
||||
},
|
||||
cacheFor: 0,
|
||||
});
|
||||
}
|
||||
/**
|
||||
* 通过网关转发 POST 授权请求
|
||||
* @param baseHost 真实接口的域名
|
||||
* @param url 真实接口的路径(含 query)
|
||||
* @param params query 参数(可选)
|
||||
*/
|
||||
|
||||
export function createRelayAuthPost<T = any>(url: string, params?: any, data?: any) {
|
||||
const gatewayPath = data != null ? "/api/relayAuth/doPost" : "/api/relayAuth/doPost2";
|
||||
return alovaInstance.Post<T>(gatewayPath, data, {
|
||||
params: params ?? {},
|
||||
headers: {
|
||||
RelayUrl: url,
|
||||
},
|
||||
cacheFor: 0,
|
||||
});
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
import conf from "@/assets/config/host.config";
|
||||
const baseHost = conf.relayConf.zhuanxiangHost;
|
||||
import { createRelayAuthGet, createRelayAuthPost } from "./relay";
|
||||
|
||||
/**
|
||||
* 专项相关接口
|
||||
*/
|
||||
class SpecialApi {
|
||||
/** 获取专项列表 */
|
||||
getSpecialList(subId: string, xdCode: number) {
|
||||
const url = baseHost + "/api/getSpecialTypeBySchList";
|
||||
const params = { subId, xdCode };
|
||||
return createRelayAuthGet<any>(url, params);
|
||||
}
|
||||
}
|
||||
export default new SpecialApi();
|
||||
@@ -1,32 +0,0 @@
|
||||
import conf from "@/assets/config/host.config";
|
||||
const baseHost = conf.relayConf.ziyuankuHost;
|
||||
import { createRelayAuthGet, createRelayAuthPost, createRelayGet, createRelayPost } from "./relay";
|
||||
|
||||
class ZiYuanApi {
|
||||
/** 获取树节点 */
|
||||
getNodeTree(schoolId: number, beginNode?: number, levelLimit?: number) {
|
||||
const url = baseHost + "/oapi/base/nodeTree/get";
|
||||
const params = { schoolId, beginNode, levelLimit };
|
||||
return createRelayGet<any>(url, params);
|
||||
}
|
||||
|
||||
/** 获取学校目录资源列表 */
|
||||
getResourceByNodeId(params: any) {
|
||||
const url = baseHost + "/oapi/base/getResourceAllByNodeIds";
|
||||
return createRelayGet<any>(url, params);
|
||||
}
|
||||
|
||||
linkNode(resourceIds: any[], nodeId: number) {
|
||||
const url = baseHost + "/manage/platform/nodeTree/linkPlatformNode";
|
||||
const params = { resourceIds: resourceIds.join(","), nodeId };
|
||||
return createRelayAuthPost<any>(url, params);
|
||||
}
|
||||
|
||||
selectTable(params: any) {
|
||||
console.log("params", params);
|
||||
|
||||
const url = baseHost + "/manage/platform/nodeTree/selectPlatformResource";
|
||||
return createRelayAuthGet<any>(url, params);
|
||||
}
|
||||
}
|
||||
export default new ZiYuanApi();
|
||||
Reference in New Issue
Block a user