Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
I
ibizlab-generator
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
ibiz4jteam
ibizlab-generator
提交
4c428f64
提交
4c428f64
编写于
1月 25, 2022
作者:
tony001
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update:更新
上级
8aaf05fe
变更
20
显示空白字符变更
内嵌
并排
正在显示
20 个修改的文件
包含
433 行增加
和
92 行删除
+433
-92
app.ts
...e/src/main/resources/templ/r7/app_{{apps}}/src/app/app.ts
+15
-31
app-auth-service.ts
...templ/r7/app_{{apps}}/src/app/service/app-auth-service.ts
+31
-0
i-app.ts
...ces/templ/r7/app_{{apps}}/src/core/interface/app/i-app.ts
+19
-20
i-app-auth-service.ts
...{{apps}}/src/core/interface/service/i-app-auth-service.ts
+44
-0
index.ts
...templ/r7/app_{{apps}}/src/core/interface/service/index.ts
+2
-1
index.ts
...s/templ/r7/app_{{apps}}/src/core/logic/app-logic/index.ts
+0
-2
index.ts
...n/resources/templ/r7/app_{{apps}}/src/core/logic/index.ts
+0
-1
app-base.ts
...es/templ/r7/app_{{apps}}/src/core/modules/app/app-base.ts
+19
-28
view-base.ts
...pp_{{apps}}/src/core/modules/views/view-base/view-base.ts
+4
-4
app-action-service.ts
...src/core/service/app-action-service/app-action-service.ts
+1
-1
index.ts
...app_{{apps}}/src/core/service/app-action-service/index.ts
+1
-0
app-auth-service.ts
...s}}/src/core/service/app-auth-service/app-auth-service.ts
+237
-0
index.ts
...7/app_{{apps}}/src/core/service/app-auth-service/index.ts
+1
-0
app-func-service.ts
...s}}/src/core/service/app-func-service/app-func-service.ts
+0
-0
index.ts
...7/app_{{apps}}/src/core/service/app-func-service/index.ts
+1
-0
entity-ui-service-base.ts
.../core/service/entity-ui-service/entity-ui-service-base.ts
+50
-0
index.ts
.../app_{{apps}}/src/core/service/entity-ui-service/index.ts
+1
-0
index.ts
...resources/templ/r7/app_{{apps}}/src/core/service/index.ts
+6
-3
index.ts
...esources/templ/r7/app_{{apps}}/src/core/utils/ui/index.ts
+0
-1
index.ts.hbs
...n/resources/templ/r7/app_{{apps}}/src/router/index.ts.hbs
+1
-0
未找到文件。
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/app/app.ts
浏览文件 @
4c428f64
...
@@ -2,9 +2,10 @@ import { SyncSeriesHook } from "qx-util";
...
@@ -2,9 +2,10 @@ import { SyncSeriesHook } from "qx-util";
import
{
Environment
}
from
"@/environments/environment"
;
import
{
Environment
}
from
"@/environments/environment"
;
import
router
from
"@/router"
;
import
router
from
"@/router"
;
import
{
OpenViewService
}
from
"@/utils"
;
import
{
OpenViewService
}
from
"@/utils"
;
import
{
AppBase
,
IParam
,
ViewDetail
,
IApp
,
IOpenViewService
,
deepCopy
,
getSessionStorage
,
Http
,
AppUtil
}
from
"@core"
;
import
{
AppBase
,
IParam
,
ViewDetail
,
IApp
,
IOpenViewService
,
deepCopy
,
Http
,
IAppAuthService
}
from
"@core"
;
import
{
AppFuncConfig
,
AppViewConfig
,
AppEntityConfig
}
from
'./config'
;
import
{
AppFuncConfig
,
AppViewConfig
,
AppEntityConfig
}
from
'./config'
;
import
{
DataServiceRegister
,
UIServiceRegister
}
from
"./register"
;
import
{
DataServiceRegister
,
UIServiceRegister
}
from
"./register"
;
import
{
AppAuthService
}
from
"./service/app-auth-service"
;
export
class
App
extends
AppBase
implements
IApp
{
export
class
App
extends
AppBase
implements
IApp
{
...
@@ -50,31 +51,14 @@ export class App extends AppBase implements IApp {
...
@@ -50,31 +51,14 @@ export class App extends AppBase implements IApp {
}
}
/**
/**
* 初始化应用
权限
* 初始化应用
*
*
* @param {IParam} params 应用预置参数
* @param {IParam} params 应用预置参数
* @return {*} {Promise<any>}
* @return {*} {Promise<any>}
* @memberof App
* @memberof App
*/
*/
public
async
initAppAuth
(
params
:
IParam
):
Promise
<
any
>
{
public
async
initApp
(
params
:
IParam
):
Promise
<
any
>
{
let
result
=
true
;
return
await
this
.
getAppAuthService
().
initAppAuth
(
params
,
App
.
hooks
);
if
(
Environment
&&
Environment
.
SaaSMode
)
{
if
(
getSessionStorage
(
'activeOrgData'
))
{
result
=
await
AppUtil
.
getAppData
(
App
.
hooks
,
params
);
}
else
{
result
=
await
AppUtil
.
getOrgsByDcsystem
(
App
.
hooks
);
if
(
result
)
{
result
=
await
AppUtil
.
getAppData
(
App
.
hooks
,
params
);
}
}
}
else
{
result
=
await
AppUtil
.
getAppData
(
App
.
hooks
,
params
);
}
if
(
!
result
)
{
// 登录
}
// TODO
return
true
;
}
}
/**
/**
...
@@ -87,6 +71,16 @@ export class App extends AppBase implements IApp {
...
@@ -87,6 +71,16 @@ export class App extends AppBase implements IApp {
return
AppFuncConfig
;
return
AppFuncConfig
;
}
}
/**
* 获取应用权限服务
*
* @return {*} {IAppAuthService}
* @memberof App
*/
public
getAppAuthService
():
IAppAuthService
{
return
AppAuthService
.
getInstance
();
}
/**
/**
* 获取打开视图服务
* 获取打开视图服务
*
*
...
@@ -158,14 +152,4 @@ export class App extends AppBase implements IApp {
...
@@ -158,14 +152,4 @@ export class App extends AppBase implements IApp {
}
}
}
}
/**
* @description 登录
*
* @return {*} {Promise<IParam>}
* @memberof App
*/
handleLogin
():
Promise
<
IParam
>
{
throw
new
Error
(
"Method not implemented."
);
}
}
}
\ No newline at end of file
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/app/service/app-auth-service.ts
0 → 100644
浏览文件 @
4c428f64
import
{
AppAuthServiceBase
,
IAppAuthService
,
IParam
}
from
"@core"
;
/**
* 应用权限服务
*
* @export
* @class AppAuthService
*/
export
class
AppAuthService
extends
AppAuthServiceBase
implements
IAppAuthService
{
/**
* 唯一实例
*
* @private
* @static
* @memberof AppAuthService
*/
private
static
readonly
instance
=
new
AppAuthService
();
/**
* 获取唯一实例
*
* @static
* @return {*} {AppAuthService}
* @memberof AppAuthService
*/
public
static
getInstance
():
AppAuthService
{
return
AppAuthService
.
instance
;
}
}
\ No newline at end of file
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/core/interface/app/i-app.ts
浏览文件 @
4c428f64
import
{
IParam
,
ViewDetail
}
from
"../common"
;
import
{
IParam
,
ViewDetail
}
from
"../common"
;
import
{
IAppFuncService
,
IOpenViewService
}
from
"../service"
;
import
{
IApp
AuthService
,
IApp
FuncService
,
IOpenViewService
}
from
"../service"
;
/**
/**
...
@@ -11,21 +11,13 @@ import { IAppFuncService, IOpenViewService } from "../service";
...
@@ -11,21 +11,13 @@ import { IAppFuncService, IOpenViewService } from "../service";
export
interface
IApp
{
export
interface
IApp
{
/**
/**
* 初始化应用
权限
* 初始化应用
*
*
* @param {IParam} params 应用预置参数
* @param {IParam} params 应用预置参数
* @return {*} {Promise<any>}
* @return {*} {Promise<any>}
* @memberof IApp
* @memberof IApp
*/
*/
initAppAuth
(
params
:
IParam
):
Promise
<
any
>
;
initApp
(
params
:
IParam
):
Promise
<
any
>
;
/**
* 获取应用所有功能
*
* @return {*} {IParam[]}
* @memberof IApp
*/
getAllFuncs
():
IParam
[];
/**
/**
* 获取应用功能服务
* 获取应用功能服务
...
@@ -43,6 +35,14 @@ export interface IApp {
...
@@ -43,6 +35,14 @@ export interface IApp {
*/
*/
getOpenViewService
():
IOpenViewService
;
getOpenViewService
():
IOpenViewService
;
/**
* 获取应用权限服务
*
* @return {*} {IAppAuthService}
* @memberof IApp
*/
getAppAuthService
():
IAppAuthService
;
/**
/**
* 获取UI服务
* 获取UI服务
*
*
...
@@ -63,6 +63,14 @@ export interface IApp {
...
@@ -63,6 +63,14 @@ export interface IApp {
*/
*/
getDataService
(
entityKey
:
string
,
context
?:
IParam
):
Promise
<
any
>
;
getDataService
(
entityKey
:
string
,
context
?:
IParam
):
Promise
<
any
>
;
/**
* 获取应用所有功能
*
* @return {*} {IParam[]}
* @memberof IApp
*/
getAllFuncs
():
IParam
[];
/**
/**
* 获取指定视图信息
* 获取指定视图信息
*
*
...
@@ -82,7 +90,6 @@ export interface IApp {
...
@@ -82,7 +90,6 @@ export interface IApp {
*/
*/
getEntityInfo
(
codeName
:
string
):
any
;
getEntityInfo
(
codeName
:
string
):
any
;
/**
/**
* 获取应用数据
* 获取应用数据
*
*
...
@@ -106,12 +113,4 @@ export interface IApp {
...
@@ -106,12 +113,4 @@ export interface IApp {
*/
*/
gotoLoginPage
():
void
;
gotoLoginPage
():
void
;
/**
* @description 登录
*
* @return {*} {Promise<IParam>}
* @memberof IApp
*/
handleLogin
():
Promise
<
IParam
>
;
}
}
\ No newline at end of file
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/core/interface/service/i-app-auth-service.ts
0 → 100644
浏览文件 @
4c428f64
import
{
IParam
}
from
"../common"
;
/**
* @description 应用权限服务
* @export
* @interface IAppAuthService
*/
export
interface
IAppAuthService
{
/**
* 初始化应用权限
*
* @param {IParam} params 应用预置参数
* @return {*} {Promise<any>}
* @memberof IAppAuthService
*/
initAppAuth
(
params
:
IParam
,
hooks
:
IParam
):
Promise
<
any
>
;
/**
* 获取应用数据
*
* @return {*} {IParam}
* @memberof IAppAuthService
*/
getAppData
():
IParam
;
/**
* 设置应用数据
*
* @param {IParam} opt
* @memberof IAppAuthService
*/
setAppData
(
opt
:
IParam
):
void
;
/**
* 登录
*
* @param {IParam} params 应用预置参数
* @return {*} {Promise<any>}
* @memberof IAppAuthService
*/
login
(
opts
:
IParam
):
Promise
<
IParam
>
;
}
\ No newline at end of file
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/core/interface/service/index.ts
浏览文件 @
4c428f64
...
@@ -3,3 +3,4 @@ export * from './i-app-action-service';
...
@@ -3,3 +3,4 @@ export * from './i-app-action-service';
export
*
from
'./i-open-view-service'
;
export
*
from
'./i-open-view-service'
;
export
*
from
'./i-data-service-register'
;
export
*
from
'./i-data-service-register'
;
export
*
from
'./i-ui-service-register'
;
export
*
from
'./i-ui-service-register'
;
export
*
from
'./i-app-auth-service'
;
\ No newline at end of file
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/core/logic/app-logic/index.ts
已删除
100644 → 0
浏览文件 @
8aaf05fe
export
*
from
'./app-func-service'
;
export
*
from
'./app-action-service'
;
\ No newline at end of file
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/core/logic/index.ts
浏览文件 @
4c428f64
export
*
from
'./app-logic'
;
export
*
from
'./app-ui-action'
;
export
*
from
'./app-ui-action'
;
\ No newline at end of file
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/core/modules/app/app-base.ts
浏览文件 @
4c428f64
import
{
AppFuncService
,
IApp
,
IAppFuncService
,
IOpenViewService
,
ViewDetail
}
from
"@core"
;
import
{
AppFuncService
,
IApp
,
IAppFuncService
,
IOpenViewService
,
ViewDetail
}
from
"@core"
;
import
{
IParam
}
from
"@core/interface"
;
import
{
I
AppAuthService
,
I
Param
}
from
"@core/interface"
;
/**
/**
* 应用基类
* 应用基类
...
@@ -19,22 +19,12 @@ export abstract class AppBase implements IApp {
...
@@ -19,22 +19,12 @@ export abstract class AppBase implements IApp {
private
appFuncService
:
AppFuncService
=
AppFuncService
.
getInstance
();
private
appFuncService
:
AppFuncService
=
AppFuncService
.
getInstance
();
/**
/**
*
应用数据
*
初始化应用
*
*
* @private
* @param {IParam} opt
* @type {IParam}
* @memberof AppBase
*/
private
appData
:
IParam
=
{};
/**
* 初始化应用权限
*
* @param {IParam} params 应用预置参数
* @return {*} {Promise<any>}
* @memberof AppBase
* @memberof AppBase
*/
*/
public
async
initAppAuth
(
params
:
IParam
):
Promise
<
any
>
{
public
initApp
(
params
:
IParam
):
Promise
<
any
>
{
throw
new
Error
(
"Method not implemented."
);
throw
new
Error
(
"Method not implemented."
);
}
}
...
@@ -45,7 +35,7 @@ export abstract class AppBase implements IApp {
...
@@ -45,7 +35,7 @@ export abstract class AppBase implements IApp {
* @memberof AppBase
* @memberof AppBase
*/
*/
public
setAppData
(
opt
:
IParam
):
void
{
public
setAppData
(
opt
:
IParam
):
void
{
this
.
appData
=
opt
;
this
.
getAppAuthService
().
setAppData
(
opt
)
;
}
}
/**
/**
...
@@ -55,7 +45,17 @@ export abstract class AppBase implements IApp {
...
@@ -55,7 +45,17 @@ export abstract class AppBase implements IApp {
* @memberof AppBase
* @memberof AppBase
*/
*/
public
getAppData
():
IParam
{
public
getAppData
():
IParam
{
return
this
.
appData
;
return
this
.
getAppAuthService
().
getAppData
();
}
/**
* 获取应用权限服务
*
* @return {IAppFuncService}
* @memberof AppBase
*/
public
getAppAuthService
():
IAppAuthService
{
throw
new
Error
(
"Method not implemented."
);
}
}
/**
/**
...
@@ -132,21 +132,12 @@ export abstract class AppBase implements IApp {
...
@@ -132,21 +132,12 @@ export abstract class AppBase implements IApp {
}
}
/**
/**
* @description 跳转登录页
* @description 跳转登录页
面
*
*
* @memberof AppBase
* @memberof AppBase
*/
*/
gotoLoginPage
():
void
{
public
gotoLoginPage
():
void
{
throw
new
Error
(
"Method not implemented."
);
throw
new
Error
(
"Method not implemented."
);
}
}
/**
* @description 登录
*
* @return {*} {Promise<IParam>}
* @memberof AppBase
*/
handleLogin
():
Promise
<
IParam
>
{
throw
new
Error
(
"Method not implemented."
);
}
}
}
\ No newline at end of file
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/core/modules/views/view-base/view-base.ts
浏览文件 @
4c428f64
...
@@ -92,7 +92,7 @@ export class ViewBase {
...
@@ -92,7 +92,7 @@ export class ViewBase {
* 关闭视图
* 关闭视图
*
*
*/
*/
public
closeView
(){
public
closeView
()
{
window
.
history
.
go
(
-
1
);
window
.
history
.
go
(
-
1
);
}
}
...
@@ -109,8 +109,8 @@ export class ViewBase {
...
@@ -109,8 +109,8 @@ export class ViewBase {
const
{
appViewNavContexts
,
appViewNavParams
}
=
this
.
state
;
const
{
appViewNavContexts
,
appViewNavParams
}
=
this
.
state
;
if
(
Object
.
is
(
props
.
openType
,
'ROUTE'
))
{
if
(
Object
.
is
(
props
.
openType
,
'ROUTE'
))
{
// 应用上下文
// 应用上下文
const
app
Context
=
App
.
getAppData
();
const
app
Data
=
App
.
getAppData
();
Object
.
assign
(
context
.
value
,
app
Context
);
Object
.
assign
(
context
.
value
,
app
Data
.
context
?
appData
.
context
:
{}
);
// 视图应用上下文
// 视图应用上下文
const
pageContext
=
{};
const
pageContext
=
{};
const
routeParams
=
useRoute
().
params
;
const
routeParams
=
useRoute
().
params
;
...
...
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/core/
logic/app-logic
/app-action-service.ts
→
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/core/
service/app-action-service
/app-action-service.ts
浏览文件 @
4c428f64
import
{
hasFunction
}
from
"@core"
;
import
{
hasFunction
}
from
"@core"
;
import
{
IParam
,
IContext
,
IAppActionService
}
from
"@core/interface"
;
import
{
IParam
,
IContext
,
IAppActionService
}
from
"@core/interface"
;
import
{
AppSysAction
}
from
"../app-ui-action/app-sys-action"
;
import
{
AppSysAction
}
from
"../
../logic/
app-ui-action/app-sys-action"
;
export
class
AppActionService
implements
IAppActionService
{
export
class
AppActionService
implements
IAppActionService
{
...
...
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/core/service/app-action-service/index.ts
0 → 100644
浏览文件 @
4c428f64
export
{
AppActionService
}
from
'./app-action-service'
;
\ No newline at end of file
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/core/
utils/ui/app-util
.ts
→
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/core/
service/app-auth-service/app-auth-service
.ts
浏览文件 @
4c428f64
import
qs
from
"qs"
;
import
qs
from
"qs"
;
import
{
getCookie
}
from
"qx-util"
;
import
{
clearCookie
,
getCookie
,
setCookie
}
from
"qx-util"
;
import
{
deepCopy
,
getSessionStorage
,
Http
,
removeSessionStorage
,
setSessionStorage
}
from
"@core"
;
import
{
IParam
,
IAppAuthService
}
from
"@core/interface"
;
import
{
Environment
}
from
"@/environments/environment"
;
import
{
Environment
}
from
"@/environments/environment"
;
import
{
getSessionStorage
,
Http
,
IParam
,
setSessionStorage
}
from
"@core"
;
/**
export
abstract
class
AppAuthServiceBase
implements
IAppAuthService
{
* 应用相关处理逻辑工具类
/**
* 应用数据
*
*
* @export
* @private
* @class AppUtil
* @type {IParam}
* @memberof AppAuthServiceBase
*/
*/
export
class
AppUtil
{
private
appData
:
IParam
=
{};
/**
/**
* 获取应用数据
* 获取应用数据
*
*
* @static
* @return {*} {IParam}
* @memberof AppAuthServiceBase
*/
public
getAppData
():
IParam
{
return
this
.
appData
;
}
/**
* 设置应用数据
*
* @param {IParam} opt
* @memberof AppAuthServiceBase
*/
public
setAppData
(
opt
:
IParam
=
{}):
void
{
this
.
appData
=
opt
;
}
/**
* 初始化应用权限
*
* @param {IParam} params 应用预置参数
* @return {*} {Promise<any>}
* @memberof AppAuthServiceBase
*/
public
async
initAppAuth
(
params
:
IParam
,
hooks
:
IParam
):
Promise
<
any
>
{
let
result
=
true
;
if
(
Environment
&&
Environment
.
SaaSMode
)
{
if
(
getSessionStorage
(
'activeOrgData'
))
{
result
=
await
this
.
getAppInitData
(
hooks
,
params
);
}
else
{
result
=
await
this
.
getOrgsByDcsystem
(
hooks
);
if
(
result
)
{
result
=
await
this
.
getAppInitData
(
hooks
,
params
);
}
}
}
else
{
result
=
await
this
.
getAppInitData
(
hooks
,
params
);
}
return
result
;
}
/**
* 获取应用初始数据
*
* @param {IParam} hooks 应用钩子
* @param {IParam} hooks 应用钩子
* @param {IParam} [params={}] 应用参数
* @param {IParam} [params={}] 应用参数
* @return {*} {Promise<boolean>}
* @return {*} {Promise<boolean>}
* @memberof App
Util
* @memberof App
AuthServiceBase
*/
*/
public
static
async
getApp
Data
(
hooks
:
IParam
,
params
:
IParam
=
{}):
Promise
<
boolean
>
{
public
async
getAppInit
Data
(
hooks
:
IParam
,
params
:
IParam
=
{}):
Promise
<
boolean
>
{
try
{
try
{
const
url
=
'/appdata'
;
const
url
=
'/appdata'
;
hooks
.
appBefore
.
callSync
({
url
:
url
,
param
:
params
});
hooks
.
appBefore
.
callSync
({
url
:
url
,
param
:
params
});
...
@@ -32,22 +79,24 @@ export class AppUtil {
...
@@ -32,22 +79,24 @@ export class AppUtil {
return
false
;
return
false
;
}
}
// token认证把用户信息放入应用级数据
// token认证把用户信息放入应用级数据
let
localAppData
:
any
=
{};
if
(
getCookie
(
'ibzuaa-user'
))
{
if
(
getCookie
(
'ibzuaa-user'
))
{
let
user
:
any
=
JSON
.
parse
(
getCookie
(
'ibzuaa-user'
)
as
string
);
let
user
:
any
=
JSON
.
parse
(
getCookie
(
'ibzuaa-user'
)
as
string
);
let
localAppData
:
any
=
{};
if
(
user
.
sessionParams
)
{
if
(
user
.
sessionParams
)
{
localAppData
=
{
context
:
user
.
sessionParams
};
localAppData
=
{
context
:
user
.
sessionParams
};
Object
.
assign
(
localAppData
,
data
);
Object
.
assign
(
localAppData
,
data
);
}
else
{
Object
.
assign
(
localAppData
,
data
);
}
}
data
=
JSON
.
parse
(
JSON
.
stringify
(
localAppData
));
}
else
{
Object
.
assign
(
localAppData
,
data
);
}
}
App
.
setAppData
(
data
);
this
.
setAppData
(
deepCopy
(
localAppData
)
);
return
true
;
return
true
;
}
else
{
}
else
{
return
false
;
return
false
;
}
}
}
catch
(
error
)
{
}
catch
(
error
)
{
// App.gotoLoginPage();
return
false
;
return
false
;
}
}
}
}
...
@@ -58,9 +107,9 @@ export class AppUtil {
...
@@ -58,9 +107,9 @@ export class AppUtil {
* @static
* @static
* @param {IParam} hooks 应用钩子
* @param {IParam} hooks 应用钩子
* @return {*} {Promise<boolean>}
* @return {*} {Promise<boolean>}
* @memberof App
Util
* @memberof App
AuthServiceBase
*/
*/
public
static
async
getOrgsByDcsystem
(
hooks
:
IParam
):
Promise
<
boolean
>
{
public
async
getOrgsByDcsystem
(
hooks
:
IParam
):
Promise
<
boolean
>
{
try
{
try
{
let
tempViewParam
=
this
.
hanldeViewParam
(
window
.
location
.
href
);
let
tempViewParam
=
this
.
hanldeViewParam
(
window
.
location
.
href
);
if
(
!
tempViewParam
.
srfdcsystem
)
{
if
(
!
tempViewParam
.
srfdcsystem
)
{
...
@@ -95,20 +144,85 @@ export class AppUtil {
...
@@ -95,20 +144,85 @@ export class AppUtil {
return
false
;
return
false
;
}
}
}
catch
(
error
)
{
}
catch
(
error
)
{
// App.gotoLoginPage();
return
false
;
return
false
;
}
}
}
}
/**
* @description 登录
*
* @memberof AppAuthServiceBase
*/
public
async
login
(
opts
:
IParam
):
Promise
<
IParam
>
{
try
{
this
.
clearAppData
();
const
result
:
IParam
=
await
Http
.
getInstance
().
post
(
'/v7/login'
,
opts
,
true
);
const
{
status
,
data
}
=
result
;
if
(
status
==
200
)
{
if
(
data
&&
data
.
token
)
{
setCookie
(
'ibzuaa-token'
,
data
.
token
,
7
,
true
);
}
if
(
data
&&
data
.
user
)
{
setCookie
(
'ibzuaa-user'
,
JSON
.
stringify
(
data
.
user
),
7
,
true
);
}
setCookie
(
'loginname'
,
opts
.
loginname
,
7
,
true
);
return
result
;
}
else
{
return
result
;
}
}
catch
(
error
:
any
)
{
return
error
;
}
}
/**
* 登出
*
* @return {*} {Promise<IParam>}
* @memberof AppAuthServiceBase
*/
public
async
logout
():
Promise
<
IParam
>
{
try
{
const
result
:
IParam
=
await
Http
.
getInstance
().
get
(
'/v7/logout'
);
const
{
status
,
data
}
=
result
;
if
(
status
===
200
)
{
this
.
clearAppData
();
return
data
;
}
else
{
return
data
;
}
}
catch
(
error
:
any
)
{
return
error
;
}
}
/**
* 清除应用级数据
*
* @memberof AppAuthServiceBase
*/
public
clearAppData
()
{
// 清除登录信息
clearCookie
(
'ibzuaa-token'
,
true
);
clearCookie
(
'ibzuaa-user'
,
true
);
clearCookie
(
'loginname'
,
true
);
// 清除应用级数据
this
.
setAppData
();
// 清除租户相关信息
removeSessionStorage
(
'dcsystem'
);
removeSessionStorage
(
'orgsData'
);
removeSessionStorage
(
'activeOrgData'
);
}
/**
/**
* 处理路径数据
* 处理路径数据
*
*
* @static
* @param {string} urlStr 路径
* @param {string} urlStr 路径
* @return {*} {*}
* @return {*} {*}
* @memberof App
Util
* @memberof App
AuthServiceBase
*/
*/
public
static
hanldeViewParam
(
urlStr
:
string
):
any
{
public
hanldeViewParam
(
urlStr
:
string
):
any
{
let
tempViewParam
:
any
=
{};
let
tempViewParam
:
any
=
{};
const
tempViewparam
:
any
=
urlStr
.
slice
(
urlStr
.
indexOf
(
'?'
)
+
1
);
const
tempViewparam
:
any
=
urlStr
.
slice
(
urlStr
.
indexOf
(
'?'
)
+
1
);
const
viewparamArray
:
Array
<
string
>
=
decodeURIComponent
(
tempViewparam
).
split
(
';'
);
const
viewparamArray
:
Array
<
string
>
=
decodeURIComponent
(
tempViewparam
).
split
(
';'
);
...
...
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/core/service/app-auth-service/index.ts
0 → 100644
浏览文件 @
4c428f64
export
{
AppAuthServiceBase
}
from
'./app-auth-service'
;
\ No newline at end of file
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/core/
logic/app-logic
/app-func-service.ts
→
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/core/
service/app-func-service
/app-func-service.ts
浏览文件 @
4c428f64
文件已移动
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/core/service/app-func-service/index.ts
0 → 100644
浏览文件 @
4c428f64
export
{
AppFuncService
}
from
'./app-func-service'
;
\ No newline at end of file
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/core/service/entity-ui-service/entity-ui-service-base.ts
0 → 100644
浏览文件 @
4c428f64
import
{
IParam
}
from
"@core"
;
/**
* 界面服务基类
*
* @export
* @class UIServiceBase
*/
export
class
UIServiceBase
{
/**
* 应用上下文
*
* @protected
* @type {IParam}
* @memberof UIServiceBase
*/
protected
context
:
IParam
;
/**
*
* @param {*} [opts={}]
* @memberof UIServiceBase
*/
constructor
(
context
:
IParam
=
{})
{
this
.
context
=
context
;
}
/**
* 界面行为模型对象
*
* @type {*}
* @memberof UIServiceBase
*/
public
uiActionModes
:
any
=
{};
/**
*
* 获取界面行为模型对象
*
* @param {string} actionName
* @memberof UIServiceBase
*/
public
getUIActionModel
(
actionName
:
string
)
{
if
(
!
actionName
)
{
return
;
}
return
this
.
uiActionModes
[
actionName
]
?
this
.
uiActionModes
[
actionName
]
:
null
;
}
}
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/core/service/entity-ui-service/index.ts
0 → 100644
浏览文件 @
4c428f64
export
{
UIServiceBase
}
from
'./entity-ui-service-base'
;
\ No newline at end of file
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/core/service/index.ts
浏览文件 @
4c428f64
export
*
from
'./control-service'
export
*
from
'./app-action-service'
;
export
*
from
'./entity-service'
export
*
from
'./app-auth-service'
;
export
*
from
'./ui-service'
export
*
from
'./app-func-service'
;
\ No newline at end of file
export
*
from
'./control-service'
;
export
*
from
'./entity-service'
;
export
*
from
'./entity-ui-service'
;
\ No newline at end of file
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/core/utils/ui/index.ts
浏览文件 @
4c428f64
...
@@ -2,5 +2,4 @@ export { RouteUtil } from './route-util';
...
@@ -2,5 +2,4 @@ export { RouteUtil } from './route-util';
export
{
UIUtil
}
from
'./ui-util'
;
export
{
UIUtil
}
from
'./ui-util'
;
export
{
UIActionUtil
}
from
'./uiaction-util'
;
export
{
UIActionUtil
}
from
'./uiaction-util'
;
export
{
ViewUtil
}
from
'./view-util'
;
export
{
ViewUtil
}
from
'./view-util'
;
export
{
AppUtil
}
from
'./app-util'
;
export
{
DataTypes
}
from
'./data-types'
;
export
{
DataTypes
}
from
'./data-types'
;
\ No newline at end of file
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/router/index.ts.hbs
浏览文件 @
4c428f64
...
@@ -59,6 +59,7 @@ const routes = [
...
@@ -59,6 +59,7 @@ const routes = [
},
},
{
{
path: '/404',
path: '/404',
name: '404',
component: () => import('@components/common/404.vue')
component: () => import('@components/common/404.vue')
},
},
{
{
...
...
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录