Commit a4150eb4 authored by ganjingcun's avatar ganjingcun

avatar

parent a4e37118
...@@ -45,7 +45,7 @@ export default class Api { ...@@ -45,7 +45,7 @@ export default class Api {
} }
static getAvatar(opt) { static getAvatar(opt) {
return `https://ygobbs.com/user_avatar/ygobbs.com/${opt.username}/400/1.png` return Vue.http.get(`https://api.moecube.com/accounts/users/${opt.username}.avatar`)
} }
static getCardInfo(opt) { static getCardInfo(opt) {
......
...@@ -356,7 +356,12 @@ ...@@ -356,7 +356,12 @@
} }
if (!username) return if (!username) return
this.avatar_url = API.getAvatar({ username: username }); var _this = this;
API.getAvatar({ username: username }).then((res) => {
_this.avatar_url = res.data
}, (res) => {
_this.avatar_url = "https://cdn01.moecube.com/accounts/default_avatar.jpg"
});
API.getUserInfo({ username: username }).then((res) => { API.getUserInfo({ username: username }).then((res) => {
this.hasError = false this.hasError = false
......
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