|
@@ -63,7 +63,7 @@ const app=createApp({
|
|
{value: 'en', label: 'English',},
|
|
{value: 'en', label: 'English',},
|
|
{value: 'ja', label: 'にほんご',},
|
|
{value: 'ja', label: 'にほんご',},
|
|
],
|
|
],
|
|
- tomcat_res:"",
|
|
|
|
|
|
+ tomcat_res:"tomcat",
|
|
books:[
|
|
books:[
|
|
{title:"Linux从入门到精通",author:"night-cherry",publisher:"peking press",pages:123},
|
|
{title:"Linux从入门到精通",author:"night-cherry",publisher:"peking press",pages:123},
|
|
{title:"MySQL必知必会",author:"李晓兵",publisher:"peking press",pages:456},
|
|
{title:"MySQL必知必会",author:"李晓兵",publisher:"peking press",pages:456},
|
|
@@ -88,13 +88,14 @@ const app=createApp({
|
|
console.log("this.tomcat_res : "+this.tomcat_res);
|
|
console.log("this.tomcat_res : "+this.tomcat_res);
|
|
console.log("------this.books : "+this.books);
|
|
console.log("------this.books : "+this.books);
|
|
const _books=this.books;
|
|
const _books=this.books;
|
|
|
|
+ const _tomcat_res=this.tomcat_res;
|
|
// console.log("------this : "+this);
|
|
// console.log("------this : "+this);
|
|
const request = new XMLHttpRequest();
|
|
const request = new XMLHttpRequest();
|
|
request.onload=function(){
|
|
request.onload=function(){
|
|
console.log("--------parse tomcat server string--------");
|
|
console.log("--------parse tomcat server string--------");
|
|
const res=JSON.parse(request.responseText);
|
|
const res=JSON.parse(request.responseText);
|
|
|
|
|
|
- this.tomcat_res=res[0].title;
|
|
|
|
|
|
+ _tomcat_res=res[1].title;
|
|
console.log("res:"+res);
|
|
console.log("res:"+res);
|
|
console.log("res[0].title :"+res[0].title);
|
|
console.log("res[0].title :"+res[0].title);
|
|
console.log("res[0].author :"+res[0].author);
|
|
console.log("res[0].author :"+res[0].author);
|
|
@@ -106,16 +107,16 @@ const app=createApp({
|
|
console.log("res[1].publisher :"+res[1].publisher);
|
|
console.log("res[1].publisher :"+res[1].publisher);
|
|
console.log("res[1].pages :"+res[1].pages);
|
|
console.log("res[1].pages :"+res[1].pages);
|
|
console.log("this.tomcat_res : "+this.tomcat_res);
|
|
console.log("this.tomcat_res : "+this.tomcat_res);
|
|
- alert("this.tomcat_res : "+this.tomcat_res);
|
|
|
|
|
|
+ alert("this.tomcat_res : "+_tomcat_res);
|
|
|
|
|
|
console.log("------ _books : "+_books);
|
|
console.log("------ _books : "+_books);
|
|
// console.log("------this.books : "+this.books);
|
|
// console.log("------this.books : "+this.books);
|
|
try{
|
|
try{
|
|
- _books.push(res[0]);
|
|
|
|
|
|
+ _books.concat(res);
|
|
}catch(e){
|
|
}catch(e){
|
|
console.log("the way == _books.push(res[0]) is wrong!!!");
|
|
console.log("the way == _books.push(res[0]) is wrong!!!");
|
|
try{
|
|
try{
|
|
- _books.concat(res);
|
|
|
|
|
|
+ _books.push(res[0]);
|
|
|
|
|
|
}catch(e){
|
|
}catch(e){
|
|
console.log("the way == _books.push(res[0]) is wrong!!!");
|
|
console.log("the way == _books.push(res[0]) is wrong!!!");
|
|
@@ -127,7 +128,7 @@ const app=createApp({
|
|
|
|
|
|
// console.log("------books : "+books);
|
|
// console.log("------books : "+books);
|
|
// console.log("------this : "+this);
|
|
// console.log("------this : "+this);
|
|
- console.log("this.tomcat_res : "+this.tomcat_res);
|
|
|
|
|
|
+ console.log("this.tomcat_res : "+_tomcat_res);
|
|
};
|
|
};
|
|
request.open("POST","http://ancientapes.cc:8080/mineluxuries/book");
|
|
request.open("POST","http://ancientapes.cc:8080/mineluxuries/book");
|
|
request.send("test tomcat");
|
|
request.send("test tomcat");
|