Commit 5fb0c7f6 authored by ganjingcun's avatar ganjingcun

fix user link

parent e3c927e5
...@@ -48,12 +48,12 @@ export default class Api { ...@@ -48,12 +48,12 @@ export default class Api {
static getDeckInfo(opt) { static getDeckInfo(opt) {
var tmp = "http://localhost:3000/api" var tmp = "http://localhost:3000/api"
return Vue.http.get(`${tmp}/deckinfo`, { 'params': opt }); return Vue.http.get(`${URL}/deckinfo`, { 'params': opt });
} }
static saveDeck(opt) { static saveDeck(opt) {
var tmp = "http://localhost:3000/api" var tmp = "http://localhost:3000/api"
const url = `${tmp}/deckinfo` const url = `${URL}/deckinfo`
return Vue.http.post(url, opt, { 'emulateJSON': true }); return Vue.http.post(url, opt, { 'emulateJSON': true });
} }
......
...@@ -228,6 +228,7 @@ ...@@ -228,6 +228,7 @@
mounted: function () { mounted: function () {
this.init2(); this.init2();
window.onhashchange = this.init;
}, },
computed: { computed: {
...@@ -314,14 +315,14 @@ ...@@ -314,14 +315,14 @@
var userscorea = row[4]; var userscorea = row[4];
var userscoreb = row[5]; var userscoreb = row[5];
if (userscorea < 0) { if (userscorea < 0) {
return "<a href='userinfo.html?username=" + data + "'><span class='label label-danger'>" + data + "</span></a>"; return "<a href='#/userinfo?username=" + data + "'><span class='label label-danger'>" + data + "</span></a>";
} }
if (userscorea > userscoreb) { if (userscorea > userscoreb) {
return "<a href='userinfo.html?username=" + data + "'><span class='label label-success'>" + data + "</span></a>"; return "<a href='#/userinfo?username=" + data + "'><span class='label label-success'>" + data + "</span></a>";
} }
return "<a href='userinfo.html?username=" + data + "'><span class='label label-info'>" + data + "</span></a>"; return "<a href='#/userinfo?username=" + data + "'><span class='label label-info'>" + data + "</span></a>";
}, },
"targets": 0 "targets": 0
}, },
...@@ -330,14 +331,14 @@ ...@@ -330,14 +331,14 @@
var userscorea = row[4]; var userscorea = row[4];
var userscoreb = row[5]; var userscoreb = row[5];
if (userscoreb < 0) { if (userscoreb < 0) {
return "<a href='userinfo.html?username=" + data + "'><span class='label label-danger'>" + data + "</span></a>"; return "<a href='#/userinfo?username=" + data + "'><span class='label label-danger'>" + data + "</span></a>";
} }
if (userscorea < userscoreb) { if (userscorea < userscoreb) {
return "<a href='userinfo.html?username=" + data + "'><span class='label label-success'>" + data + "</span></a>"; return "<a href='#/userinfo?username=" + data + "'><span class='label label-success'>" + data + "</span></a>";
} }
return "<a href='userinfo.html?username=" + data + "'><span class='label label-info'>" + data + "</span></a>"; return "<a href='#/userinfo?username=" + data + "'><span class='label label-info'>" + data + "</span></a>";
}, },
"targets": 1 "targets": 1
}, },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment