Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
sdkjs
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boris Kocherov
sdkjs
Commits
8c689a77
Commit
8c689a77
authored
Oct 10, 2017
by
konovalovsergey
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
NoCritical -> Critical (jwtExpired, jwtError)
parent
7c4f7001
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
31 deletions
+35
-31
common/apiBase.js
common/apiBase.js
+3
-3
common/docscoapi.js
common/docscoapi.js
+32
-28
No files found.
common/apiBase.js
View file @
8c689a77
...
...
@@ -748,16 +748,16 @@
* @param {Bool} isDisconnectAtAll окончательно ли отсоединяемся(true) или будем пробовать сделать reconnect(false) + сами отключились
* @param {Bool} isCloseCoAuthoring
*/
this
.
CoAuthoringApi
.
onDisconnect
=
function
(
e
,
error
Code
)
this
.
CoAuthoringApi
.
onDisconnect
=
function
(
e
,
error
)
{
if
(
AscCommon
.
ConnectionState
.
None
===
t
.
CoAuthoringApi
.
get_state
())
{
t
.
asyncServerIdEndLoaded
();
}
if
(
null
!=
error
Code
)
if
(
null
!=
error
)
{
t
.
setViewModeDisconnect
();
t
.
sendEvent
(
'
asc_onError
'
,
error
Code
,
c_oAscError
.
Level
.
NoCritica
l
);
t
.
sendEvent
(
'
asc_onError
'
,
error
.
code
,
error
.
leve
l
);
}
};
this
.
CoAuthoringApi
.
onDocumentOpen
=
function
(
inputWrap
)
{
...
...
common/docscoapi.js
View file @
8c689a77
...
...
@@ -122,8 +122,8 @@
this
.
_CoAuthoringApi
.
onLocksReleasedEnd
=
function
()
{
t
.
callback_OnLocksReleasedEnd
();
};
this
.
_CoAuthoringApi
.
onDisconnect
=
function
(
e
,
error
Code
)
{
t
.
callback_OnDisconnect
(
e
,
error
Code
);
this
.
_CoAuthoringApi
.
onDisconnect
=
function
(
e
,
error
)
{
t
.
callback_OnDisconnect
(
e
,
error
);
};
this
.
_CoAuthoringApi
.
onWarning
=
function
(
e
)
{
t
.
callback_OnWarning
(
e
);
...
...
@@ -457,11 +457,11 @@
/**
* Event об отсоединении от сервера
* @param {jQuery} e event об отсоединении с причиной
* @param {
Asc.c_oAscError.ID} errorCode
* @param {
code: Asc.c_oAscError.ID, level: Asc.c_oAscError.Level} error
*/
CDocsCoApi
.
prototype
.
callback_OnDisconnect
=
function
(
e
,
error
Code
)
{
CDocsCoApi
.
prototype
.
callback_OnDisconnect
=
function
(
e
,
error
)
{
if
(
this
.
onDisconnect
)
{
this
.
onDisconnect
(
e
,
error
Code
);
this
.
onDisconnect
(
e
,
error
);
}
};
...
...
@@ -1672,13 +1672,13 @@
this
.
_state
=
ConnectionState
.
Reconnect
;
var
bIsDisconnectAtAll
=
((
c_oCloseCode
.
serverShutdown
<=
evt
.
code
&&
evt
.
code
<=
c_oCloseCode
.
jwtError
)
||
this
.
attemptCount
>=
this
.
maxAttemptCount
);
var
error
Code
=
null
;
var
error
=
null
;
if
(
bIsDisconnectAtAll
)
{
this
.
_state
=
ConnectionState
.
ClosedAll
;
error
Code
=
this
.
_getDisconnectErrorCode
(
evt
.
code
);
error
=
this
.
_getDisconnectErrorCode
(
evt
.
code
);
}
if
(
this
.
onDisconnect
)
{
this
.
onDisconnect
(
evt
.
reason
,
error
Code
);
this
.
onDisconnect
(
evt
.
reason
,
error
);
}
//Try reconect
if
(
!
bIsDisconnectAtAll
)
{
...
...
@@ -1701,26 +1701,30 @@
},
this
.
reconnectInterval
);
};
DocsCoApi
.
prototype
.
_getDisconnectErrorCode
=
function
(
opt_closeCode
)
{
if
(
c_oCloseCode
.
serverShutdown
===
opt_closeCode
)
{
return
Asc
.
c_oAscError
.
ID
.
CoAuthoringDisconnect
;
}
else
if
(
c_oCloseCode
.
sessionIdle
===
opt_closeCode
)
{
return
Asc
.
c_oAscError
.
ID
.
SessionIdle
;
}
else
if
(
c_oCloseCode
.
sessionAbsolute
===
opt_closeCode
)
{
return
Asc
.
c_oAscError
.
ID
.
SessionAbsolute
;
}
else
if
(
c_oCloseCode
.
accessDeny
===
opt_closeCode
)
{
return
Asc
.
c_oAscError
.
ID
.
AccessDeny
;
}
else
if
(
c_oCloseCode
.
jwtExpired
===
opt_closeCode
)
{
if
(
this
.
jwtSession
)
{
return
Asc
.
c_oAscError
.
ID
.
SessionToken
;
}
else
{
return
Asc
.
c_oAscError
.
ID
.
KeyExpire
;
}
}
else
if
(
c_oCloseCode
.
jwtError
===
opt_closeCode
)
{
return
Asc
.
c_oAscError
.
ID
.
VKeyEncrypt
;
}
return
this
.
isCloseCoAuthoring
?
Asc
.
c_oAscError
.
ID
.
UserDrop
:
Asc
.
c_oAscError
.
ID
.
CoAuthoringDisconnect
;
};
DocsCoApi
.
prototype
.
_getDisconnectErrorCode
=
function
(
opt_closeCode
)
{
var
code
=
this
.
isCloseCoAuthoring
?
Asc
.
c_oAscError
.
ID
.
UserDrop
:
Asc
.
c_oAscError
.
ID
.
CoAuthoringDisconnect
;
var
level
=
Asc
.
c_oAscError
.
Level
.
NoCritical
;
if
(
c_oCloseCode
.
serverShutdown
===
opt_closeCode
)
{
code
=
Asc
.
c_oAscError
.
ID
.
CoAuthoringDisconnect
;
}
else
if
(
c_oCloseCode
.
sessionIdle
===
opt_closeCode
)
{
code
=
Asc
.
c_oAscError
.
ID
.
SessionIdle
;
}
else
if
(
c_oCloseCode
.
sessionAbsolute
===
opt_closeCode
)
{
code
=
Asc
.
c_oAscError
.
ID
.
SessionAbsolute
;
}
else
if
(
c_oCloseCode
.
accessDeny
===
opt_closeCode
)
{
code
=
Asc
.
c_oAscError
.
ID
.
AccessDeny
;
}
else
if
(
c_oCloseCode
.
jwtExpired
===
opt_closeCode
)
{
if
(
this
.
jwtSession
)
{
code
=
Asc
.
c_oAscError
.
ID
.
SessionToken
;
}
else
{
code
=
Asc
.
c_oAscError
.
ID
.
KeyExpire
;
level
=
Asc
.
c_oAscError
.
Level
.
Critical
;
}
}
else
if
(
c_oCloseCode
.
jwtError
===
opt_closeCode
)
{
code
=
Asc
.
c_oAscError
.
ID
.
VKeyEncrypt
;
level
=
Asc
.
c_oAscError
.
Level
.
Critical
;
}
return
{
code
:
code
,
level
:
level
};
};
//----------------------------------------------------------export----------------------------------------------------
window
[
'
AscCommon
'
]
=
window
[
'
AscCommon
'
]
||
{};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment