Browse Source

Merge branch 'deli_scp' of http://dev.ccwin-in.com:3000/sfms3.0/sfms3.0-ui into deli_scp

deli_scp
赵雪冰 4 weeks ago
parent
commit
9748a4d569
  1. 14
      .env.development
  2. 62
      .env.dl-check
  3. 62
      .env.dl-prod
  4. 62
      .env.dl-test
  5. 12
      .env.prod
  6. 14
      .env.test
  7. 12
      .env.test-scp
  8. 14
      .env.wyf
  9. 7
      Dockerfile_prod
  10. 7
      Dockerfile_scp
  11. 18
      index.html
  12. 101
      nginx_prod.conf
  13. 53
      nginx_scp.conf
  14. 3
      package.json
  15. BIN
      public/logo1.png
  16. BIN
      public/logo_white.png
  17. BIN
      public/logo_white_blue.png
  18. 13
      public/systemConfig.js
  19. 7
      src/layout/components/Logo/src/Logo.vue
  20. 3
      src/layout/components/UserInfo/src/UserInfo.vue
  21. 37
      src/utils/systemParam.ts
  22. 9
      src/views/login/login.vue

14
.env.development

@ -4,7 +4,7 @@ NODE_ENV=development
VITE_DEV=false
# 请求路径
VITE_BASE_URL='http://localhost:12080'
VITE_BASE_URL='http://dev.ccwin-in.com:25400/api'
# 上传路径
VITE_UPLOAD_URL='http://localhost:12080/admin-api/infra/file/upload'
@ -44,3 +44,15 @@ VITE_REPORT_URL = 'http://dev.ccwin-in.com:25400'
# 是否需要验证码
VITE_NEED_CODE = false
# LOGO图标
VITE_LOGO_URL = '/src/assets/imgs/logo_white_blue.png'
# LOGO图标
VITE_LOGO_WHITE_URL = '/src/assets/imgs/logo_white.png'
# 项目名称
VITE_PROJECT_NAME = '富维海拉智慧工厂管理平台'
# 租户配置
VITE_TENANT_LIST='[{"text":"长春1379","value":1},{"text":"成都1397","value":2},{"text":"长春2379","value":3}]'

62
.env.dl-check

@ -0,0 +1,62 @@
# 生产环境
NODE_ENV=test
VITE_DEV=false
# 请求路径
VITE_BASE_URL='http://172.16.0.13/api'
# 上传路径
VITE_UPLOAD_URL='http://172.16.0.13/api/admin-api/infra/file/upload'
# 接口前缀
VITE_API_BASEPATH=
# 接口地址
VITE_API_URL=/admin-api
# 是否删除debugger
VITE_DROP_DEBUGGER=true
# 是否删除console.log
VITE_DROP_CONSOLE=true
# 是否sourcemap
VITE_SOURCEMAP=false
# 打包路径
VITE_BASE_PATH=/
# 输出路径
VITE_OUT_DIR=sfms3.0
# 自定义接口路径
VITE_INTERFACE_URL='http://172.16.0.13/magic/web/index.html'
# 积木报表请求路径
VITE_JMREPORT_BASE_URL='http://172.16.0.13'
# 租户配置
VITE_TENANT='["德立天津工厂"]'
# 查看质检报告环境
VITE_REPORT_URL = 'http://172.16.0.13'
# 是否需要验证码
VITE_NEED_CODE = false
# 是否需要下载PDA链接
VITE_PDA_URL = false
# LOGO图标
VITE_LOGO_URL = '/src/assets/imgs/logo_white_blue.png'
# LOGO图标
VITE_LOGO_WHITE_URL = '/src/assets/imgs/logo_white.png'
# 项目名称
VITE_PROJECT_NAME = '富维海拉智慧工厂管理平台'
# 租户配置
VITE_TENANT_LIST='[{"text":"长春1379","value":1},{"text":"成都1397","value":2},{"text":"长春2379","value":3}]'

62
.env.dl-prod

@ -0,0 +1,62 @@
# 生产环境
NODE_ENV=test
VITE_DEV=false
# 请求路径
VITE_BASE_URL='http://172.16.0.13/api'
# 上传路径
VITE_UPLOAD_URL='http://172.16.0.13/api/admin-api/infra/file/upload'
# 接口前缀
VITE_API_BASEPATH=
# 接口地址
VITE_API_URL=/admin-api
# 是否删除debugger
VITE_DROP_DEBUGGER=true
# 是否删除console.log
VITE_DROP_CONSOLE=true
# 是否sourcemap
VITE_SOURCEMAP=false
# 打包路径
VITE_BASE_PATH=/
# 输出路径
VITE_OUT_DIR=sfms3.0
# 自定义接口路径
VITE_INTERFACE_URL='http://172.16.0.13/magic/web/index.html'
# 积木报表请求路径
VITE_JMREPORT_BASE_URL='http://172.16.0.13'
# 租户配置
VITE_TENANT='["德立天津工厂"]'
# 查看质检报告环境
VITE_REPORT_URL = 'http://172.16.0.13'
# 是否需要验证码
VITE_NEED_CODE = false
# 是否需要下载PDA链接
VITE_PDA_URL = false
# LOGO图标
VITE_LOGO_URL = '/src/assets/imgs/logo_white_blue.png'
# LOGO图标
VITE_LOGO_WHITE_URL = '/src/assets/imgs/logo_white.png'
# 项目名称
VITE_PROJECT_NAME = '富维海拉智慧工厂管理平台'
# 租户配置
VITE_TENANT_LIST='[{"text":"长春1379","value":1},{"text":"成都1397","value":2},{"text":"长春2379","value":3}]'

62
.env.dl-test

@ -0,0 +1,62 @@
# 生产环境
NODE_ENV=test
VITE_DEV=false
# 请求路径
VITE_BASE_URL='http://172.16.0.13/api'
# 上传路径
VITE_UPLOAD_URL='http://172.16.0.13/api/admin-api/infra/file/upload'
# 接口前缀
VITE_API_BASEPATH=
# 接口地址
VITE_API_URL=/admin-api
# 是否删除debugger
VITE_DROP_DEBUGGER=true
# 是否删除console.log
VITE_DROP_CONSOLE=true
# 是否sourcemap
VITE_SOURCEMAP=false
# 打包路径
VITE_BASE_PATH=/
# 输出路径
VITE_OUT_DIR=sfms3.0
# 自定义接口路径
VITE_INTERFACE_URL='http://172.16.0.13/magic/web/index.html'
# 积木报表请求路径
VITE_JMREPORT_BASE_URL='http://172.16.0.13'
# 租户配置
VITE_TENANT='["德立天津工厂"]'
# 查看质检报告环境
VITE_REPORT_URL = 'http://172.16.0.13'
# 是否需要验证码
VITE_NEED_CODE = false
# 是否需要下载PDA链接
VITE_PDA_URL = false
# LOGO图标
VITE_LOGO_URL = '/src/assets/imgs/logo_white_blue.png'
# LOGO图标
VITE_LOGO_WHITE_URL = '/src/assets/imgs/logo_white.png'
# 项目名称
VITE_PROJECT_NAME = '富维海拉智慧工厂管理平台'
# 租户配置
VITE_TENANT_LIST='[{"text":"长春1379","value":1},{"text":"成都1397","value":2},{"text":"长春2379","value":3}]'

12
.env.prod

@ -52,3 +52,15 @@ VITE_NEED_CODE = true
# 是否需要下载PDA链接
VITE_PDA_URL = false
# LOGO图标
VITE_LOGO_URL = '/src/assets/imgs/logo_white_blue.png'
# LOGO图标
VITE_LOGO_WHITE_URL = '/src/assets/imgs/logo_white.png'
# 项目名称
VITE_PROJECT_NAME = '富维海拉智慧工厂管理平台'
# 租户配置
VITE_TENANT_LIST='[{"text":"长春1379","value":1},{"text":"成都1397","value":2},{"text":"长春2379","value":3}]'

14
.env.test

@ -47,4 +47,16 @@ VITE_NEED_CODE = true
# 是否需要下载PDA链接
VITE_PDA_URL = true
VITE_PDA_URL = true
# LOGO图标
VITE_LOGO_URL = '/src/assets/imgs/logo_white_blue.png'
# LOGO图标
VITE_LOGO_WHITE_URL = '/src/assets/imgs/logo_white.png'
# 项目名称
VITE_PROJECT_NAME = '富维海拉智慧工厂管理平台'
# 租户配置
VITE_TENANT_LIST='[{"text":"长春1379","value":1},{"text":"成都1397","value":2},{"text":"长春2379","value":3}]'

12
.env.test-scp

@ -48,3 +48,15 @@ VITE_NEED_CODE = false
# 是否需要下载PDA链接
VITE_PDA_URL = false
# LOGO图标
VITE_LOGO_URL = '/src/assets/imgs/logo_white_blue.png'
# LOGO图标
VITE_LOGO_WHITE_URL = '/src/assets/imgs/logo_white.png'
# 项目名称
VITE_PROJECT_NAME = '富维海拉智慧工厂管理平台'
# 租户配置
VITE_TENANT_LIST='[{"text":"长春1379","value":1},{"text":"成都1397","value":2},{"text":"长春2379","value":3}]'

14
.env.wyf

@ -128,4 +128,16 @@ VITE_SYSTERM_UPDATE_ALERT = false
VITE_NEED_CODE = false
# 是否需要下载PDA链接
VITE_PDA_URL = true
VITE_PDA_URL = true
# LOGO图标
VITE_LOGO_URL = '/src/assets/imgs/logo_white_blue.png'
# LOGO图标
VITE_LOGO_WHITE_URL = '/src/assets/imgs/logo_white.png'
# 项目名称
VITE_PROJECT_NAME = '富维海拉智慧工厂管理平台'
# 租户配置
VITE_TENANT_LIST='[{"text":"长春1379","value":1},{"text":"成都1397","value":2},{"text":"长春2379","value":3}]'

7
Dockerfile_prod

@ -1,7 +0,0 @@
# 设置基础镜像
FROM win-nginx
WORKDIR /opt/sfms3.0
COPY nginx_prod.conf /usr/local/nginx/conf/nginx.conf
# 将dist文件中的内容复制到 /opt/sfms3.0 这个目录下面
COPY sfms3.0/ /opt/sfms3.0

7
Dockerfile_scp

@ -1,7 +0,0 @@
# 设置基础镜像
FROM win-nginx
WORKDIR /opt/sfms3.0
COPY nginx_scp.conf /usr/local/nginx/conf/nginx.conf
# 将dist文件中的内容复制到 /opt/sfms3.0 这个目录下面
COPY sfms3.0/ /opt/sfms3.0

18
index.html

@ -3,7 +3,7 @@
<head>
<meta charset="UTF-8" />
<!-- <link rel="icon" href="/favicon.ico" /> -->
<link rel="icon" href="/src/assets/imgs/logo1.png" />
<link rel="icon" href="" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="keywords" content="富维海拉智慧工厂管理平台" />
@ -132,7 +132,7 @@
<div class="app-loading">
<div class="app-loading-wrap">
<div class="app-loading-title">
<img src="/src/assets/imgs/logo_white_blue.png" class="app-loading-logo" alt="Logo" />
<img src="" class="app-loading-logo" alt="Logo" id="logo" />
<div class="app-loading-title" id="app-loading-title">%VITE_APP_TITLE%</div>
</div>
<div class="app-loading-item">
@ -143,5 +143,19 @@
</div>
</div>
<script type="module" src="/src/main.ts"></script>
<script>
document.getElementById('logo').src = systemConfig.logoUrl
document.getElementById('app-loading-title').innerHTML = systemConfig.projectName
function replaceFavicon(src) {
var link = document.querySelector("link[rel~='icon']");
if (!link) {
link = document.createElement('link');
link.rel = 'icon';
document.getElementsByTagName('head')[0].appendChild(link);
}
link.href = src;
}
replaceFavicon(systemConfig.iconUrl);
</script>
</body>
</html>

101
nginx_prod.conf

@ -1,101 +0,0 @@
user root;
worker_processes 2;
events {
worker_connections 1024;
}
http {
include mime.types;
charset utf-8,gbk;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for" "$request_time $upstream_response_time"';
access_log logs/access.log main;
sendfile on;
#tcp_nopush on;
keepalive_timeout 600s;
client_max_body_size 200m;
gzip on;
gzip_min_length 10k;
gzip_comp_level 9;
gzip_buffers 4 16k;
gzip_types text/plain application/javascript text/css application/xml text/javascript image/jpeg image/gif image/png;
gzip_vary on;
gzip_disable "MSIE [1-6]\.";
upstream sfms3.0 {
server localhost:90 weight=10 max_fails=3 fail_timeout=10s;
}
server {
listen 80;
server_name_in_redirect off;
server_name _;
location /api/ {
proxy_pass http://sfms3.0/;
proxy_next_upstream http_500 http_502 http_503 http_504 error timeout invalid_header;
proxy_set_header X-Forwared-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $http_x_forwarded_for;
}
location /profile/ {
alias /opt/profile/;
index index.html index.htm;
}
location / {
try_files $uri $uri/ /index.html;
root /opt/sfms3.0;
index index.html index.htm;
}
}
server {
listen 55563 ssl;
server_name_in_redirect off;
server_name _;
ssl_certificate /opt/faway-hella/faway-hella.com.pem;
ssl_certificate_key /opt/faway-hella/faway-hella.com.key;
location /api/ {
proxy_pass http://sfms3.0/;
proxy_next_upstream http_500 http_502 http_503 http_504 error timeout invalid_header;
proxy_set_header X-Forwared-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $http_x_forwarded_for;
}
location /profile/ {
alias /opt/profile/;
index index.html index.htm;
}
location / {
try_files $uri $uri/ /index.html;
root /opt/sfms3.0;
index index.html index.htm;
}
}
server {
listen 56563 ssl;
server_name_in_redirect off;
server_name _;
ssl_certificate /opt/faway-hella/faway-hella.com.pem;
ssl_certificate_key /opt/faway-hella/faway-hella.com.key;
location /api/ {
proxy_pass http://sfms3.0/;
proxy_next_upstream http_500 http_502 http_503 http_504 error timeout invalid_header;
proxy_set_header X-Forwared-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $http_x_forwarded_for;
}
location /profile/ {
alias /opt/profile/;
index index.html index.htm;
}
location / {
try_files $uri $uri/ /index.html;
root /opt/sfms3.0;
index index.html index.htm;
}
}
}

53
nginx_scp.conf

@ -1,53 +0,0 @@
user root;
worker_processes 2;
events {
worker_connections 1024;
}
http {
include mime.types;
charset utf-8,gbk;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for" "$request_time $upstream_response_time"';
access_log logs/access.log main;
sendfile on;
#tcp_nopush on;
keepalive_timeout 600s;
client_max_body_size 200m;
gzip on;
gzip_min_length 10k;
gzip_comp_level 9;
gzip_buffers 4 16k;
gzip_types text/plain application/javascript text/css application/xml text/javascript image/jpeg image/gif image/png;
gzip_vary on;
gzip_disable "MSIE [1-6]\.";
upstream sfms3.0 {
server localhost:25311 weight=10 max_fails=3 fail_timeout=10s;
}
server {
listen 25400;
server_name_in_redirect off;
server_name _;
location /api/ {
proxy_pass http://sfms3.0/;
proxy_next_upstream http_500 http_502 http_503 http_504 error timeout invalid_header;
proxy_set_header X-Forwared-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $http_x_forwarded_for;
}
location /profile/ {
alias /opt/profile/;
index index.html index.htm;
}
location / {
try_files $uri $uri/ /index.html;
root /opt/sfms3.0;
index index.html index.htm;
}
}
}

3
package.json

@ -11,6 +11,9 @@
"test-scp": "vite build --mode test-scp",
"prod": "vite build --mode prod",
"preview": "vite preview",
"dl-prod": "vite build --mode dl-prod",
"dl-test": "vite build --mode dl-test",
"dl-check": "vite build --mode dl-check",
"lint": "eslint --fix --ext .js,.vue src"
},
"dependencies": {

BIN
public/logo1.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

BIN
public/logo_white.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.7 KiB

BIN
public/logo_white_blue.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 61 KiB

13
public/systemConfig.js

@ -16,5 +16,16 @@ let systemConfig = {
//是否需要验证码
needCode:false,
//是否需要PDA下载链接
pdaUrl:false,
pdaUrl: false,
// logo图标
logoUrl: '/logo_white_blue.png',
// logo图标
logoUrlWhite: '/logo_white.png',
// 项目名称
projectName: '富维海拉智慧工厂管理平台',
// 浏览器上方图标
iconUrl: '/logo1.png',
// 租戶列表
tenantList:'[{"text":"长春1379","value":1},{"text":"成都1397","value":2},{"text":"长春2379","value":3}]'
}

7
src/layout/components/Logo/src/Logo.vue

@ -2,6 +2,7 @@
import { computed, onMounted, ref, unref, watch } from 'vue'
import { useAppStore } from '@/store/modules/app'
import { useDesign } from '@/hooks/web/useDesign'
import { getWhiteLogo,getProjectName } from '@/utils/systemParam'
defineOptions({ name: 'Logo' })
@ -13,7 +14,7 @@ const appStore = useAppStore()
const show = ref(true)
const title = computed(() => appStore.getTitle)
const title = computed(() =>getProjectName())
const layout = computed(() => appStore.getLayout)
@ -77,9 +78,9 @@ watch(
]"
to="/"
>
<img
<img
class="h-24px ml-10px mr-10px h-40px"
src="@/assets/imgs/logo_white.png"
:src="getWhiteLogo()"
/>
<!-- <img
class="h-24px w-[calc(var(--logo-height)-20px)]"

3
src/layout/components/UserInfo/src/UserInfo.vue

@ -7,6 +7,7 @@ import avatarImg from '@/assets/imgs/avatar.gif'
import { useUserStore } from '@/store/modules/user'
import { useTagsViewStore } from '@/store/modules/tagsView'
import { getTenantId } from '@/utils/auth'
import { getTenantList } from '@/utils/systemParam'
defineOptions({ name: 'UserInfo' })
@ -29,7 +30,7 @@ const user = wsCache.get(CACHE_KEY.USER)
const avatar = user.user.avatar ? user.user.avatar : avatarImg
const userName = user.user.nickname ? user.user.nickname : 'Admin'
const names =[{"text":"长春1379","value":1},{"text":"成都1397","value":2},{"text":"长春2379","value":3}]
const names =JSON.parse(getTenantList())
const tenant = names.find(item=>item.value == getTenantId())
const language = wsCache.get('lang')
if('en-US'==language){

37
src/utils/systemParam.ts

@ -8,6 +8,10 @@ const systermUpdateAlert = ref(import.meta.env.VITE_SYSTERM_UPDATE_ALERT)
const systermUpdateUrl = ref(import.meta.env.VITE_SYSTERM_UPDATE_URL)
const needCode = ref(import.meta.env.VITE_NEED_CODE)
const pdaUrl = ref(import.meta.env.VITE_PDA_URL)
const logoUrl = ref(import.meta.env.VITE_LOGO_URL)
const logoUrlWhite = ref(import.meta.env.VITE_LOGO_WHITE_URL)
const projectName = ref(import.meta.env.VITE_PROJECT_NAME)
const tenantList = ref(import.meta.env.VITE_TENANT_LIST)
const mode = ref(import.meta.env.MODE)
// 获取baseUrl
@ -96,3 +100,36 @@ export const getPDAUrl = () => {
}
//获取logo图标
export const getLogo = () => {
if (mode.value === 'prod') {
return systemConfig.logoUrl
} else {
return logoUrl.value
}
}
//获取logo图标
export const getWhiteLogo = () => {
if (mode.value === 'prod') {
return systemConfig.logoUrlWhite
} else {
return logoUrlWhite.value
}
}
//获取项目名称
export const getProjectName = () => {
if (mode.value === 'prod') {
return systemConfig.projectName
} else {
return projectName.value
}
}
//获取租户列表
export const getTenantList = () => {
if (mode.value === 'prod') {
return systemConfig.tenantList
} else {
return tenantList.value
}
}

9
src/views/login/login.vue

@ -9,8 +9,8 @@
>
<!-- 左上角的 logo + 系统标题 -->
<div class="relative flex items-center ">
<img alt="" class="mr-10px w-144px h-36px" src="@/assets/imgs/logo_white_blue.png" />
<span class="text-20px font-bold">{{ t(`ts.${underlineToHump(appStore.getTitle)}`) }}</span>
<img alt="" class="mr-10px h-36px" :src="getLogo()" />
<span class="text-20px font-bold">{{ t(`ts.${underlineToHump(getProjectName())}`) }}</span>
</div>
<!-- 左边的背景图 + 欢迎语 -->
<div class="h-[calc(100%-60px)] flex items-center justify-center">
@ -33,8 +33,8 @@
class="flex items-center justify-between at-2xl:justify-end at-xl:justify-end"
>
<div class="flex items-center at-2xl:hidden at-xl:hidden">
<img alt="" class="mr-10px w-144px h-36px" src="@/assets/imgs/logo_white_blue.png" />
<span class="text-20px font-bold">{{ t(`ts.${underlineToHump(appStore.getTitle)}`) }}</span>
<img alt="" class="mr-10px h-36px" :src="getLogo()" />
<span class="text-20px font-bold">{{ t(`ts.${underlineToHump(getProjectName())}`) }}</span>
</div>
<div class="flex items-center justify-end space-x-10px">
<!-- <ThemeSwitch /> -->
@ -72,6 +72,7 @@ import { useDesign } from '@/hooks/web/useDesign'
import { useAppStore } from '@/store/modules/app'
import { ThemeSwitch } from '@/layout/components/ThemeSwitch'
import { LocaleDropdown } from '@/layout/components/LocaleDropdown'
import {getLogo,getProjectName } from '@/utils/systemParam'
import { LoginForm, MobileForm, QrCodeForm, RegisterForm, SSOLoginVue,QRCodePDA } from './components'

Loading…
Cancel
Save