|
@@ -99,9 +99,11 @@ public class SysProfileController extends BaseController {
|
|
|
@PutMapping
|
|
|
public AjaxResult updateProfile(@RequestBody SysUser user) {
|
|
|
//截取头像
|
|
|
- int index = user.getAvatar().lastIndexOf("group");
|
|
|
- if (index != -1) {
|
|
|
- user.setAvatar(user.getAvatar().substring(index));
|
|
|
+ if (StringUtils.isNotEmpty(user.getAvatar())) {
|
|
|
+ int index = user.getAvatar().lastIndexOf("group");
|
|
|
+ if (index != -1) {
|
|
|
+ user.setAvatar(user.getAvatar().substring(index));
|
|
|
+ }
|
|
|
}
|
|
|
LoginUser loginUser = SecurityUtils.getLoginUser();
|
|
|
SysUser sysUser = loginUser.getSysUser();
|