Skip to content

Commit

Permalink
Merge pull request #1 from batizhao/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
batizhao authored Jan 21, 2021
2 parents d784ca2 + 1aaffe5 commit 85fbf37
Show file tree
Hide file tree
Showing 5 changed files with 90 additions and 26 deletions.
14 changes: 14 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
FROM node:14.15.3-alpine3.12 as builder
WORKDIR /usr/src/app/
COPY package.json ./
RUN npm install --registry=https://registry.npm.taobao.org
COPY ./ ./
RUN npm run build


FROM nginx
WORKDIR /usr/share/nginx/html/
COPY ./docker/nginx.conf /etc/nginx/conf.d/default.conf
COPY --from=builder /usr/src/app/dist /usr/share/nginx/html/
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]
23 changes: 23 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
node {
def build_tag
def registry_addr = "harbor.pecado.com"
def maintainer_name = "pecado"
def image
def version = "1.2"

stage('Git Clone') {
git branch: 'dev', credentialsId: 'github', url: '[email protected]:batizhao/pecado-ui.git'
}

stage('Build Docker Image') {
build_tag = sh(returnStdout: true, script: 'git rev-parse --short HEAD').trim()
image_name = "${registry_addr}/${maintainer_name}/ui:${version}-${build_tag}"
image = docker.build(image_name)
}

stage('Push Docker Image') {
docker.withRegistry('https://harbor.pecado.com', 'harbor-jiangsu-auth') {
image.push()
}
}
}
27 changes: 27 additions & 0 deletions docker/nginx.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
server {
listen 80;

gzip on;
gzip_min_length 1k;
gzip_comp_level 9;
gzip_types text/plain application/javascript application/x-javascript text/css application/xml text/javascript application/x-httpd-php image/jpeg image/gif image/png;
gzip_vary on;
gzip_disable "MSIE [1-6]\.";

# 打包好的dist目录文件,放置到这个目录下
root /usr/share/nginx/html;

location / {
# 用于配合 browserHistory使用
try_files $uri $uri/ /index.html;

# 如果有资源,建议使用 https + http2,配合按需加载可以获得更好的体验
# rewrite ^/(.*)$ https://preview.pro.ant.design/$1 permanent;
}

location /api {
proxy_pass http://pecado-gateway:8080;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Real-IP $remote_addr;
}
}
50 changes: 25 additions & 25 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ant-design-pro",
"version": "4.2.0",
"name": "pecado-ui",
"version": "1.1.0",
"private": true,
"description": "An out-of-box UI solution for enterprise applications",
"scripts": {
Expand Down Expand Up @@ -45,12 +45,12 @@
"not ie <= 10"
],
"dependencies": {
"@ant-design/icons": "^4.2.2",
"@ant-design/pro-layout": "^6.5.11",
"@ant-design/icons": "^4.3.0",
"@ant-design/pro-layout": "^6.10.2",
"@ant-design/pro-list": "^0.0.8",
"@ant-design/pro-table": "^2.9.14",
"antd": "^4.7.3",
"antd-img-crop": "^3.13.1",
"@ant-design/pro-table": "^2.20.1",
"antd": "^4.10.0",
"antd-img-crop": "^3.13.2",
"classnames": "^2.2.6",
"lodash": "^4.17.20",
"moment": "^2.29.1",
Expand All @@ -62,43 +62,43 @@
"react-dom": "^16.14.0",
"react-helmet-async": "^1.0.7",
"react-router": "^4.3.1",
"umi": "^3.2.24",
"umi": "^3.3.3",
"umi-request": "^1.0.8",
"use-merge-value": "^1.0.1"
},
"devDependencies": {
"@ant-design/pro-cli": "^1.0.23",
"@ant-design/pro-cli": "^1.0.28",
"@types/classnames": "^2.2.11",
"@types/express": "^4.17.8",
"@types/express": "^4.17.9",
"@types/history": "^4.7.8",
"@types/jest": "^26.0.15",
"@types/lodash": "^4.14.164",
"@types/jest": "^26.0.19",
"@types/lodash": "^4.14.167",
"@types/qs": "^6.9.5",
"@types/react": "^16.9.55",
"@types/react-dom": "^16.9.9",
"@types/react": "^16.14.2",
"@types/react-dom": "^16.9.10",
"@types/react-helmet": "^5.0.13",
"@umijs/fabric": "^2.3.1",
"@umijs/plugin-blocks": "^2.0.5",
"@umijs/fabric": "^2.4.10",
"@umijs/plugin-blocks": "^2.2.2",
"@umijs/preset-ant-design-pro": "^1.3.0",
"@umijs/preset-react": "^1.6.16",
"@umijs/preset-ui": "^2.2.8",
"@umijs/preset-react": "^1.7.9",
"@umijs/preset-ui": "^2.2.9",
"@umijs/yorkie": "^2.0.3",
"carlo": "^0.9.46",
"chalk": "^4.0.0",
"cross-env": "^7.0.0",
"cross-port-killer": "^1.1.1",
"cross-env": "^7.0.3",
"cross-port-killer": "^1.3.0",
"detect-installer": "^1.0.1",
"enzyme": "^3.11.0",
"eslint": "^7.12.1",
"eslint": "^7.17.0",
"express": "^4.17.1",
"gh-pages": "^3.0.0",
"jsdom-global": "^3.0.2",
"lint-staged": "^10.5.1",
"lint-staged": "^10.5.3",
"mockjs": "^1.0.1-beta3",
"prettier": "^2.1.2",
"prettier": "^2.2.1",
"pro-download": "1.0.1",
"puppeteer-core": "^5.4.1",
"stylelint": "^13.7.2"
"puppeteer-core": "^5.5.0",
"stylelint": "^13.8.0"
},
"engines": {
"node": ">=10.0.0"
Expand Down
2 changes: 1 addition & 1 deletion src/pages/account/settings/components/base.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ const BaseView: FC<BaseViewProps> = (props) => {
const handleFinish = async (values: UserListItem) => {
let avatar = getAvatarURL();
if (fileList[0] && fileList[0].response){
avatar = 'http://localhost:8888/api/system/file/image/' + fileList[0].response.data.fileName;
avatar = '/api/system/file/image/' + fileList[0].response.data.fileName;
}

const result = await addOrUpdateUser({ avatar: avatar, ...values });
Expand Down

0 comments on commit 85fbf37

Please sign in to comment.