Skip to content

Commit

Permalink
fix(*): merge yapi pro
Browse files Browse the repository at this point in the history
  • Loading branch information
beeant0512 committed Oct 25, 2023
1 parent 84e35a5 commit 50b0ffe
Show file tree
Hide file tree
Showing 53 changed files with 399,004 additions and 16,342 deletions.
3 changes: 3 additions & 0 deletions .DOCKERIGNORE
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
node_modules/
/logs
.git/
1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2.5.0
26 changes: 7 additions & 19 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,24 +1,12 @@
FROM node:12-alpine as builder

RUN apk add --no-cache git python make openssl tar gcc

COPY . /api/vendors

RUN cd /api/vendors && \
npm install --production --registry https://registry.npm.taobao.org

FROM node:12-alpine
ENV TZ="Asia/Shanghai"
# 使用阿里云镜像
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories
WORKDIR /yapi/vendors
COPY . /yapi/vendors/

MAINTAINER [email protected]

ENV TZ="Asia/Shanghai" HOME="/"

WORKDIR ${HOME}

COPY --from=builder /api/vendors /api/vendors

COPY config_example.json /api/config.json
RUN apk add --no-cache wget python make && cd /yapi/vendors && npm set strict-ssl false
RUN npm install --production --registry https://registry.npm.taobao.org

EXPOSE 3000

ENTRYPOINT ["node"]
2 changes: 1 addition & 1 deletion client/components/AceEditor/AceEditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class AceEditor extends React.PureComponent {
}
}

componentWillReceiveProps(nextProps) {
UNSAFE_componentWillReceiveProps(nextProps) {
if (!this.editor) {
return;
}
Expand Down
2 changes: 1 addition & 1 deletion client/components/AuthenticatedComponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export function requireAuthentication(Component) {
componentWillMount() {
this.checkAuth();
}
componentWillReceiveProps() {
UNSAFE_componentWillReceiveProps() {
this.checkAuth();
}
checkAuth() {
Expand Down
2 changes: 1 addition & 1 deletion client/components/Label/Label.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export default class Label extends Component {
handleChange = event => {
this.setState({ inputValue: event.target.value });
};
componentWillReceiveProps(nextProps) {
UNSAFE_componentWillReceiveProps(nextProps) {
if (this.props.desc === nextProps.desc) {
this.setState({
inputShow: false
Expand Down
2 changes: 1 addition & 1 deletion client/components/Loading/Loading.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export default class Loading extends React.PureComponent {
super(props);
this.state = { show: props.visible };
}
componentWillReceiveProps(nextProps) {
UNSAFE_componentWillReceiveProps(nextProps) {
this.setState({ show: nextProps.visible });
}
render() {
Expand Down
2 changes: 1 addition & 1 deletion client/components/ModalPostman/VariablesSelect.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ class VariablesSelect extends Component {
}
}

async componentWillReceiveProps(nextProps) {
async UNSAFE_componentWillReceiveProps(nextProps) {
if (this.records && nextProps.id && this.id !== nextProps.id) {
this.handleRecordsData(nextProps.id);
}
Expand Down
2 changes: 1 addition & 1 deletion client/components/MyPopConfirm/MyPopConfirm.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class MyPopConfirm extends Component {
this.setState({ visible: false });
}

componentWillReceiveProps() {
UNSAFE_componentWillReceiveProps() {
this.setState({ visible: true });
}

Expand Down
2 changes: 1 addition & 1 deletion client/components/Postman/Postman.js
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ export default class Run extends Component {
clearInterval(this._crossRequestInterval);
}

componentWillReceiveProps(nextProps) {
UNSAFE_componentWillReceiveProps(nextProps) {
if (this.checkInterfaceData(nextProps.data) && this.checkInterfaceData(this.props.data)) {
if (nextProps.data._id !== this.props.data._id) {
this.initState(nextProps.data);
Expand Down
2 changes: 1 addition & 1 deletion client/containers/Group/GroupList/GroupList.js
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ export default class GroupList extends Component {
}
}

componentWillReceiveProps(nextProps) {
UNSAFE_componentWillReceiveProps(nextProps) {
// GroupSetting 组件设置的分组信息,通过redux同步到左侧分组菜单中
if (this.props.groupList !== nextProps.groupList) {
this.setState({
Expand Down
2 changes: 1 addition & 1 deletion client/containers/Group/GroupSetting/GroupSetting.js
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ class GroupSetting extends Component {
});
};

componentWillReceiveProps(nextProps) {
UNSAFE_componentWillReceiveProps(nextProps) {
// 切换分组时,更新分组信息并关闭删除分组操作
if (this.props.currGroup._id !== nextProps.currGroup._id) {
this.initState(nextProps);
Expand Down
2 changes: 1 addition & 1 deletion client/containers/Group/MemberList/MemberList.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ class MemberList extends Component {
});
};

componentWillReceiveProps(nextProps) {
UNSAFE_componentWillReceiveProps(nextProps) {
if (this._groupId !== this._groupId) {
return null;
}
Expand Down
2 changes: 1 addition & 1 deletion client/containers/Group/ProjectList/ProjectList.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ class ProjectList extends Component {
this.props.fetchProjectList(this.props.currGroup._id, this.props.currPage);
};

componentWillReceiveProps(nextProps) {
UNSAFE_componentWillReceiveProps(nextProps) {
this.props.setBreadcrumb([{ name: '' + (nextProps.currGroup.group_name || '') }]);

// 切换分组
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ export default class InterfaceCaseContent extends Component {
this.setState({ editCasename: this.props.currCase.casename });
}

async componentWillReceiveProps(nextProps) {
async UNSAFE_componentWillReceiveProps(nextProps) {
const oldCaseId = this.props.match.params.actionId;
const newCaseId = nextProps.match.params.actionId;
const { interfaceColList } = nextProps;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,7 @@ class InterfaceColContent extends Component {
this.aceEditor.editor.insertCode(code);
};

async componentWillReceiveProps(nextProps) {
async UNSAFE_componentWillReceiveProps(nextProps) {
let newColId = !isNaN(nextProps.match.params.actionId) ? +nextProps.match.params.actionId : 0;

if (newColId && ((this.currColId && newColId !== this.currColId) || nextProps.isRander)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ export default class InterfaceColMenu extends Component {
this.getList();
}

componentWillReceiveProps(nextProps) {
UNSAFE_componentWillReceiveProps(nextProps) {
if (this.props.interfaceColList !== nextProps.interfaceColList) {
this.setState({
list: nextProps.interfaceColList
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class Content extends Component {
document.getElementsByTagName('title')[0].innerText = this.title;
}

componentWillReceiveProps(nextProps) {
UNSAFE_componentWillReceiveProps(nextProps) {
const params = nextProps.match.params;
if (params.actionId !== this.actionId) {
this.actionId = params.actionId;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ class InterfaceList extends Component {
this.handleRequest(this.props);
}

componentWillReceiveProps(nextProps) {
UNSAFE_componentWillReceiveProps(nextProps) {
let _actionId = nextProps.match.params.actionId;

if (this.actionId !== _actionId) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ class InterfaceMenu extends Component {
this.handleRequest();
}

componentWillReceiveProps(nextProps) {
UNSAFE_componentWillReceiveProps(nextProps) {
if (this.props.list !== nextProps.list) {
// console.log('next', nextProps.list)
this.setState({
Expand Down Expand Up @@ -385,6 +385,7 @@ class InterfaceMenu extends Component {
case "api_to_cat":
axios.post('/api/interface/up', {id: dragKey, catid: dropObj._id});
break;
// eslint-disable-next-line no-case-declarations
default:
// 同一个分类下的接口交换顺序
let colList = list[dropCatIndex].list;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export default class AddColModal extends Component {
this.setState({ caseName: this.props.caseName });
}

componentWillReceiveProps(nextProps) {
UNSAFE_componentWillReceiveProps(nextProps) {
this.setState({ id: nextProps.interfaceColList[0]._id });
this.setState({ caseName: nextProps.caseName });
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export default class Run extends Component {

componentWillMount() {}

componentWillReceiveProps() {}
UNSAFE_componentWillReceiveProps() {}

savePostmanRef = postman => {
this.postman = postman;
Expand Down
2 changes: 1 addition & 1 deletion client/containers/Project/Project.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export default class Project extends Component {
]);
}

async componentWillReceiveProps(nextProps) {
async UNSAFE_componentWillReceiveProps(nextProps) {
const currProjectId = this.props.match.params.id;
const nextProjectId = nextProps.match.params.id;
if (currProjectId !== nextProjectId) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ class ProjectEnvContent extends Component {
this.setState({ ...newValue });
}

componentWillReceiveProps(nextProps) {
UNSAFE_componentWillReceiveProps(nextProps) {
let curEnvName = this.props.projectMsg.name;
let nextEnvName = nextProps.projectMsg.name;
if (curEnvName !== nextEnvName) {
Expand Down
2 changes: 1 addition & 1 deletion client/containers/User/Profile.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ class Profile extends Component {
this.handleUserinfo(this.props);
}

componentWillReceiveProps(nextProps) {
UNSAFE_componentWillReceiveProps(nextProps) {
if (!nextProps.match.params.uid) {
return;
}
Expand Down
23 changes: 23 additions & 0 deletions config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"port": "3000",
"adminAccount": "[email protected]",
"timeout": 120000,
"db": {
"servername": "127.0.0.1",
"DATABASE": "yapi",
"port": 27017,
"user": "test1",
"pass": "test1",
"authSource": ""
},
"mail": {
"enable": true,
"host": "smtp.163.com",
"port": 465,
"from": "***@163.com",
"auth": {
"user": "***@163.com",
"pass": "*****"
}
}
}
7 changes: 3 additions & 4 deletions npm-publish.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@ if(!version){
process.exit(1)
}

shell.exec ('npm install --registry https://registry.npm.taobao.org');
shell.exec ('npm run build-client');
shell.exec ('npm run changelog');
shell.exec ('cnpm i');
shell.exec ('cnpm run build-client');
shell.exec ('git add .');
shell.exec ('git commit -a -m "chore: update static file"');

Expand All @@ -27,4 +26,4 @@ shell.exec ('git push origin ' + version);
console.log('git push success', version)

console.log('正在执行npm发布')
shell.exec('npm publish')
shell.exec('npm publish --registry https://registry.npmjs.org/')
Loading

0 comments on commit 50b0ffe

Please sign in to comment.