|
@@ -1919,10 +1919,10 @@ us.getWord = function (response, docid, pageid, userid) {
|
|
|
us.mysql.usselect(['172.16.12.5', 'pbl', 'select_file', docid],
|
|
|
function (ret) {
|
|
|
if (ret) {
|
|
|
- ret[0][0].data = us.word[docid].content; //把思维网格的内容转化成数组
|
|
|
+ ret[0][0].data = us.word[docid].content('body').html();
|
|
|
response.end(JSON.stringify(ret)); //返回文档内容
|
|
|
- }
|
|
|
- else {
|
|
|
+ } else {
|
|
|
+ us.word[docid].content = us.cheerio.load(''); //将文档添加到内层中
|
|
|
response.end(''); //返回文档内容
|
|
|
}
|
|
|
});
|
|
@@ -1940,11 +1940,11 @@ us.getWord = function (response, docid, pageid, userid) {
|
|
|
us.mysql.usselect(['172.16.12.5', 'pbl', 'select_file', docid],
|
|
|
function (ret) {
|
|
|
if (ret) {
|
|
|
- us.word[docid].content = ret[0][0].data; //把思维网格的内容转化成数组
|
|
|
- response.end(JSON.stringify(ret)); //返回文档内容
|
|
|
- }
|
|
|
- else {
|
|
|
- us.word[docid].content = []; //创建一个空数组
|
|
|
+ var _office = ret[0][0].data ? ret[0][0].data.replace(/\\'/ig, '\'').replace(/\\"/ig, "\"") : ""; //记录查找内容
|
|
|
+ us.word[docid].content = us.cheerio.load(_office); //将文档添加到内层中
|
|
|
+ response.end(_office); //返回文档内容
|
|
|
+ } else {
|
|
|
+ us.word[docid].content = us.cheerio.load(''); //将文档添加到内层中
|
|
|
response.end(''); //返回文档内容
|
|
|
}
|
|
|
});
|