提交 5879fee0 编写于 作者: NoSubject's avatar NoSubject

修复token改名涉及到的bug

上级 100fb8f6
...@@ -1555,7 +1555,8 @@ if (window.Promise && !Promise.any){ ...@@ -1555,7 +1555,8 @@ if (window.Promise && !Promise.any){
address: o2.filterUrl(address), address: o2.filterUrl(address),
body: data, body: data,
debug: (window.layout && layout["debugger"]), debug: (window.layout && layout["debugger"]),
token: (window.layout && layout.session && layout.session.user) ? layout.session.user.token : "" token: (window.layout && layout.session && layout.session.user) ? layout.session.user.token : "",
tokenName: o2.tokenName
} }
var actionWorker = new Worker("../o2_core/o2/actionWorker.js"); var actionWorker = new Worker("../o2_core/o2/actionWorker.js");
var p = new Promise(function(s,f){ var p = new Promise(function(s,f){
......
...@@ -34,6 +34,7 @@ function V(httpRequest) { ...@@ -34,6 +34,7 @@ function V(httpRequest) {
var body = data.body; var body = data.body;
var debug = data.debug; var debug = data.debug;
var token = data.token; var token = data.token;
var tokenName = data.tokenName;
if (noCache) url = url+(((url.indexOf("?")!==-1) ? "&" : "?")+(new Date()).getTime()); if (noCache) url = url+(((url.indexOf("?")!==-1) ? "&" : "?")+(new Date()).getTime());
...@@ -44,8 +45,8 @@ function V(httpRequest) { ...@@ -44,8 +45,8 @@ function V(httpRequest) {
this.request.setRequestHeader("Accept", "text/html,application/json,*/*"); this.request.setRequestHeader("Accept", "text/html,application/json,*/*");
if (debug) this.request.setRequestHeader("x-debugger", "true"); if (debug) this.request.setRequestHeader("x-debugger", "true");
if (token){ if (token){
this.request.setRequestHeader(o2.tokenName, token); this.request.setRequestHeader(tokenName, token);
this.request.setRequestHeader("authorization", token); this.request.setRequestHeader("Authorization", token);
} }
this.request.send(body); this.request.send(body);
......
...@@ -21,6 +21,7 @@ o2.widget.JavascriptEditor = new Class({ ...@@ -21,6 +21,7 @@ o2.widget.JavascriptEditor = new Class({
this.unbindEvents = []; this.unbindEvents = [];
this.node = $(node); this.node = $(node);
this.id = o2.uuid(); this.id = o2.uuid();
if (!o2.JSEditorCWE.isInit) o2.JSEditorCWE.init();
}, },
getDefaultEditorData: function(){ getDefaultEditorData: function(){
switch (this.options.type) { switch (this.options.type) {
...@@ -850,6 +851,7 @@ o2.widget.JavascriptEditor.completionWorkerEnvironment = o2.JSEditorCWE = { ...@@ -850,6 +851,7 @@ o2.widget.JavascriptEditor.completionWorkerEnvironment = o2.JSEditorCWE = {
this.scriptWorker.onmessage = function(e) { this.scriptWorker.onmessage = function(e) {
if (e.data && e.data.type=="ready") this.setOnMessage(); if (e.data && e.data.type=="ready") this.setOnMessage();
}.bind(this); }.bind(this);
this.isInit = true;
return this; return this;
}, },
setOnMessage: function(){ setOnMessage: function(){
...@@ -872,4 +874,4 @@ o2.widget.JavascriptEditor.completionWorkerEnvironment = o2.JSEditorCWE = { ...@@ -872,4 +874,4 @@ o2.widget.JavascriptEditor.completionWorkerEnvironment = o2.JSEditorCWE = {
this.scriptWorker.postMessage(o); this.scriptWorker.postMessage(o);
} }
} }
}.init(); };
...@@ -157,6 +157,7 @@ o2.addReady(function () { ...@@ -157,6 +157,7 @@ o2.addReady(function () {
o2.getJSON("../x_desktop/res/config/config.json", function (config) { o2.getJSON("../x_desktop/res/config/config.json", function (config) {
layout.config = config; layout.config = config;
o2.tokenName = config.tokenName || "x-token";
configLoaded = true; configLoaded = true;
if (configLoaded && commonLoaded && lpLoaded) _getDistribute(function () { _load(); }); if (configLoaded && commonLoaded && lpLoaded) _getDistribute(function () { _load(); });
}); });
......
...@@ -36,8 +36,8 @@ ...@@ -36,8 +36,8 @@
<tr> <tr>
<td class="editTableTitle">{{$.lp.opinionRequired}}:</td> <td class="editTableTitle">{{$.lp.opinionRequired}}:</td>
<td class="editTableValue" id="text{$.id}opinionRequired" > <td class="editTableValue" id="text{$.id}opinionRequired" >
<input class="editTableRadio" name="opinionRequired" text{($.opinionRequired)?'checked':''} type="radio" value="true"/> <input class="editTableRadio" name="opinionRequired" text{($.opinionRequired)?'checked':''} type="radio" value="true"/>{{$.lp.yes}}
<input class="editTableRadio" name="opinionRequired" text{(!$.opinionRequired)?'checked':''} type="radio" value="false"/> <input class="editTableRadio" name="opinionRequired" text{(!$.opinionRequired)?'checked':''} type="radio" value="false"/>{{$.lp.no}}
</td> </td>
</tr> </tr>
</table> </table>
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
<link rel="stylesheet" type="text/css" href="css/style.css" charset="UTF-8" /> <link rel="stylesheet" type="text/css" href="css/style.css" charset="UTF-8" />
<link rel="stylesheet" href="css/mBoxNotice.css" charset="UTF-8" /> <link rel="stylesheet" href="css/mBoxNotice.css" charset="UTF-8" />
<link rel="stylesheet" href="css/mBoxTooltip.css" charset="UTF-8" /> <link rel="stylesheet" href="css/mBoxTooltip.css" charset="UTF-8" />
<title>O2</title> <title>O2OA</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
</head> </head>
<body> <body>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册