Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
浙江兰德纵横网络技术股份有限公司
o2oa
提交
c05056a4
o2oa
项目概览
浙江兰德纵横网络技术股份有限公司
/
o2oa
通知
339
Star
10
Fork
6
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
o2oa
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
c05056a4
编写于
7月 27, 2021
作者:
U
unknown
1
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
代理和接口增加调试功能
上级
a95c9f6a
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
119 addition
and
115 deletion
+119
-115
o2web/source/o2_core/o2/xDesktop/Actions/RestActions.js
o2web/source/o2_core/o2/xDesktop/Actions/RestActions.js
+119
-115
未找到文件。
o2web/source/o2_core/o2/xDesktop/Actions/RestActions.js
浏览文件 @
c05056a4
MWF
.
xDesktop
.
Actions
=
MWF
.
xDesktop
.
Actions
||
{};
MWF
.
xDesktop
.
Actions
.
RestActions
=
new
Class
({
Implements
:
[
Events
],
initialize
:
function
(
actionPath
,
serviceName
,
root
){
this
.
actionPath
=
actionPath
;
this
.
serviceName
=
serviceName
;
initialize
:
function
(
actionPath
,
serviceName
,
root
){
this
.
actionPath
=
actionPath
;
this
.
serviceName
=
serviceName
;
this
.
root
=
root
;
},
listApplicationAddress
:
function
(
success
,
failure
){
var
url
=
this
.
actions
.
listAddress
;
url
=
this
.
actions
.
slotHost
+
url
;
var
callback
=
new
MWF
.
xApplication
.
Common
.
Actions
.
RestActions
.
Callback
(
success
,
failure
);
MWF
.
getJSON
(
url
,
callback
);
},
getAddress
:
function
(
success
,
failure
){
},
listApplicationAddress
:
function
(
success
,
failure
){
var
url
=
this
.
actions
.
listAddress
;
url
=
this
.
actions
.
slotHost
+
url
;
var
callback
=
new
MWF
.
xApplication
.
Common
.
Actions
.
RestActions
.
Callback
(
success
,
failure
);
MWF
.
getJSON
(
url
,
callback
);
},
getAddress
:
function
(
success
,
failure
){
// var name = "x_processplatform_core_designer";
// var url = this.actions.getAddress.replace(/{id}/g, name);
// url = this.actions.slotHost+url;
// var callback = new MWF.process.RestActions.Callback(success, failure, function(data){
// this.designAddress = data.data.url;
// }.bind(this));
// MWF.getJSON(url, callback);
//this.address = "http://xa02.zoneland.net:8080/"+this.serviceName;
//this.address = "http://xa02.zoneland.net:8080/"+this.serviceName;
var
addressObj
=
layout
.
serviceAddressList
[
this
.
serviceName
];
if
(
addressObj
){
...
...
@@ -38,11 +38,11 @@ MWF.xDesktop.Actions.RestActions = new Class({
}
//this.address = "http://hbxa01.bf.ctc.com/"+this.serviceName;
//this.designAddress = "http://localhost:9080/x_processplatform_front_designer";
if
(
success
)
success
.
apply
();
//this.designAddress = "http://localhost:9080/x_processplatform_front_designer";
if
(
success
)
success
.
apply
();
return
this
.
address
;
},
getActions
:
function
(
callback
){
},
getActions
:
function
(
callback
){
if
(
!
this
.
actions
){
var
url
=
(
this
.
root
)
?
"
/
"
+
this
.
root
+
this
.
actionPath
:
MWF
.
defaultPath
+
this
.
actionPath
;
...
...
@@ -68,7 +68,7 @@ MWF.xDesktop.Actions.RestActions = new Class({
}
MWF
.
restful
(
method
,
uri
,
data
,
callback
,
async
,
credentials
);
},
invoke
:
function
(
option
){
invoke
:
function
(
option
){
if
(
window
.
importScripts
&&
window
.
isCompletionEnvironment
)
return
null
;
if
(
!
this
.
address
)
this
.
getAddress
();
var
res
=
null
;
...
...
@@ -142,10 +142,10 @@ MWF.xDesktop.Actions.RestActions = new Class({
}
}.
bind
(
this
));
return
res
;
},
formDataUpdateProgress
:
function
(){
},
},
formDataUpdateProgress
:
function
(){
},
invokeFormDataWithProgress
:
function
(
xhr
,
method
,
uri
,
data
,
file
,
callback
,
async
,
progress
){
var
messageItem
=
null
;
...
...
@@ -445,13 +445,13 @@ MWF.xDesktop.Actions.RestActions = new Class({
var
submitNode
=
new
Element
(
"
input
"
,
{
"
type
"
:
"
submit
"
}).
inject
(
formNode
);
// formNode.submit();
// formNode.submit();
},
invokeFormData
:
function
(
method
,
uri
,
data
,
file
,
callback
,
async
,
progress
){
invokeFormData
:
function
(
method
,
uri
,
data
,
file
,
callback
,
async
,
progress
){
uri
=
o2
.
filterUrl
(
uri
);
var
xhr
=
new
COMMON
.
Browser
.
Request
();
if
(
file
){
var
xhr
=
new
COMMON
.
Browser
.
Request
();
if
(
file
){
data
.
append
(
'
fileName
'
,
file
.
name
);
}
...
...
@@ -465,8 +465,8 @@ MWF.xDesktop.Actions.RestActions = new Class({
}
}
return
xhr
;
},
addFormDataMessage
:
function
(
file
,
noProgress
,
xhr
,
showMsg
){
},
addFormDataMessage
:
function
(
file
,
noProgress
,
xhr
,
showMsg
){
if
(
layout
.
desktop
.
message
){
var
contentHTML
=
""
;
...
...
@@ -541,94 +541,98 @@ MWF.xDesktop.Actions.RestActions = new Class({
//};
//var tooltipItem = layout.desktop.message.addTooltip(msg);
return
messageItem
;
},
getAuthentication
:
function
(
success
,
failure
){
this
.
invoke
({
"
name
"
:
"
authentication
"
,
"
async
"
:
true
,
"
success
"
:
function
(
json
,
responseText
){
if
(
json
.
data
.
tokenType
!=
"
anonymous
"
){
if
(
success
)
success
(
json
);
}
else
{
if
(
failure
)
failure
(
null
,
responseText
,
json
.
message
);
}
},
"
failure
"
:
failure
});
},
login
:
function
(
data
,
success
,
failure
){
},
getAuthentication
:
function
(
success
,
failure
){
this
.
invoke
({
"
name
"
:
"
authentication
"
,
"
async
"
:
true
,
"
success
"
:
function
(
json
,
responseText
){
if
(
json
.
data
.
tokenType
!=
"
anonymous
"
){
if
(
success
)
success
(
json
);
}
else
{
if
(
failure
)
failure
(
null
,
responseText
,
json
.
message
);
}
},
"
failure
"
:
failure
});
},
login
:
function
(
data
,
success
,
failure
){
var
name
=
"
login
"
;
// if (data.credential.toLowerCase()=="xadmin") name = "loginAdmin";
this
.
invoke
({
"
name
"
:
name
,
"
async
"
:
true
,
"
data
"
:
data
,
"
success
"
:
function
(
json
,
responseText
){
//if (json.data.authentication){
// if (data.credential.toLowerCase()=="xadmin") name = "loginAdmin";
this
.
invoke
({
"
name
"
:
name
,
"
async
"
:
true
,
"
data
"
:
data
,
"
success
"
:
function
(
json
,
responseText
){
//if (json.data.authentication){
if
(
json
.
data
.
tokenType
!=
"
anonymous
"
){
if
(
success
)
success
(
json
);
}
else
{
if
(
failure
)
failure
(
null
,
responseText
,
json
.
message
);
}
},
"
failure
"
:
failure
});
},
logout
:
function
(
success
,
failure
){
this
.
invoke
({
"
name
"
:
"
logout
"
,
"
async
"
:
false
,
"
success
"
:
success
,
"
failure
"
:
failure
});
}
if
(
success
)
success
(
json
);
}
else
{
if
(
failure
)
failure
(
null
,
responseText
,
json
.
message
);
}
},
"
failure
"
:
failure
});
},
logout
:
function
(
success
,
failure
){
this
.
invoke
({
"
name
"
:
"
logout
"
,
"
async
"
:
false
,
"
success
"
:
success
,
"
failure
"
:
failure
});
}
});
MWF
.
xDesktop
.
Actions
.
RestActions
.
Callback
=
new
Class
({
initialize
:
function
(
success
,
failure
,
appendSuccess
,
appendFailure
){
this
.
success
=
success
;
this
.
failure
=
failure
;
this
.
appendSuccess
=
appendSuccess
;
this
.
appendFailure
=
appendFailure
;
},
onSuccess
:
function
(
responseJSON
,
responseText
){
if
(
responseJSON
){
switch
(
responseJSON
.
type
)
{
case
"
success
"
:
if
(
this
.
appendSuccess
)
this
.
appendSuccess
(
responseJSON
);
if
(
this
.
success
)
return
this
.
success
(
responseJSON
,
responseText
);
return
responseJSON
;
break
;
case
"
warn
"
:
MWF
.
xDesktop
.
notice
(
"
info
"
,
{
x
:
"
right
"
,
y
:
"
top
"
},
responseJSON
.
errorMessage
.
join
(
"
\n
"
));
if
(
this
.
appendSuccess
)
this
.
appendSuccess
(
responseJSON
);
if
(
this
.
success
)
return
this
.
success
(
responseJSON
);
return
responseJSON
;
break
;
case
"
error
"
:
return
this
.
doError
(
null
,
responseText
,
responseJSON
.
message
);
return
responseJSON
;
break
;
}
}
else
{
initialize
:
function
(
success
,
failure
,
appendSuccess
,
appendFailure
){
this
.
success
=
success
;
this
.
failure
=
failure
;
this
.
appendSuccess
=
appendSuccess
;
this
.
appendFailure
=
appendFailure
;
},
onSuccess
:
function
(
responseJSON
,
responseText
){
if
(
responseJSON
){
switch
(
responseJSON
.
type
)
{
// case "success":
// if (this.appendSuccess) this.appendSuccess(responseJSON);
// if (this.success) return this.success(responseJSON, responseText);
// return responseJSON;
// break;
case
"
warn
"
:
MWF
.
xDesktop
.
notice
(
"
info
"
,
{
x
:
"
right
"
,
y
:
"
top
"
},
responseJSON
.
errorMessage
.
join
(
"
\n
"
));
if
(
this
.
appendSuccess
)
this
.
appendSuccess
(
responseJSON
);
if
(
this
.
success
)
return
this
.
success
(
responseJSON
);
return
responseJSON
;
break
;
case
"
error
"
:
return
this
.
doError
(
null
,
responseText
,
responseJSON
.
message
);
return
responseJSON
;
break
;
default
:
if
(
this
.
appendSuccess
)
this
.
appendSuccess
(
responseJSON
);
if
(
this
.
success
)
return
this
.
success
(
responseJSON
,
responseText
);
return
responseJSON
;
break
;
}
}
else
{
return
this
.
doError
(
null
,
responseText
,
""
);
}
},
onRequestFailure
:
function
(
xhr
){
return
this
.
doError
(
xhr
,
""
,
""
);
},
onFailure
:
function
(
xhr
,
text
,
error
){
}
},
onRequestFailure
:
function
(
xhr
){
return
this
.
doError
(
xhr
,
""
,
""
);
},
onFailure
:
function
(
xhr
,
text
,
error
){
return
this
.
doError
(
xhr
,
text
,
error
);
},
onError
:
function
(
text
,
error
){
},
onError
:
function
(
text
,
error
){
return
this
.
doError
(
null
,
text
,
error
);
},
doError
:
function
(
xhr
,
text
,
error
){
if
(
this
.
appendFailure
)
this
.
appendFailure
(
xhr
,
text
,
error
);
if
(
this
.
failure
&&
this
.
failure
.
owner
){
},
doError
:
function
(
xhr
,
text
,
error
){
if
(
this
.
appendFailure
)
this
.
appendFailure
(
xhr
,
text
,
error
);
if
(
this
.
failure
&&
this
.
failure
.
owner
){
if
(
this
.
failure
.
reject
||
(
this
.
failure
.
rejectList
&&
this
.
failure
.
rejectList
.
length
)){
return
this
.
failure
(
xhr
,
text
,
error
);
}
...
...
@@ -636,7 +640,7 @@ MWF.xDesktop.Actions.RestActions.Callback = new Class({
}
else
{
if
(
this
.
failure
)
return
this
.
failure
(
xhr
,
text
,
error
);
}
if
(
!
this
.
failure
&&
!
this
.
appendFailure
){
if
(
!
this
.
failure
&&
!
this
.
appendFailure
){
if
(
xhr
.
status
!=
0
){
var
errorText
=
error
;
if
(
xhr
){
...
...
@@ -651,8 +655,8 @@ MWF.xDesktop.Actions.RestActions.Callback = new Class({
errorText
=
errorText
.
replace
(
/
\<
/g
,
"
>
"
);
if
(
layout
.
session
&&
layout
.
session
.
user
)
MWF
.
xDesktop
.
notice
(
"
error
"
,
{
x
:
"
right
"
,
y
:
"
top
"
},
errorText
);
}
// throw "request error: "+errorText;
}
return
Promise
.
reject
(
xhr
);
}
// throw "request error: "+errorText;
}
return
Promise
.
reject
(
xhr
);
}
});
liyi_hz2008
@liyi_hz2008
mentioned in commit
22d51583
·
7月 27, 2021
mentioned in commit
22d51583
mentioned in commit 22d51583621ecce395801a3e3c50df2daad258b7
开关提交列表
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录