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

修复token改名涉及到的bug

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