Skip to content

Commit

Permalink
fix(pc): 用户个人资料失败提示图标修正
Browse files Browse the repository at this point in the history
issue zhiyicx/plus-component-pc#1006

(cherry picked from commit 5ebd957)

# Conflicts:
#	packages/zhiyicx-plus-pc/resources/assets/web/js/module.account.js
  • Loading branch information
mutoe committed Nov 9, 2018
1 parent b2d8db4 commit edbd9a6
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions packages/zhiyicx-plus-pc/resources/assets/web/js/module.account.js
Expand Up @@ -18,6 +18,14 @@ $('#J-user-info').on('click', function(e) {
noticebox('用户名长度为2-8位', 0);
return;
}
if (args.data.name[0].match(/[0-9]/)) {
noticebox('用户名不能以数字开头', 0);
return;
}
if (args.data.name.match(/[^0-9a-z\u4e00-\u9fa5-]/ig)) {
noticebox('用户名只能包含数字、字母和下划线', 0);
return;
}
if (!args.data.bio) {
noticebox('个人简介不能为空', 0);
return;
Expand All @@ -31,6 +39,8 @@ $('#J-user-info').on('click', function(e) {
noticebox('资料修改成功', 1, 'refresh');
})
.catch(function (error) {
noticebox('资料修改失败', 0, 'refresh');
console.log(error.response.data);
if (error.response.data.name) noticebox(error.response.data.name, 0);
else noticebox('资料修改失败', 0);
});
});
});

0 comments on commit edbd9a6

Please sign in to comment.