mirror of
https://github.com/YMFE/yapi.git
synced 2024-12-21 05:19:42 +08:00
commit
0bdb066385
@ -138,8 +138,8 @@ class Profile extends Component {
|
|||||||
userNameEditHtml = <div>
|
userNameEditHtml = <div>
|
||||||
<Input value={_userinfo.username} name="username" onChange={this.changeUserinfo} placeholder="用户名" />
|
<Input value={_userinfo.username} name="username" onChange={this.changeUserinfo} placeholder="用户名" />
|
||||||
<ButtonGroup className="edit-buttons" >
|
<ButtonGroup className="edit-buttons" >
|
||||||
<Button className="edit-button" onClick={() => { this.handleEdit('usernameEdit', false) }} >Cancel</Button>
|
<Button size={'small'} className="edit-button" onClick={() => { this.handleEdit('usernameEdit', false) }} >Cancel</Button>
|
||||||
<Button className="edit-button" onClick={ () => { this.updateUserinfo('username')} } type="primary">OK</Button>
|
<Button size={'small'} className="edit-button" onClick={ () => { this.updateUserinfo('username')} } type="primary">OK</Button>
|
||||||
</ButtonGroup>
|
</ButtonGroup>
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
@ -154,8 +154,8 @@ class Profile extends Component {
|
|||||||
emailEditHtml = <div>
|
emailEditHtml = <div>
|
||||||
<Input placeholder="Email" value={_userinfo.email} name="email" onChange={this.changeUserinfo} />
|
<Input placeholder="Email" value={_userinfo.email} name="email" onChange={this.changeUserinfo} />
|
||||||
<ButtonGroup className="edit-buttons" >
|
<ButtonGroup className="edit-buttons" >
|
||||||
<Button className="edit-button" onClick={() => { this.handleEdit('emailEdit', false) }} >Cancel</Button>
|
<Button size={'small'} className="edit-button" onClick={() => { this.handleEdit('emailEdit', false) }} >Cancel</Button>
|
||||||
<Button className="edit-button" type="primary" onClick={ () => { this.updateUserinfo('email')} }>OK</Button>
|
<Button size={'small'} className="edit-button" type="primary" onClick={ () => { this.updateUserinfo('email')} }>OK</Button>
|
||||||
</ButtonGroup>
|
</ButtonGroup>
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
@ -175,15 +175,15 @@ class Profile extends Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (this.state.secureEdit === false) {
|
if (this.state.secureEdit === false) {
|
||||||
secureEditHtml = <Button type="primary" onClick={() => { this.handleEdit('secureEdit', true) }}>密码修改</Button>
|
secureEditHtml = <Button size={'small'} icon="edit" onClick={() => { this.handleEdit('secureEdit', true) }}>修改</Button>
|
||||||
} else {
|
} else {
|
||||||
secureEditHtml = <div>
|
secureEditHtml = <div>
|
||||||
<Input style={{display: this.state.userinfo.role === 'admin' ? 'none': ''}} placeholder="旧的密码" type="password" name="old_password" id="old_password" />
|
<Input style={{display: this.state.userinfo.role === 'admin' ? 'none': ''}} placeholder="旧的密码" type="password" name="old_password" id="old_password" />
|
||||||
<Input placeholder="新的密码" type="password" name="password" id="password" />
|
<Input placeholder="新的密码" type="password" name="password" id="password" />
|
||||||
<Input placeholder="确认密码" type="password" name="verify_pass" id="verify_pass" />
|
<Input placeholder="确认密码" type="password" name="verify_pass" id="verify_pass" />
|
||||||
<ButtonGroup className="edit-buttons" >
|
<ButtonGroup className="edit-buttons" >
|
||||||
<Button className="edit-button" onClick={() => { this.handleEdit('secureEdit', false) }}>Cancel</Button>
|
<Button size={'small'} className="edit-button" onClick={() => { this.handleEdit('secureEdit', false) }}>Cancel</Button>
|
||||||
<Button className="edit-button" onClick={this.updatePassword} type="primary">OK</Button>
|
<Button size={'small'} className="edit-button" onClick={this.updatePassword} type="primary">OK</Button>
|
||||||
</ButtonGroup>
|
</ButtonGroup>
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
@ -228,7 +228,7 @@ class Profile extends Component {
|
|||||||
</Row>
|
</Row>
|
||||||
|
|
||||||
<Row className="user-item" type="flex" justify="start">
|
<Row className="user-item" type="flex" justify="start">
|
||||||
<Col span={4}>安全</Col>
|
<Col span={4}>密码</Col>
|
||||||
<Col span={12}>
|
<Col span={12}>
|
||||||
{secureEditHtml}
|
{secureEditHtml}
|
||||||
</Col>
|
</Col>
|
||||||
|
@ -21,15 +21,22 @@
|
|||||||
border-radius:5px;
|
border-radius:5px;
|
||||||
margin-top: 15px;
|
margin-top: 15px;
|
||||||
.search{
|
.search{
|
||||||
margin: 5px;
|
padding: 5px;
|
||||||
|
background-color: #eee;
|
||||||
}
|
}
|
||||||
ul{border:none}
|
ul{border:none}
|
||||||
|
.ant-menu-item{
|
||||||
|
font-size: 14px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
.user-name{
|
.user-name{
|
||||||
padding: 10px 0px;
|
padding: 24px 0px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
background-color: #34495e;
|
background-color: #34495e;
|
||||||
color: white;
|
color: white;
|
||||||
|
font-size: 16px;
|
||||||
|
border-top-left-radius:5px;
|
||||||
|
border-top-right-radius: 5px;
|
||||||
span{
|
span{
|
||||||
margin-right: 10px;
|
margin-right: 10px;
|
||||||
}
|
}
|
||||||
@ -59,17 +66,27 @@
|
|||||||
-webkit-box-flex: 1;
|
-webkit-box-flex: 1;
|
||||||
margin-top: 15px;
|
margin-top: 15px;
|
||||||
margin-left: 15px;
|
margin-left: 15px;
|
||||||
padding: 10px 30px;
|
padding: 24px;
|
||||||
box-shadow: 0 2px 4px 0 rgba(0,0,0,0.20);
|
box-shadow: 0 2px 4px 0 rgba(0,0,0,0.20);
|
||||||
background: #FFF;
|
background: #FFF;
|
||||||
border-radius:5px;
|
border-radius:5px;
|
||||||
|
.ant-btn-group{
|
||||||
|
margin-top: 12px;
|
||||||
|
}
|
||||||
.user-item {
|
.user-item {
|
||||||
min-height:35px;
|
min-height:35px;
|
||||||
line-height:35px;
|
line-height:35px;
|
||||||
margin: 5px;
|
margin: 5px;
|
||||||
|
margin-left: 0px;
|
||||||
margin-bottom:10px;
|
margin-bottom:10px;
|
||||||
border-bottom: 1px solid #f1f3f6;
|
border-bottom: 1px solid #f1f3f6;
|
||||||
padding-bottom: 10px;
|
padding-bottom: 10px;
|
||||||
|
#old_password,#password,#verify_pass{
|
||||||
|
margin-top: 20px;
|
||||||
|
}
|
||||||
|
#old_password{
|
||||||
|
margin-top: 0px;
|
||||||
|
}
|
||||||
.ant-col-4{
|
.ant-col-4{
|
||||||
color: black;
|
color: black;
|
||||||
padding: 0px 10px;
|
padding: 0px 10px;
|
||||||
@ -87,13 +104,13 @@
|
|||||||
cursor: pointer
|
cursor: pointer
|
||||||
}
|
}
|
||||||
|
|
||||||
.edit-buttons{
|
// .edit-buttons{
|
||||||
margin:10px;
|
// margin:10px;
|
||||||
}
|
// }
|
||||||
|
|
||||||
.edit-button{
|
// .edit-button{
|
||||||
margin: 5px;
|
// margin: 5px;
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,11 +1,9 @@
|
|||||||
import path from 'path'
|
|
||||||
/**
|
/**
|
||||||
* config.js是用来第一次安装初始化网站配置,如果不用默认的runtime_path,可以直接修改runtime_path路径
|
* config.js是用来第一次安装初始化网站配置,如果不用默认的runtime_path,可以直接修改runtime_path路径
|
||||||
*/
|
*/
|
||||||
let runtime_path = path.join(path.resolve(__dirname, '../'), 'runtime')
|
|
||||||
let config = {
|
let config = {
|
||||||
"port": 80,
|
"port": 80,
|
||||||
"runtime_path": runtime_path,
|
"runtime_path": '',
|
||||||
"webhost": "yapi.local.qunar.com",
|
"webhost": "yapi.local.qunar.com",
|
||||||
"adminAccount": "admin@admin.com",
|
"adminAccount": "admin@admin.com",
|
||||||
"db": {
|
"db": {
|
||||||
|
@ -6,6 +6,10 @@ import config from '../runtime/config.json';
|
|||||||
let insts = new Map();
|
let insts = new Map();
|
||||||
let mail;
|
let mail;
|
||||||
|
|
||||||
|
if(!config.runtime_path){
|
||||||
|
config.runtime_path = path.join(path.resolve(__dirname, '../'), 'runtime')
|
||||||
|
}
|
||||||
|
|
||||||
const WEBROOT = path.resolve(__dirname, '..'); //路径
|
const WEBROOT = path.resolve(__dirname, '..'); //路径
|
||||||
const WEBROOT_SERVER = __dirname;
|
const WEBROOT_SERVER = __dirname;
|
||||||
const WEBROOT_RUNTIME = config.runtime_path;
|
const WEBROOT_RUNTIME = config.runtime_path;
|
||||||
|
@ -1,18 +1,11 @@
|
|||||||
'use strict';
|
"use strict";
|
||||||
|
|
||||||
var _path = require('path');
|
|
||||||
|
|
||||||
var _path2 = _interopRequireDefault(_path);
|
|
||||||
|
|
||||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* config.js是用来第一次安装初始化网站配置,如果不用默认的runtime_path,可以直接修改runtime_path路径
|
* config.js是用来第一次安装初始化网站配置,如果不用默认的runtime_path,可以直接修改runtime_path路径
|
||||||
*/
|
*/
|
||||||
var runtime_path = _path2.default.join(_path2.default.resolve(__dirname, '../'), 'runtime');
|
|
||||||
var config = {
|
var config = {
|
||||||
"port": 80,
|
"port": 80,
|
||||||
"runtime_path": runtime_path,
|
"runtime_path": '',
|
||||||
"webhost": "yapi.local.qunar.com",
|
"webhost": "yapi.local.qunar.com",
|
||||||
"adminAccount": "admin@admin.com",
|
"adminAccount": "admin@admin.com",
|
||||||
"db": {
|
"db": {
|
||||||
|
@ -25,6 +25,10 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|||||||
var insts = new _map2.default();
|
var insts = new _map2.default();
|
||||||
var mail = void 0;
|
var mail = void 0;
|
||||||
|
|
||||||
|
if (!_config2.default.runtime_path) {
|
||||||
|
_config2.default.runtime_path = _path2.default.join(_path2.default.resolve(__dirname, '../'), 'runtime');
|
||||||
|
}
|
||||||
|
|
||||||
var WEBROOT = _path2.default.resolve(__dirname, '..'); //路径
|
var WEBROOT = _path2.default.resolve(__dirname, '..'); //路径
|
||||||
var WEBROOT_SERVER = __dirname;
|
var WEBROOT_SERVER = __dirname;
|
||||||
var WEBROOT_RUNTIME = _config2.default.runtime_path;
|
var WEBROOT_RUNTIME = _config2.default.runtime_path;
|
||||||
|
Loading…
Reference in New Issue
Block a user