init: userbase front/service/deploy source (CI builds front via Gitea Actions)
This commit is contained in:
@@ -0,0 +1,83 @@
|
||||
/// <reference types='./globals.d.ts' />
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* 用户中心接口文档 - version 0.0.1-SNAPSHOT
|
||||
*
|
||||
* Demo project for Spring Boot
|
||||
*
|
||||
* OpenAPI version: 3.0.0
|
||||
*
|
||||
* Contact:
|
||||
*
|
||||
* 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 {
|
||||
'AppSettings.addApp': ['POST', '/api/app/AddApp'],
|
||||
'AppSettings.addModule': ['POST', '/api/app/AddModule'],
|
||||
'AppSettings.addType': ['POST', '/api/app/AddType'],
|
||||
'AppSettings.appAuthzList': ['GET', '/api/app/AppAuthzList'],
|
||||
'AppSettings.appList': ['GET', '/api/app/AppList'],
|
||||
'AppSettings.appSort': ['POST', '/api/app/AppSort'],
|
||||
'AppSettings.appSortList': ['GET', '/api/app/AppSortList'],
|
||||
'AppSettings.appTypeList': ['GET', '/api/app/AppTypeList'],
|
||||
'AppSettings.appTypeSort': ['POST', '/api/app/AppTypeSort'],
|
||||
'AppSettings.deleteApp': ['POST', '/api/app/DeleteApp/{id}'],
|
||||
'AppSettings.deleteModule': ['POST', '/api/app/DeleteModule/{id}'],
|
||||
'AppSettings.deleteType': ['POST', '/api/app/DeleteType/{id}'],
|
||||
'AppSettings.editApp': ['POST', '/api/app/EditApp/{id}'],
|
||||
'AppSettings.editModule': ['POST', '/api/app/EditModule/{id}'],
|
||||
'AppSettings.editType': ['POST', '/api/app/EditType/{id}'],
|
||||
'AppSettings.moduleList': ['GET', '/api/app/ModuleList'],
|
||||
'AppSettings.resetAppSecret': ['POST', '/api/app/ResetAppSecret/{id}'],
|
||||
'AppRole.removeRoleUser': ['POST', '/api/approle/RemoveRoleUser'],
|
||||
'AppRole.roleAdd': ['POST', '/api/approle/RoleAdd'],
|
||||
'AppRole.roleDelete': ['POST', '/api/approle/RoleDelete/{id}'],
|
||||
'AppRole.roleEdit': ['POST', '/api/approle/RoleEdit/{id}'],
|
||||
'AppRole.roleList': ['GET', '/api/approle/RoleList'],
|
||||
'AppRole.roleModuleTree': ['GET', '/api/approle/RoleModuleTree'],
|
||||
'AppRole.roleUsers': ['GET', '/api/approle/RoleUsers'],
|
||||
'AppRole.saveRoleModules': ['POST', '/api/approle/SaveRoleModules'],
|
||||
'AppRole.saveRoleUsers': ['POST', '/api/approle/SaveRoleUsers'],
|
||||
'AppRole.saveUserRoles': ['POST', '/api/approle/SaveUserRoles'],
|
||||
'Base.getSysDict': ['GET', '/api/base/GetSysDict'],
|
||||
'Base.getUserInfo': ['GET', '/api/base/GetUserInfo'],
|
||||
'Base.manualHashCacheDemo': ['GET', '/api/base/ManualHashCacheDemo'],
|
||||
'Base.RedirectTo': ['GET', '/api/base/RedirectTo/{id}'],
|
||||
'Base.uploadFile': ['POST', '/api/base/UploadFile'],
|
||||
'GroupAuthz.assignApps': ['POST', '/api/groupauthz/AssignApps'],
|
||||
'GroupAuthz.getSchoolAppId': ['GET', '/api/groupauthz/GetSchoolAppId'],
|
||||
'GroupAuthz.groupAppList': ['GET', '/api/groupauthz/GroupAppList'],
|
||||
'GroupAuthz.groupModuleTree': ['GET', '/api/groupauthz/GroupModuleTree'],
|
||||
'GroupAuthz.groupModuleTreeByCategory': ['GET', '/api/groupauthz/GroupModuleTreeByCategory'],
|
||||
'GroupAuthz.groupUsers': ['GET', '/api/groupauthz/GroupUsers'],
|
||||
'GroupAuthz.hasModulePerm': ['GET', '/api/groupauthz/HasModulePerm'],
|
||||
'GroupAuthz.saveModulePerms': ['POST', '/api/groupauthz/SaveModulePerms'],
|
||||
'GroupAuthz.searchUsers': ['GET', '/api/groupauthz/SearchUsers'],
|
||||
'GroupAuthz.setGroupModule': ['POST', '/api/groupauthz/SetGroupModule'],
|
||||
'GroupAuthz.setSchoolApp': ['POST', '/api/groupauthz/SetSchoolApp'],
|
||||
'GroupAuthz.userGroupTree': ['GET', '/api/groupauthz/UserGroupTree'],
|
||||
'GroupAuthz.userPermissionTree': ['GET', '/api/groupauthz/UserPermissionTree'],
|
||||
'GroupAuthz.userRoles': ['GET', '/api/groupauthz/UserRoles'],
|
||||
'OperationLog.list': ['GET', '/api/oplog/List'],
|
||||
'OperationLog.download': ['GET', '/api/oplog/Download/{id}'],
|
||||
'SysGroup.add': ['POST', '/api/sysgroup/Add'],
|
||||
'SysGroup.batchAdd': ['POST', '/api/sysgroup/BatchAdd'],
|
||||
'SysGroup.delete': ['POST', '/api/sysgroup/Delete/{id}'],
|
||||
'SysGroup.edit': ['POST', '/api/sysgroup/Edit/{id}'],
|
||||
'SysGroup.getSchoolTree': ['GET', '/api/sysgroup/GetSchoolTree'],
|
||||
'SysGroup.getTree': ['GET', '/api/sysgroup/GetTree'],
|
||||
'SysGroup.list': ['GET', '/api/sysgroup/List'],
|
||||
'SysGroup.move': ['POST', '/api/sysgroup/Move'],
|
||||
'SysGroup.sortChildren': ['POST', '/api/sysgroup/SortChildren'],
|
||||
'SysUser.add': ['POST', '/api/sysuser/Add'],
|
||||
'SysUser.delete': ['POST', '/api/sysuser/Delete/{id}'],
|
||||
'SysUser.disable': ['POST', '/api/sysuser/Disable/{id}'],
|
||||
'SysUser.edit': ['POST', '/api/sysuser/Edit/{id}'],
|
||||
'SysUser.enable': ['POST', '/api/sysuser/Enable/{id}'],
|
||||
'SysUser.list': ['GET', '/api/sysuser/List']
|
||||
};
|
||||
@@ -0,0 +1,97 @@
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* 用户中心接口文档 - version 0.0.1-SNAPSHOT
|
||||
*
|
||||
* Demo project for Spring Boot
|
||||
*
|
||||
* OpenAPI version: 3.0.0
|
||||
*
|
||||
* Contact:
|
||||
*
|
||||
* 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
+2949
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,11 @@
|
||||
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;
|
||||
@@ -0,0 +1,67 @@
|
||||
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,
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
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();
|
||||
@@ -0,0 +1,32 @@
|
||||
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