...
|
...
|
@@ -599,7 +599,6 @@ App.main = function(callback, createUi) |
599
|
599
|
defHttp = createAxios({
|
600
|
600
|
timeout:10*1000,
|
601
|
601
|
baseURL:'/api',
|
602
|
|
- token: GLOBAL_TOKEN
|
603
|
602
|
})
|
604
|
603
|
// Logs uncaught errors
|
605
|
604
|
window.onerror = function(message, url, linenumber, colno, err)
|
...
|
...
|
@@ -4991,33 +4990,69 @@ App.prototype.loadFile = function (id, sameWindow, file, success, force) { |
4991
|
4990
|
if (urlParams['openInSameWin'] == '1' || navigator.standalone) {
|
4992
|
4991
|
sameWindow = true;
|
4993
|
4992
|
}
|
4994
|
|
- //调用API,获取保存的内容
|
4995
|
|
- defHttp.get('/yt/configuration/center/getConfigurationInfo/'+Editor.configurationId)
|
4996
|
|
- .then(function (response) {
|
4997
|
|
- Editor.configurationName = response.configurationName + ".drawio";
|
4998
|
|
- if(response.configurationContentList.length > 0){
|
4999
|
|
- response.configurationContentList.forEach((item)=>{
|
5000
|
|
- Editor.configurationContentId = item.id;
|
5001
|
|
- if(item.content){
|
5002
|
|
- Editor.defaultContent = item.content;
|
5003
|
|
- }else{
|
5004
|
|
- //默认空白内容
|
5005
|
|
- Editor.defaultContent = EditorUi.prototype.emptyDiagramXml;
|
5006
|
|
- }
|
5007
|
|
- })
|
5008
|
|
- }
|
5009
|
|
- if (id == null || id.length == 0) {
|
5010
|
|
- fn();
|
5011
|
|
- } else if (currentFile != null && !sameWindow) {
|
5012
|
|
- this.showDialog(new PopupDialog(this, this.getUrl() + '#' + id,
|
5013
|
|
- null, fn).container, 320, 140, true, true);
|
5014
|
|
- } else {
|
5015
|
|
- fn();
|
|
4993
|
+
|
|
4994
|
+ function getToken() {
|
|
4995
|
+ const urlParams = (function () {
|
|
4996
|
+ var result = new Object();
|
|
4997
|
+ var params = window.location.search.slice(1).split('&');
|
|
4998
|
+
|
|
4999
|
+ for (var i = 0; i < params.length; i++) {
|
|
5000
|
+ var idx = params[i].indexOf('=');
|
|
5001
|
+
|
|
5002
|
+ if (idx > 0) {
|
|
5003
|
+ result[params[i].substring(0, idx)] = params[i].substring(idx + 1);
|
|
5004
|
+ }
|
5016
|
5005
|
}
|
5017
|
|
- })
|
5018
|
|
- .catch(function (error) {
|
5019
|
|
- console.log(error);
|
5020
|
|
- });
|
|
5006
|
+
|
|
5007
|
+ return result;
|
|
5008
|
+ })();
|
|
5009
|
+
|
|
5010
|
+ if (urlParams.userId) {
|
|
5011
|
+ axios.get(`/api/yt/third/login/id/${urlParams.userId}`)
|
|
5012
|
+ .then(res => {
|
|
5013
|
+ const {token, refreshToken} = res.data || {}
|
|
5014
|
+ GLOBAL_TOKEN.token = token
|
|
5015
|
+ GLOBAL_TOKEN.refreshToken = refreshToken
|
|
5016
|
+ getSaveContent()
|
|
5017
|
+ })
|
|
5018
|
+ } else {
|
|
5019
|
+ getSaveContent()
|
|
5020
|
+ }
|
|
5021
|
+ }
|
|
5022
|
+
|
|
5023
|
+ getToken()
|
|
5024
|
+
|
|
5025
|
+ //调用API,获取保存的内容
|
|
5026
|
+ function getSaveContent() {
|
|
5027
|
+ defHttp.get('/yt/configuration/center/getConfigurationInfo/'+Editor.configurationId)
|
|
5028
|
+ .then(function (response) {
|
|
5029
|
+ Editor.configurationName = response.configurationName + ".drawio";
|
|
5030
|
+ if(response.configurationContentList.length > 0){
|
|
5031
|
+ response.configurationContentList.forEach((item)=>{
|
|
5032
|
+ Editor.configurationContentId = item.id;
|
|
5033
|
+ if(item.content){
|
|
5034
|
+ Editor.defaultContent = item.content;
|
|
5035
|
+ }else{
|
|
5036
|
+ //默认空白内容
|
|
5037
|
+ Editor.defaultContent = EditorUi.prototype.emptyDiagramXml;
|
|
5038
|
+ }
|
|
5039
|
+ })
|
|
5040
|
+ }
|
|
5041
|
+ if (id == null || id.length == 0) {
|
|
5042
|
+ fn();
|
|
5043
|
+ } else if (currentFile != null && !sameWindow) {
|
|
5044
|
+ this.showDialog(new PopupDialog(this, this.getUrl() + '#' + id,
|
|
5045
|
+ null, fn).container, 320, 140, true, true);
|
|
5046
|
+ } else {
|
|
5047
|
+ fn();
|
|
5048
|
+ }
|
|
5049
|
+ })
|
|
5050
|
+ .catch(function (error) {
|
|
5051
|
+ console.log(error);
|
|
5052
|
+ });
|
|
5053
|
+ }
|
|
5054
|
+
|
|
5055
|
+
|
5021
|
5056
|
this.hideDialog();
|
5022
|
5057
|
var fn2 = mxUtils.bind(this, function () {
|
5023
|
5058
|
//加载数据开始
|
...
|
...
|
|