Commit 4562fb01 by liguokang

feat:

parent 9698a671
/*
* @Author: liguokang
* @Date: 2021-07-15 10:28:10
* @LastEditors: liguokang
* @LastEditTime: 2021-07-27 21:24:21
* @Description:
* @Copyrigh: ©2021 杭州杰竞科技有限公司 版权所有
*/
import React from 'react';
import cookies from 'react-cookies';
import { connect } from 'react-redux';
import Link from 'next/link';
import { withRouter } from 'next/router';
import { StaticImg } from '@/api/interfaces';
import style from './laHeader.less';
import { Button } from 'antd';
class LaHeader extends React.Component {
constructor(props) {
super(props);
this.state = {};
}
render() {
return (
<header>
<nav>
<div className={style.title_con}>
<Link href="/">
<div className={style.title_item}>
<span>头部头部头部头部</span>
<Button>头部头部头部头部</Button>
<img src={StaticImg + '/logo.png'} width={121} alt="" />
</div>
</Link>
<Link href="/">
<div className={style.title_item}>
<span>头部头部头2222部头部</span>
<img src={StaticImg + '/logo.png'} width={121} alt="" />
</div>
</Link>
<Link href="/">
<div className={style.title_item}>
<span>头部头部头部头部</span>
<img src={StaticImg + '/logo.png'} width={121} alt="" />
</div>
</Link>
<Link href="/">
<div className={style.title_item}>
<span>头部头部头部头部</span>
<img src={StaticImg + '/logo.png'} width={121} alt="" />
</div>
</Link>
<Link href="/">
<div className={style.title_item}>
<span>头部头部头部头部</span>
<img src={StaticImg + '/logo.png'} width={121} alt="" />
</div>
</Link>
<Link href="/">
<div className={style.title_item}>
<span>头部头部头部头部</span>
<img src={StaticImg + '/logo.png'} width={121} alt="" />
</div>
</Link>
</div>
</nav>
</header>
);
}
}
// export default withRouter(LaHeader);
const mapStateToProps = ({ city, cityMap }) => ({ city, cityMap });
export default LaHeader;
#! /usr/bin/env node
/*
* @Author: liguokang
* @Date: 2021-07-14 20:42:36
* @Author: 吴文洁
* @Date: 2020-06-05 14:59:14
* @LastEditors: liguokang
* @LastEditTime: 2021-07-15 10:23:15
* @Description:
* @Copyrigh: ©2021 杭州杰竞科技有限公司 版权所有
*/
* @LastEditTime: 2021-07-28 11:30:15
* @Description:
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/
const fs = require('fs')
const [
......
#! /usr/bin/env node
/*
* @Author: liguokang
* @Date: 2021-07-14 20:42:36
* @LastEditors: liguokang
* @LastEditTime: 2021-07-15 10:23:23
* @Description:
* @Copyrigh: ©2021 杭州杰竞科技有限公司 版权所有
* @Author: 吴文洁
* @Date: 2020-06-05 09:38:03
* @LastEditors: louzhedong
* @LastEditTime: 2020-12-26 16:08:19
* @Description:
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/
const execSync = require('child_process').execSync;
......@@ -14,7 +14,7 @@ const execSync = require('child_process').execSync;
const branchName = execSync('git rev-parse --abbrev-ref HEAD').toString().trim();
// 校验分支名是否合法
const firstPattern = new RegExp('dev|rc|gray|master');
const secondPattern = new RegExp('(feature|hotfix)/[a-z]{4,}/[0-9]{8,}/[a-zA-Z-]{4,}');
const secondPattern = new RegExp('(feature|hotfix)/[a-z]{4,}/[0-9]{8,}/[0-9a-zA-Z-]{3,}');
const firstMatch = firstPattern.test(branchName);
const secondMatch = secondPattern.test(branchName);
......@@ -27,10 +27,11 @@ if (!firstMatch && !secondMatch) {
// 获取缓存区内容
// 通过diff指令获得所有改动过(不包括删除)的js文件路径
const fileNameStr = execSync('git diff --diff-filter=AM --cached HEAD --name-only').toString();
const fileNameList = fileNameStr.split('\n');
// 过滤掉空格
const fileNameList = fileNameStr.split('\n').filter((item) => !!item);
// 获取需要检测的文件
const detectedFileList = fileNameList.filter(file => {
const detectedFileList = fileNameList.filter((file) => {
// 过滤掉空的和hooks文件夹下所有的文件
return file && file.indexOf('hooks') < 0;
});
......@@ -39,7 +40,7 @@ const detectedFileList = fileNameList.filter(file => {
let errorFileList = [];
detectedFileList.forEach((file) => {
const results = execSync(`git diff --cached ${file}`);
const pattern = /^http:\/\/{1,}/;
const pattern = /^http\:\/\/.{1,}/;
if (pattern.test(results.toString())) {
errorFileList.push(file);
}
......@@ -60,7 +61,7 @@ fileNameList.forEach((file) => {
if (conflictPattern.test(results)) {
conflictFileList.push(file);
}
})
});
if (conflictFileList.length > 0) {
const conflictFileStr = JSON.stringify(conflictFileList);
// eslint-disable-next-line no-console
......@@ -68,4 +69,4 @@ if (conflictFileList.length > 0) {
process.exit(1);
}
process.exit(0);
\ No newline at end of file
process.exit(0);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment