From 2993a6d7945a0ce649afd994e7eda48b2df1cc7e Mon Sep 17 00:00:00 2001 From: virusdefender <1670873886@qq.com> Date: Wed, 11 Nov 2015 21:05:06 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E6=A0=BC=E5=BC=8F=E5=8C=96=E4=BB=A3?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- static/src/js/app/oj/account/avatar.js | 39 +++++++++++++------------- 1 file changed, 20 insertions(+), 19 deletions(-) diff --git a/static/src/js/app/oj/account/avatar.js b/static/src/js/app/oj/account/avatar.js index 04368b52..4780e266 100644 --- a/static/src/js/app/oj/account/avatar.js +++ b/static/src/js/app/oj/account/avatar.js @@ -1,5 +1,6 @@ require(["jquery", "bsAlert", "csrfToken"], function ($, bsAlert, csrfTokenHeader) { - var avatar=""; + var avatar = ""; + function changeAvatar(event) { avatar = $(event.target).attr('src'); $('#current_avatar').attr('src', avatar); @@ -7,27 +8,27 @@ require(["jquery", "bsAlert", "csrfToken"], function ($, bsAlert, csrfTokenHeade $('.avatar-item').click(changeAvatar); - $('#save_avatar').click(function(){ + $('#save_avatar').click(function () { if (avatar) $.ajax({ - beforeSend: csrfTokenHeader, - url: "/api/account/userprofile/", - data: { - avatar: avatar - }, - dataType: "json", - method: "put", - success: function (data) { - if (!data.code) { - bsAlert("已保存!"); - } - else{ - bsAlert(data.data); - } - }, - error: function () { - bsAlert("额 好像出错了,请刷新页面重试。如还有问题,请填写页面导航栏上的反馈。") + beforeSend: csrfTokenHeader, + url: "/api/account/userprofile/", + data: { + avatar: avatar + }, + dataType: "json", + method: "put", + success: function (data) { + if (!data.code) { + bsAlert("已保存!"); } + else { + bsAlert(data.data); + } + }, + error: function () { + bsAlert("额 好像出错了,请刷新页面重试。如还有问题,请填写页面导航栏上的反馈。") + } }); else From 5598387159a7c30c3d811d6364a6c50069fa2261 Mon Sep 17 00:00:00 2001 From: virusdefender <1670873886@qq.com> Date: Wed, 11 Nov 2015 21:05:18 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E4=BF=AE=E8=A1=A5=E9=83=A8=E5=88=86?= =?UTF-8?q?=E5=AD=97=E6=AE=B5=E6=98=BE=E7=A4=BA=20None=20=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- template/src/oj/account/settings.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/template/src/oj/account/settings.html b/template/src/oj/account/settings.html index 3dc75c6d..ebfee385 100644 --- a/template/src/oj/account/settings.html +++ b/template/src/oj/account/settings.html @@ -36,7 +36,7 @@