Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
I
ibizlab-generator
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
ibiz4jteam
ibizlab-generator
提交
67325e68
提交
67325e68
编写于
2月 08, 2022
作者:
tony001
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update:统一环境参数入口
上级
b0095911
变更
7
隐藏空白字符变更
内嵌
并排
正在显示
7 个修改的文件
包含
41 行增加
和
18 行删除
+41
-18
app.ts
...e/src/main/resources/templ/r7/app_{{apps}}/src/app/app.ts
+13
-3
i-app.ts
...ces/templ/r7/app_{{apps}}/src/core/interface/app/i-app.ts
+7
-0
app-base.ts
...es/templ/r7/app_{{apps}}/src/core/modules/app/app-base.ts
+11
-0
app-auth-service-base.ts
...s}}/src/core/service/app-service/app-auth-service-base.ts
+4
-5
tree-service.ts
...{{apps}}/src/core/service/control-service/tree-service.ts
+1
-2
entity-ui-service-base.ts
.../core/service/entity-ui-service/entity-ui-service-base.ts
+1
-2
interceptor.ts
...s/templ/r7/app_{{apps}}/src/core/utils/net/interceptor.ts
+4
-6
未找到文件。
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/app/app.ts
浏览文件 @
67325e68
import
{
SyncSeriesHook
}
from
"qx-util"
;
import
{
Environment
}
from
"@/environments/environment"
;
import
router
from
"@/router"
;
import
{
AppBase
,
IParam
,
ViewDetail
,
IApp
,
IOpenViewService
,
deepCopy
,
Http
,
IAppAuthService
,
IAppNotificationService
,
IAppFuncService
,
IAppActionService
,
IAppCodeListService
}
from
"@core"
;
import
{
AppFuncConfig
,
AppViewConfig
,
AppEntityConfig
}
from
'./config'
;
import
{
DataServiceRegister
,
UIServiceRegister
}
from
"./register"
;
import
{
Environment
}
from
"@/environments/environment"
;
import
{
AppActionService
,
AppAuthService
,
AppCodeListService
,
AppFuncService
,
AppNotificationService
,
OpenViewService
}
from
"@/service"
;
export
class
App
extends
AppBase
implements
IApp
{
...
...
@@ -174,6 +174,16 @@ export class App extends AppBase implements IApp {
return
AppEntityConfig
[
codeName
]
?
deepCopy
(
AppEntityConfig
[
codeName
])
:
undefined
;
}
/**
* 获取环境参数
*
* @return {*} {IParam}
* @memberof App
*/
public
getEnvironmentParam
():
IParam
{
return
Environment
;
}
/**
* @description 跳转登录页
*
...
...
@@ -181,8 +191,8 @@ export class App extends AppBase implements IApp {
*/
gotoLoginPage
():
void
{
const
currentRoute
=
unref
(
router
.
currentRoute
);
if
(
Environment
.
loginUrl
)
{
window
.
location
.
href
=
`
${
Environment
.
loginUrl
}
?redirect=
${
window
.
location
.
href
}
`
;
if
(
this
.
getEnvironmentParam
()
.
loginUrl
)
{
window
.
location
.
href
=
`
${
this
.
getEnvironmentParam
()
.
loginUrl
}
?redirect=
${
window
.
location
.
href
}
`
;
}
else
{
if
(
Object
.
is
(
currentRoute
.
name
,
'login'
))
{
return
;
...
...
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/core/interface/app/i-app.ts
浏览文件 @
67325e68
...
...
@@ -104,6 +104,13 @@ export interface IApp {
*/
getViewInfo
(
codeName
:
string
):
ViewDetail
|
undefined
;
/**
* 获取环境参数
*
* @return {*} {IParam}
* @memberof IApp
*/
getEnvironmentParam
():
IParam
;
/**
* 获取实体信息
...
...
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/core/modules/app/app-base.ts
浏览文件 @
67325e68
...
...
@@ -142,6 +142,17 @@ export abstract class AppBase implements IApp {
return
undefined
;
}
/**
* 获取环境参数
*
* @return {*} {IParam}
* @memberof AppBase
*/
public
getEnvironmentParam
():
IParam
{
throw
new
Error
(
"Method not implemented."
);
}
/**
* @description 获取实体信息
*
...
...
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/core/service/app-service/app-auth-service-base.ts
浏览文件 @
67325e68
import
qs
from
"qs"
;
import
{
clearCookie
,
getCookie
,
setCookie
}
from
"qx-util"
;
import
{
deepCopy
,
getSessionStorage
,
Http
,
IAppAuthService
,
IParam
,
removeSessionStorage
,
setSessionStorage
}
from
"@core"
;
import
{
Environment
}
from
"@/environments/environment"
;
/**
* 应用权限服务基类
...
...
@@ -65,7 +64,7 @@ export abstract class AppAuthServiceBase implements IAppAuthService {
* @memberof AppAuthServiceBase
*/
public
getEnablePermission
():
boolean
{
return
this
.
appData
.
enablepermissionvalid
&&
Environment
.
enablePermissionValid
;
return
this
.
appData
.
enablepermissionvalid
&&
App
.
getEnvironmentParam
()
.
enablePermissionValid
;
}
/**
...
...
@@ -77,7 +76,7 @@ export abstract class AppAuthServiceBase implements IAppAuthService {
*/
public
async
initAppAuth
(
params
:
IParam
,
hooks
:
IParam
):
Promise
<
any
>
{
let
result
=
true
;
if
(
Environment
&&
Environment
.
SaaSMode
)
{
if
(
App
.
getEnvironmentParam
()
&&
App
.
getEnvironmentParam
()
.
SaaSMode
)
{
if
(
getSessionStorage
(
'activeOrgData'
))
{
result
=
await
this
.
getAppInitData
(
hooks
,
params
);
}
else
{
...
...
@@ -251,8 +250,8 @@ export abstract class AppAuthServiceBase implements IAppAuthService {
tempViewParam
=
this
.
hanldeViewParam
(
tempViewParam
.
redirect
);
}
}
if
(
!
tempViewParam
.
srfdcsystem
&&
Environment
.
mockDcSystemId
)
{
Object
.
assign
(
tempViewParam
,
{
srfdcsystem
:
Environment
.
mockDcSystemId
});
if
(
!
tempViewParam
.
srfdcsystem
&&
App
.
getEnvironmentParam
()
.
mockDcSystemId
)
{
Object
.
assign
(
tempViewParam
,
{
srfdcsystem
:
App
.
getEnvironmentParam
()
.
mockDcSystemId
});
}
if
(
tempViewParam
.
srfdcsystem
)
{
hooks
.
dcSystemBefore
.
callSync
({
dcsystem
:
tempViewParam
.
srfdcsystem
});
...
...
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/core/service/control-service/tree-service.ts
浏览文件 @
67325e68
import
{
ControlServiceBase
,
ControlVOBase
,
deepCopy
,
IContext
,
IParam
,
isEmpty
,
TreeNodeRSVO
,
TreeNodeVO
}
from
"@core"
;
import
{
Environment
}
from
"@/environments/environment"
;
/**
* @description 树部件服务
...
...
@@ -416,7 +415,7 @@ export class TreeService<T extends ControlVOBase> extends ControlServiceBase<T>
}
if
(
context
&&
context
.
srfparentkey
)
{
Object
.
assign
(
searchFilter
,
{
srfparentkey
:
deepCopy
(
context
).
srfparentkey
});
if
(
Environment
&&
Environment
.
enableIssue
)
{
if
(
App
.
getEnvironmentParam
()
&&
App
.
getEnvironmentParam
()
.
enableIssue
)
{
Object
.
assign
(
searchFilter
,
{
nodeid
:
deepCopy
(
context
).
srfparentkey
});
}
}
...
...
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/core/service/entity-ui-service/entity-ui-service-base.ts
浏览文件 @
67325e68
import
{
IParam
}
from
"@core"
;
import
{
Environment
}
from
"@/environments/environment"
;
/**
* 界面服务基类
...
...
@@ -74,7 +73,7 @@ export class UIServiceBase {
* @memberof UIServiceBase
*/
protected
getAllOPPrivs
(
data
:
any
,
dataAccAction
:
string
)
{
if
(
!
Environment
.
enablePermissionValid
)
{
if
(
!
App
.
getEnvironmentParam
()
.
enablePermissionValid
)
{
return
1
;
}
if
(
data
&&
(
Object
.
keys
(
data
).
length
>
0
))
{
...
...
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/core/utils/net/interceptor.ts
浏览文件 @
67325e68
import
{
Environment
}
from
'@/environments/environment'
;
import
{
IParam
}
from
'@core'
;
import
{
clearCookie
,
getCookie
,
SyncSeriesHook
}
from
'qx-util'
;
import
{
getCookie
,
SyncSeriesHook
}
from
'qx-util'
;
import
{
getSessionStorage
}
from
'../util'
;
import
{
Http
}
from
'./http'
;
...
...
@@ -66,7 +64,7 @@ export class Interceptors {
private
intercept
():
void
{
Http
.
getHttp
().
interceptors
.
request
.
use
((
config
:
any
)
=>
{
Interceptors
.
hooks
.
request
.
callSync
({
config
:
config
});
if
(
Environment
.
SaaSMode
&&
(
!
config
.
url
.
startsWith
(
"/uaa/getbydcsystem/"
)))
{
if
(
App
.
getEnvironmentParam
()
.
SaaSMode
&&
(
!
config
.
url
.
startsWith
(
"/uaa/getbydcsystem/"
)))
{
let
activeOrgData
=
getSessionStorage
(
'activeOrgData'
);
config
.
headers
[
'srforgid'
]
=
activeOrgData
?.
orgid
;
config
.
headers
[
'srfsystemid'
]
=
activeOrgData
?.
systemid
;
...
...
@@ -74,8 +72,8 @@ export class Interceptors {
if
(
getCookie
(
'ibzuaa-token'
))
{
config
.
headers
[
'Authorization'
]
=
`Bearer
${
getCookie
(
'ibzuaa-token'
)}
`
;
}
if
(
!
Object
.
is
(
Environment
.
BaseUrl
,
""
)
&&
!
config
.
url
.
startsWith
(
'https://'
)
&&
!
config
.
url
.
startsWith
(
'http://'
)
&&
!
config
.
url
.
startsWith
(
'./assets'
))
{
config
.
url
=
Environment
.
BaseUrl
+
config
.
url
;
if
(
!
Object
.
is
(
App
.
getEnvironmentParam
()
.
BaseUrl
,
""
)
&&
!
config
.
url
.
startsWith
(
'https://'
)
&&
!
config
.
url
.
startsWith
(
'http://'
)
&&
!
config
.
url
.
startsWith
(
'./assets'
))
{
config
.
url
=
App
.
getEnvironmentParam
()
.
BaseUrl
+
config
.
url
;
}
return
config
;
},
(
error
:
any
)
=>
{
...
...
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录