提交 c3f00f37 编写于 作者: tony001's avatar tony001

增加权限服务

上级 74b49c90
...@@ -22,4 +22,15 @@ export default class ${srfclassname('${item.getCodeName()}')}AuthServiceBase ext ...@@ -22,4 +22,15 @@ export default class ${srfclassname('${item.getCodeName()}')}AuthServiceBase ext
super(opts); super(opts);
} }
/**
* 根据当前数据获取实体操作标识
*
* @param {string} name 实体名称
* @returns {Promise<any>}
* @memberof ${srfclassname('${item.getCodeName()}')}AuthServiceBase
*/
public async getOPPrivs(data:any):Promise<any>{
return null;
}
} }
\ No newline at end of file
<#ibiztemplate> <#ibiztemplate>
TARGET=PSAPPDATAENTITY TARGET=PSAPPDATAENTITY
</#ibiztemplate> </#ibiztemplate>
import { Http,Util } from '@/utils';
import ${srfclassname('${item.getCodeName()}')}AuthServiceBase from './${srffilepath2(item.getCodeName())}-auth-service-base'; import ${srfclassname('${item.getCodeName()}')}AuthServiceBase from './${srffilepath2(item.getCodeName())}-auth-service-base';
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
TARGET=PSSYSAPP TARGET=PSSYSAPP
</#ibiztemplate> </#ibiztemplate>
/** /**
* 实体数据服务注册中心 * 实体权限服务注册中心
* *
* @export * @export
* @class AuthServiceRegister * @class AuthServiceRegister
...@@ -10,7 +10,7 @@ TARGET=PSSYSAPP ...@@ -10,7 +10,7 @@ TARGET=PSSYSAPP
export class AuthServiceRegister { export class AuthServiceRegister {
/** /**
* 所有实体数据服务Map * 所有实体权限服务Map
* *
* @protected * @protected
* @type {*} * @type {*}
...@@ -19,7 +19,7 @@ export class AuthServiceRegister { ...@@ -19,7 +19,7 @@ export class AuthServiceRegister {
protected allAuthService: Map<string, () => Promise<any>> = new Map(); protected allAuthService: Map<string, () => Promise<any>> = new Map();
/** /**
* 已加载实体数据服务Map缓存 * 已加载实体权限服务Map缓存
* *
* @protected * @protected
* @type {Map<string, any>} * @type {Map<string, any>}
...@@ -44,13 +44,13 @@ export class AuthServiceRegister { ...@@ -44,13 +44,13 @@ export class AuthServiceRegister {
protected init(): void { protected init(): void {
<#if app.getAllPSAppDataEntities()??> <#if app.getAllPSAppDataEntities()??>
<#list app.getAllPSAppDataEntities() as curAppEntity> <#list app.getAllPSAppDataEntities() as curAppEntity>
this.allAuthService.set('${curAppEntity.getCodeName()?lower_case}', () => import('@/service/${srffilepath2(curAppEntity.getCodeName())}/${srffilepath2(curAppEntity.getCodeName())}-service')); this.allAuthService.set('${curAppEntity.getCodeName()?lower_case}', () => import('@/authservice/${srffilepath2(curAppEntity.getCodeName())}/${srffilepath2(curAppEntity.getCodeName())}-auth-service'));
</#list> </#list>
</#if> </#if>
} }
/** /**
* 加载实体数据服务 * 加载实体权限服务
* *
* @protected * @protected
* @param {string} serviceName * @param {string} serviceName
...@@ -65,7 +65,7 @@ export class AuthServiceRegister { ...@@ -65,7 +65,7 @@ export class AuthServiceRegister {
} }
/** /**
* 获取应用实体数据服务 * 获取应用实体权限服务
* *
* @param {string} name * @param {string} name
* @returns {Promise<any>} * @returns {Promise<any>}
...@@ -75,9 +75,9 @@ export class AuthServiceRegister { ...@@ -75,9 +75,9 @@ export class AuthServiceRegister {
if (this.serviceCache.has(name)) { if (this.serviceCache.has(name)) {
return this.serviceCache.get(name); return this.serviceCache.get(name);
} }
const entityService: any = await this.loadService(name); const authService: any = await this.loadService(name);
if (entityService && entityService.default) { if (authService && authService.default) {
const instance: any = new entityService.default(); const instance: any = new authService.default();
this.serviceCache.set(name, instance); this.serviceCache.set(name, instance);
return instance; return instance;
} }
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册