From e5519a680225039a2e6ab9ced2855f4b4b75bf52 Mon Sep 17 00:00:00 2001 From: wangxiang <1827945911@qq.com> Date: Tue, 26 Apr 2022 11:22:12 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=9F=20=E9=83=A8=E7=BD=B2=E9=A1=B9?= =?UTF-8?q?=E7=9B=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docker-cloud/docker-compose.yml | 2 +- kicc-ui/.env | 2 +- kicc-ui/.env.production | 4 +- kicc-ui/build/constant.ts | 2 +- kicc-ui/components.d.ts | 117 +++++++++++++++++++++++++++++ kicc-ui/docker/Dockerfile | 9 +++ kicc-ui/docker/docker-compose.yaml | 23 ++++++ kicc-ui/docker/kicc-ui.conf | 30 ++++++++ kicc-ui/src/api/system/menu.ts | 12 +-- kicc-ui/src/api/system/role.ts | 12 +-- 10 files changed, 196 insertions(+), 17 deletions(-) create mode 100644 kicc-ui/components.d.ts create mode 100644 kicc-ui/docker/Dockerfile create mode 100644 kicc-ui/docker/docker-compose.yaml create mode 100644 kicc-ui/docker/kicc-ui.conf diff --git a/docker-cloud/docker-compose.yml b/docker-cloud/docker-compose.yml index dbda77b5..0cb5cf57 100644 --- a/docker-cloud/docker-compose.yml +++ b/docker-cloud/docker-compose.yml @@ -71,7 +71,7 @@ services: context: ../kicc-gateway container_name: kicc-gateway environment: - GATEWAY_HOST: 120.26.168.56 + GATEWAY_HOST: 192.168.3.10 image: kicc-gateway hostname: kicc-gateway restart: always diff --git a/kicc-ui/.env b/kicc-ui/.env index 25bd258f..d52956f4 100644 --- a/kicc-ui/.env +++ b/kicc-ui/.env @@ -1,5 +1,5 @@ # 端口号 -VITE_PORT = 9300 +VITE_PORT = 3100 # 网站标题 VITE_GLOB_APP_TITLE = Kicc Admin diff --git a/kicc-ui/.env.production b/kicc-ui/.env.production index d8003c07..1d451f69 100644 --- a/kicc-ui/.env.production +++ b/kicc-ui/.env.production @@ -14,11 +14,11 @@ VITE_BUILD_COMPRESS_DELETE_ORIGIN_FILE = false # 接口地址 # 如果没有跨域问题,直接在这里配置即可 -VITE_GLOB_API_URL=/api +VITE_GLOB_API_URL=/prod-api # 文件上传地址,可选 # 可以通过nginx转发或者直接写实际地址 -VITE_GLOB_UPLOAD_URL=/upload +VITE_GLOB_UPLOAD_URL=/prod-upload # 接口地址前缀,有些系统所有接口地址都有前缀,可以在这里统一加,方便切换 VITE_GLOB_API_URL_PREFIX= diff --git a/kicc-ui/build/constant.ts b/kicc-ui/build/constant.ts index 893edd7c..93115610 100644 --- a/kicc-ui/build/constant.ts +++ b/kicc-ui/build/constant.ts @@ -7,4 +7,4 @@ export const GLOB_CONFIG_FILE_NAME = '_app.config.js'; -export const OUTPUT_DIR = 'dist'; +export const OUTPUT_DIR = 'docker/dist'; diff --git a/kicc-ui/components.d.ts b/kicc-ui/components.d.ts new file mode 100644 index 00000000..7232a362 --- /dev/null +++ b/kicc-ui/components.d.ts @@ -0,0 +1,117 @@ +// generated by unplugin-vue-components +// We suggest you to commit this file into source control +// Read more: https://github.com/vuejs/vue-next/pull/3399 +import '@vue/runtime-core' + +declare module '@vue/runtime-core' { + export interface GlobalComponents { + AAvatar: typeof import('ant-design-vue/es')['Avatar'] + ABreadcrumb: typeof import('ant-design-vue/es')['Breadcrumb'] + AButton: typeof import('ant-design-vue/es')['Button'] + AButtonGroup: typeof import('ant-design-vue/es')['ButtonGroup'] + ACol: typeof import('ant-design-vue/es')['Col'] + AInput: typeof import('ant-design-vue/es')['Input'] + AList: typeof import('ant-design-vue/es')['List'] + AListItem: typeof import('ant-design-vue/es')['ListItem'] + AListItemMeta: typeof import('ant-design-vue/es')['ListItemMeta'] + ApiSelect: typeof import('./src/components/Form/src/components/ApiSelect.vue')['default'] + ApiTreeSelect: typeof import('./src/components/Form/src/components/ApiTreeSelect.vue')['default'] + AppDarkModeToggle: typeof import('./src/components/Application/src/AppDarkModeToggle.vue')['default'] + AppLocalePicker: typeof import('./src/components/Application/src/AppLocalePicker.vue')['default'] + AppLogo: typeof import('./src/components/Application/src/AppLogo.vue')['default'] + AppProvider: typeof import('./src/components/Application/src/AppProvider.vue')['default'] + AppSearch: typeof import('./src/components/Application/src/search/AppSearch.vue')['default'] + AppSearchFooter: typeof import('./src/components/Application/src/search/AppSearchFooter.vue')['default'] + AppSearchKeyItem: typeof import('./src/components/Application/src/search/AppSearchKeyItem.vue')['default'] + AppSearchModal: typeof import('./src/components/Application/src/search/AppSearchModal.vue')['default'] + ATabPane: typeof import('ant-design-vue/es')['TabPane'] + ATabs: typeof import('ant-design-vue/es')['Tabs'] + ATag: typeof import('ant-design-vue/es')['Tag'] + ATreeSelect: typeof import('ant-design-vue/es')['TreeSelect'] + ATypographyParagraph: typeof import('ant-design-vue/es')['TypographyParagraph'] + Authority: typeof import('./src/components/Authority/src/Authority.vue')['default'] + BasicArrow: typeof import('./src/components/Basic/src/BasicArrow.vue')['default'] + BasicButton: typeof import('./src/components/Button/src/BasicButton.vue')['default'] + BasicDrawer: typeof import('./src/components/Drawer/src/BasicDrawer.vue')['default'] + BasicForm: typeof import('./src/components/Form/src/BasicForm.vue')['default'] + BasicHelp: typeof import('./src/components/Basic/src/BasicHelp.vue')['default'] + BasicMenu: typeof import('./src/components/Menu/src/BasicMenu.vue')['default'] + BasicMenuItem: typeof import('./src/components/Menu/src/components/BasicMenuItem.vue')['default'] + BasicModal: typeof import('./src/components/Modal/src/BasicModal.vue')['default'] + BasicSubMenuItem: typeof import('./src/components/Menu/src/components/BasicSubMenuItem.vue')['default'] + BasicTable: typeof import('./src/components/Table/src/BasicTable.vue')['default'] + BasicTitle: typeof import('./src/components/Basic/src/BasicTitle.vue')['default'] + BasicUpload: typeof import('./src/components/Upload/src/BasicUpload.vue')['default'] + ClickOutSide: typeof import('./src/components/ClickOutSide/src/ClickOutSide.vue')['default'] + CollapseContainer: typeof import('./src/components/Container/src/collapse/CollapseContainer.vue')['default'] + CollapseHeader: typeof import('./src/components/Container/src/collapse/CollapseHeader.vue')['default'] + CollapseTransition: typeof import('./src/components/Transition/src/CollapseTransition.vue')['default'] + ColumnSetting: typeof import('./src/components/Table/src/components/settings/ColumnSetting.vue')['default'] + ContextMenu: typeof import('./src/components/ContextMenu/src/ContextMenu.vue')['default'] + CopperModal: typeof import('./src/components/Cropper/src/CopperModal.vue')['default'] + CountButton: typeof import('./src/components/CountDown/src/CountButton.vue')['default'] + CountdownInput: typeof import('./src/components/CountDown/src/CountdownInput.vue')['default'] + CountTo: typeof import('./src/components/CountTo/src/CountTo.vue')['default'] + Cropper: typeof import('./src/components/Cropper/src/Cropper.vue')['default'] + CropperAvatar: typeof import('./src/components/Cropper/src/CropperAvatar.vue')['default'] + Description: typeof import('./src/components/Description/src/Description.vue')['default'] + DrawerFooter: typeof import('./src/components/Drawer/src/components/DrawerFooter.vue')['default'] + DrawerHeader: typeof import('./src/components/Drawer/src/components/DrawerHeader.vue')['default'] + Dropdown: typeof import('./src/components/Dropdown/src/Dropdown.vue')['default'] + EditableCell: typeof import('./src/components/Table/src/components/editable/EditableCell.vue')['default'] + Editor: typeof import('./src/components/Tinymce/src/Editor.vue')['default'] + EditTableHeaderIcon: typeof import('./src/components/Table/src/components/EditTableHeaderIcon.vue')['default'] + ExportExcelModal: typeof import('./src/components/Excel/src/ExportExcelModal.vue')['default'] + FileList: typeof import('./src/components/Upload/src/FileList.vue')['default'] + FormAction: typeof import('./src/components/Form/src/components/FormAction.vue')['default'] + FormItem: typeof import('./src/components/Form/src/components/FormItem.vue')['default'] + FullScreenSetting: typeof import('./src/components/Table/src/components/settings/FullScreenSetting.vue')['default'] + HeaderCell: typeof import('./src/components/Table/src/components/HeaderCell.vue')['default'] + Icon: typeof import('./src/components/Icon/src/Icon.vue')['default'] + IconPicker: typeof import('./src/components/Icon/src/IconPicker.vue')['default'] + ImgUpload: typeof import('./src/components/Tinymce/src/ImgUpload.vue')['default'] + ImportExcel: typeof import('./src/components/Excel/src/ImportExcel.vue')['default'] + LazyContainer: typeof import('./src/components/Container/src/LazyContainer.vue')['default'] + Loading: typeof import('./src/components/Loading/src/Loading.vue')['default'] + Markdown: typeof import('./src/components/Markdown/src/Markdown.vue')['default'] + Menu: typeof import('./src/components/SimpleMenu/src/components/Menu.vue')['default'] + MenuCollapseTransition: typeof import('./src/components/SimpleMenu/src/components/MenuCollapseTransition.vue')['default'] + MenuItem: typeof import('./src/components/SimpleMenu/src/components/MenuItem.vue')['default'] + MenuItemContent: typeof import('./src/components/Menu/src/components/MenuItemContent.vue')['default'] + ModalClose: typeof import('./src/components/Modal/src/components/ModalClose.vue')['default'] + ModalFooter: typeof import('./src/components/Modal/src/components/ModalFooter.vue')['default'] + ModalHeader: typeof import('./src/components/Modal/src/components/ModalHeader.vue')['default'] + ModalWrapper: typeof import('./src/components/Modal/src/components/ModalWrapper.vue')['default'] + PageFooter: typeof import('./src/components/Page/src/PageFooter.vue')['default'] + PageWrapper: typeof import('./src/components/Page/src/PageWrapper.vue')['default'] + PopConfirmButton: typeof import('./src/components/Button/src/PopConfirmButton.vue')['default'] + Qrcode: typeof import('./src/components/Qrcode/src/Qrcode.vue')['default'] + RadioButtonGroup: typeof import('./src/components/Form/src/components/RadioButtonGroup.vue')['default'] + RedoSetting: typeof import('./src/components/Table/src/components/settings/RedoSetting.vue')['default'] + RouterLink: typeof import('vue-router')['RouterLink'] + RouterView: typeof import('vue-router')['RouterView'] + Scrollbar: typeof import('./src/components/Scrollbar/src/Scrollbar.vue')['default'] + ScrollContainer: typeof import('./src/components/Container/src/ScrollContainer.vue')['default'] + Settings: typeof import('./src/components/Table/src/components/settings/index.vue')['default'] + SimpleMenu: typeof import('./src/components/SimpleMenu/src/SimpleMenu.vue')['default'] + SimpleMenuTag: typeof import('./src/components/SimpleMenu/src/SimpleMenuTag.vue')['default'] + SimpleSubMenu: typeof import('./src/components/SimpleMenu/src/SimpleSubMenu.vue')['default'] + SizeSetting: typeof import('./src/components/Table/src/components/settings/SizeSetting.vue')['default'] + StrengthMeter: typeof import('./src/components/StrengthMeter/src/StrengthMeter.vue')['default'] + SubMenuItem: typeof import('./src/components/SimpleMenu/src/components/SubMenuItem.vue')['default'] + SvgIcon: typeof import('./src/components/Icon/src/SvgIcon.vue')['default'] + TableAction: typeof import('./src/components/Table/src/components/TableAction.vue')['default'] + TableFooter: typeof import('./src/components/Table/src/components/TableFooter.vue')['default'] + TableHeader: typeof import('./src/components/Table/src/components/TableHeader.vue')['default'] + TableImg: typeof import('./src/components/Table/src/components/TableImg.vue')['default'] + TableTitle: typeof import('./src/components/Table/src/components/TableTitle.vue')['default'] + ThumbUrl: typeof import('./src/components/Upload/src/ThumbUrl.vue')['default'] + Time: typeof import('./src/components/Time/src/Time.vue')['default'] + Tree: typeof import('./src/components/Tree/src/Tree.vue')['default'] + TreeHeader: typeof import('./src/components/Tree/src/TreeHeader.vue')['default'] + UploadModal: typeof import('./src/components/Upload/src/UploadModal.vue')['default'] + UploadPreviewModal: typeof import('./src/components/Upload/src/UploadPreviewModal.vue')['default'] + } +} + +export {} diff --git a/kicc-ui/docker/Dockerfile b/kicc-ui/docker/Dockerfile new file mode 100644 index 00000000..c08c0bf0 --- /dev/null +++ b/kicc-ui/docker/Dockerfile @@ -0,0 +1,9 @@ +FROM nginx + +COPY ./dist /data + +RUN rm /etc/nginx/conf.d/default.conf + +ADD kicc-ui.conf /etc/nginx/conf.d/ + +RUN /bin/bash -c 'echo init ok' diff --git a/kicc-ui/docker/docker-compose.yaml b/kicc-ui/docker/docker-compose.yaml new file mode 100644 index 00000000..e2f5a7a4 --- /dev/null +++ b/kicc-ui/docker/docker-compose.yaml @@ -0,0 +1,23 @@ +# PROJECT: 康来生物有限公司kicc(智慧冷链)分布式架构平台 +# VERSION: 1.0.0 +# Author: 康来生物科技有限公司-王翔 + +# https://support.websoft9.com/docs/docker/zh/solution-compose.html#command +version: '3' +services: + kicc-ui: + build: + context: . + restart: always + container_name: kicc-ui + image: kicc-ui + networks: + - docker-cloud_default + external_links: + - kicc-gateway + ports: + - 80:80 + +networks: + docker-cloud_default: + external: true diff --git a/kicc-ui/docker/kicc-ui.conf b/kicc-ui/docker/kicc-ui.conf new file mode 100644 index 00000000..c866a177 --- /dev/null +++ b/kicc-ui/docker/kicc-ui.conf @@ -0,0 +1,30 @@ +server { + # 自定义访问端口 + listen 80; + + # 服务名称 + server_name localhost; + + # 代理访问根地址 + root /data; + + #设置转发请求头参数 + #proxy_set_header Host $http_host; + proxy_connect_timeout 15s; + proxy_send_timeout 15s; + proxy_read_timeout 15s; + proxy_set_header X-Forwarded-Proto http; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + + # 代理访问kicc-ui地址 + location / { + try_files $uri $uri/ /index.html; + } + + # 代理访问后端微服务网关地址 + location ^~/prod-api/ { + rewrite ^/prod-api/(.*)$ /$1 break; + proxy_pass http://kicc-gateway:9999; + } +} diff --git a/kicc-ui/src/api/system/menu.ts b/kicc-ui/src/api/system/menu.ts index ca150bf0..1c3a5ce9 100644 --- a/kicc-ui/src/api/system/menu.ts +++ b/kicc-ui/src/api/system/menu.ts @@ -3,12 +3,12 @@ import { ResultVo } from '../model'; import { defHttp } from '/@/utils/http/axios'; enum Api { - list = 'system_proxy/system/menu/list', - add = 'system_proxy/system/menu/save', - get = 'system_proxy/system/menu', - edit = 'system_proxy/system/menu/update', - del = 'system_proxy/system/menu/remove', - roleMenuIds = 'system_proxy/system/menu/roleMenuTree' + list = '/system_proxy/system/menu/list', + add = '/system_proxy/system/menu/save', + get = '/system_proxy/system/menu', + edit = '/system_proxy/system/menu/update', + del = '/system_proxy/system/menu/remove', + roleMenuIds = '/system_proxy/system/menu/roleMenuTree' } // 查询菜单列表 diff --git a/kicc-ui/src/api/system/role.ts b/kicc-ui/src/api/system/role.ts index 69fae6a1..a63bdd3d 100644 --- a/kicc-ui/src/api/system/role.ts +++ b/kicc-ui/src/api/system/role.ts @@ -2,12 +2,12 @@ import { Role, RoleDto } from './model/roleModel'; import { defHttp } from '/@/utils/http/axios'; enum Api { - list = 'system_proxy/system/role/list', - add = 'system_proxy/system/role/save', - get = 'system_proxy/system/role', - edit = 'system_proxy/system/role/update', - del = 'system_proxy/system/role/remove', - changeStatus = 'system_proxy/system/role/changeStatus' + list = '/system_proxy/system/role/list', + add = '/system_proxy/system/role/save', + get = '/system_proxy/system/role', + edit = '/system_proxy/system/role/update', + del = '/system_proxy/system/role/remove', + changeStatus = '/system_proxy/system/role/changeStatus' } // 查询角色列表