fix: 版本通知修复

This commit is contained in:
gandchuan 2018-07-11 15:01:07 +08:00
parent 32652288c8
commit f871fcd965
4 changed files with 30 additions and 41 deletions

View File

@ -1,60 +1,50 @@
<h1 class="curproject-name"> 跨项目测试集合 </h1>
<h1 class="curproject-name"> mumu </h1>
# my-test
[TOC]
# %u516C%u5171%u5206%u7C7B
[TOC]
## test_2%0A%3Ca%20id%3Dtest_2%3E%20%3C/a%3E
## 123213%0A%3Ca%20id%3D123213%3E%20%3C/a%3E
[TOC]
### 基本信息
**Path** /api/test/2
**Path** /logIn
**Method** POST
**Method** GET
**接口描述:**
undefined
### 请求参数
**Headers**
| 参数名称 | 参数值 | 是否必须 | 示例 | 备注 |
| ------------ | ------------ | ------------ | ------------ | ------------ |
| Content-Type | application/json | 是 | | |
**Body**
```javascript
{
"aa": 12
}
```
### 返回数据
<table>
<thead class="ant-table-thead">
<tr>
<th key=name>名称</th><th key=type>类型</th><th key=required>是否必须</th><th key=default>默认值</th><th key=desc>备注</th><th key=sub>其他信息</th>
</tr>
</thead><tbody className="ant-table-tbody"><tr key=0-0><td key=0><span style="padding-left: 0px"><span style="color: #8c8a8a"></span> a</span></td><td key=1><span>object []</span></td><td key=2>必须</td><td key=3></td><td key=4><span></span></td><td key=5><p key=3><span style="font-weight: '700'">item 类型: </span><span>object</span></p></td></tr><tr key=0-0-0><td key=0><span style="padding-left: 20px"><span style="color: #8c8a8a">├─</span> item1</span></td><td key=1><span>string</span></td><td key=2>非必须</td><td key=3></td><td key=4><span></span></td><td key=5></td></tr><tr key=0-0-1><td key=0><span style="padding-left: 20px"><span style="color: #8c8a8a">├─</span> item2</span></td><td key=1><span>string</span></td><td key=2>非必须</td><td key=3></td><td key=4><span></span></td><td key=5></td></tr><tr key=0-1><td key=0><span style="padding-left: 0px"><span style="color: #8c8a8a"></span> b</span></td><td key=1><span>string</span></td><td key=2>必须</td><td key=3></td><td key=4><span></span></td><td key=5></td></tr>
</tbody>
</table>
# %u4EA4%u6613%u4E2D%u53F0
## test%0A%3Ca%20id%3Dtest%3E%20%3C/a%3E
[TOC]
### 基本信息
# %u60F9%u6211
**Path** /api/col/list
**Method** GET
**接口描述:**
undefined
### 请求参数
## a%0A%3Ca%20id%3Da%3E%20%3C/a%3E
[TOC]
### 基本信息
# %u6258%u5C14%u65AF%u6CF0
[TOC]
**Path** /logOut
**Method** GET
**接口描述:**
undefined
### 请求参数

View File

@ -110,7 +110,7 @@ export default class App extends Component {
<Router getUserConfirmation={this.showConfirm}>
<div className="g-main">
<div className="router-main">
<Notify />
{process.env.versionNotify && <Notify />}
{alertContent()}
{this.props.loginState !== 1 ? <Header /> : null}
<div className="router-container">

View File

@ -7,8 +7,7 @@ export default class Notify extends Component {
super(props);
this.state = {
newVersion: process.env.version,
version: process.env.version,
versionNotify: process.env.versionNotify
version: process.env.version
};
}
@ -23,7 +22,7 @@ export default class Notify extends Component {
}
render() {
const isShow = this.state.versionNotify && this.state.newVersion !== this.state.version;
const isShow = this.state.newVersion !== this.state.version;
return (
<div>
{isShow && (

View File

@ -638,12 +638,12 @@ class interfaceController extends baseController {
let annotatedCss = fs.readFileSync(
path.resolve(
yapi.WEBROOT,
'node_modules/jsondiffpatch/public/formatters-styles/annotated.css'
'node_modules/jsondiffpatch/dist/formatters-styles/annotated.css'
),
'utf8'
);
let htmlCss = fs.readFileSync(
path.resolve(yapi.WEBROOT, 'node_modules/jsondiffpatch/public/formatters-styles/html.css'),
path.resolve(yapi.WEBROOT, 'node_modules/jsondiffpatch/dist/formatters-styles/html.css'),
'utf8'
);