You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@submarine.apache.org by li...@apache.org on 2020/10/31 07:05:08 UTC

[submarine] branch master updated: SUBMARINE-657. The problem of creating a new user

This is an automated email from the ASF dual-hosted git repository.

liuxun pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/submarine.git


The following commit(s) were added to refs/heads/master by this push:
     new 2f48998  SUBMARINE-657. The problem of creating a new user
2f48998 is described below

commit 2f48998c45ec087dcf06ca2e59cd8b077d7f24a5
Author: Charles <ch...@gmail.com>
AuthorDate: Fri Oct 23 13:00:09 2020 +0800

    SUBMARINE-657. The problem of creating a new user
    
    ### What is this PR for?
    1. Correct the bug while creating an user without entering birthday.
    Now if users don't enter the birthday, the default birthday will be null.
    
    2. Add md5 encryption for the password while creating new user.
    
    ### What type of PR is it?
    [Bug Fix]
    
    ### Todos
    * [ ] - Task
    
    ### What is the Jira issue?
    [SUBMARINE-657](https://issues.apache.org/jira/projects/SUBMARINE/issues/SUBMARINE-657?filter=allopenissues)
    
    ### How should this be tested?
    [Travis-CI](https://travis-ci.com/github/charlie0220/submarine)
    
    ### Screenshots (if appropriate)
    
    ### Questions:
    * Does the licenses files need update? No
    * Is there breaking changes for older versions? No
    * Does this needs documentation? No
    
    Author: Charles <ch...@gmail.com>
    
    Closes #440 from charlie0220/SUBMARINE-657 and squashes the following commits:
    
    c8d2335 [Charles] SUBMARINE-657. Update user-drawer.component.ts
    7d1066b [Charles] SUBMARINE-657. The problem of creating a new user
---
 .../app/pages/workbench/manager/user-drawer/user-drawer.component.ts  | 4 +---
 submarine-workbench/workbench-web/src/app/services/user.service.ts    | 1 +
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/submarine-workbench/workbench-web/src/app/pages/workbench/manager/user-drawer/user-drawer.component.ts b/submarine-workbench/workbench-web/src/app/pages/workbench/manager/user-drawer/user-drawer.component.ts
index 33f5c4c..a4fc3f2 100644
--- a/submarine-workbench/workbench-web/src/app/pages/workbench/manager/user-drawer/user-drawer.component.ts
+++ b/submarine-workbench/workbench-web/src/app/pages/workbench/manager/user-drawer/user-drawer.component.ts
@@ -151,9 +151,7 @@ export class UserDrawerComponent implements OnInit, OnChanges {
           delete formData['sex@dict'];
           delete formData['status@dict'];
 
-          if (formData.birthday) {
-            formData.birthday = format(formData.birthday, 'yyyy-MM-dd HH:mm:ss');
-          }
+          formData.birthday = formData.birthday ? format(formData.birthday, 'yyyy-MM-dd HH:mm:ss'): null;
 
           this.submit.emit(formData);
         }
diff --git a/submarine-workbench/workbench-web/src/app/services/user.service.ts b/submarine-workbench/workbench-web/src/app/services/user.service.ts
index 97d24c1..feabd36 100644
--- a/submarine-workbench/workbench-web/src/app/services/user.service.ts
+++ b/submarine-workbench/workbench-web/src/app/services/user.service.ts
@@ -96,6 +96,7 @@ export class UserService {
 
   createUser(sysUser: Partial<SysUser>): Observable<SysUser> {
     const apiUrl = this.baseApi.getRestApi('/sys/user/add');
+    sysUser['password'] = md5(sysUser.password);
 
     return this.httpClient.post<Rest<SysUser>>(apiUrl, sysUser).pipe(
       switchMap((res) => {


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@submarine.apache.org
For additional commands, e-mail: dev-help@submarine.apache.org