OSDN Git Service

enable password in creating key
authorYongfeng LI <wliyongfeng@gmail.com>
Tue, 23 Jan 2018 07:47:57 +0000 (15:47 +0800)
committerYongfeng LI <wliyongfeng@gmail.com>
Tue, 23 Jan 2018 07:47:57 +0000 (15:47 +0800)
src/features/mockhsm/components/New.jsx
src/sdk/api/mockHsmKeys.js

index 9cfde21..4f3fe5e 100644 (file)
@@ -61,7 +61,6 @@ class New extends React.Component {
 
         <FormSection title='Key Information'>
           <TextField title='Alias' placeholder='Alias' fieldProps={alias} autoFocus={true} />
-          {/*<TextField title='Password' placeholder='Password' fieldProps={password} autoFocus={false} type={'password'} />*/}
           <div>
             <input type='checkbox' id='private_key_file_input'
                    checked={this.state.import}
@@ -80,6 +79,7 @@ class New extends React.Component {
             <input type='file' style={{'display': 'flex', 'alignItems': 'center', 'fontSize': '12px'}}
                    onChange={this.handleFileChange.bind(this)}/>
           }
+          <TextField title='Password' placeholder='Password' fieldProps={password} autoFocus={false} type={'password'} />
         </FormSection>
       </FormContainer>
     )
index 5054b8d..0d16bf5 100644 (file)
@@ -1,10 +1,9 @@
-const uuid = require('uuid')
 const shared = require('../shared')
 
 const mockHsmKeysAPI = (client) => {
   return {
     create: (params, cb) => {
-      let body = Object.assign({ clientToken: uuid.v4() }, params, {password: '123456'})
+      let body = Object.assign({}, params)
       const uri = body.xprv ? '/import-private-key' : '/create-key'
 
       return shared.tryCallback(