diff --git a/.env.development b/.env.development index 643cfc8e..367cfd4d 100644 --- a/.env.development +++ b/.env.development @@ -12,5 +12,6 @@ port= 9988 # 服务端地址 //target = http://192.168.18.134:8899 -target = http://192.168.18.139:8899 +//target = http://192.168.18.139:8899 // target = http://192.168.18.136:8899 +target = http://192.168.10.241:30646 diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..2cade74d --- /dev/null +++ b/Dockerfile @@ -0,0 +1,30 @@ +FROM nginx +MAINTAINER lfzxs@qq.com +VOLUME /tmp +ENV LANG en_US.UTF-8 +RUN echo "server { \ + listen 80; \ + location ^~ /smart-power { \ + #后端地址 + proxy_pass http://192.168.10.241:30646/; \ + proxy_set_header Host smart-power; \ + proxy_set_header X-Real-IP \$remote_addr; \ + proxy_set_header X-Forwarded-For \$proxy_add_x_forwarded_for; \ + } \ + #解决Router(mode: 'history')模式下,刷新路由地址不能找到页面的问题 \ + location / { \ + root /var/www/html/; \ + index index.html index.htm; \ + if (!-e \$request_filename) { \ + rewrite ^(.*)\$ /index.html?s=\$1 last; \ + break; \ + } \ + } \ + access_log /var/log/nginx/access.log ; \ + } " > /etc/nginx/conf.d/default.conf \ + && mkdir -p /var/www \ + && mkdir -p /var/www/html + +ADD dist/ /var/www/html/ +EXPOSE 80 +EXPOSE 443 \ No newline at end of file diff --git a/deploy/dev/smart-power-ui-svc.yaml b/deploy/dev/smart-power-ui-svc.yaml new file mode 100644 index 00000000..e5a930a9 --- /dev/null +++ b/deploy/dev/smart-power-ui-svc.yaml @@ -0,0 +1,20 @@ +apiVersion: v1 +kind: Service +metadata: + labels: + app: smart-power-ui + component: $APP_SENVICE_NAME + name: $APP_SENVICE_NAME + namespace: $APP_NAME_SPACE +spec: + ports: + - name: http-80 + port: 80 + protocol: TCP + targetPort: 80 + selector: + app: smart-power-ui + component: $APP_SENVICE_NAME + tier: backend + sessionAffinity: None + type: NodePort diff --git a/deploy/dev/smart-power-ui.yaml b/deploy/dev/smart-power-ui.yaml new file mode 100644 index 00000000..07b2e0bc --- /dev/null +++ b/deploy/dev/smart-power-ui.yaml @@ -0,0 +1,46 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + labels: + app: smart-power-ui + component: $APP_SENVICE_NAME + tier: backend + name: $APP_SENVICE_NAME + namespace: $APP_NAME_SPACE +spec: + progressDeadlineSeconds: 600 + replicas: 1 + selector: + matchLabels: + app: smart-power-ui + component: $APP_SENVICE_NAME + tier: backend + template: + metadata: + labels: + app: smart-power-ui + component: $APP_SENVICE_NAME + tier: backend + spec: + containers: + - image: $REGISTRY_histron/$DOCKERHUB_NAMESPACE_histron/$APP_NAME_histron:$BRANCH_NAME-$BUILD_NUMBER + imagePullPolicy: Always + name: $APP_SENVICE_NAME + ports: + - name: http-80 + containerPort: 80 + protocol: TCP + resources: + requests: + cpu: 500m + memory: 1000Mi + limits: + cpu: 500m + memory: 1000Mi + terminationMessagePath: /dev/termination-log + terminationMessagePolicy: File + imagePullSecrets: + - name: histron + dnsPolicy: ClusterFirst + restartPolicy: Always + terminationGracePeriodSeconds: 30 diff --git a/public/config/env.js b/public/js/config.js similarity index 95% rename from public/config/env.js rename to public/js/config.js index 69031fe1..2644293c 100644 --- a/public/config/env.js +++ b/public/js/config.js @@ -12,7 +12,7 @@ let iotWebSocketAlarmBaseUrl = '' let BaseUrl = '' // 手动配置的地址 -var iotHost="192.168.18.139:8899"; // 海创iot 平台 host +var iotHost="192.168.10.241:30646"; // 海创iot 平台 host // var hrefHost = window.location.host; // let httpProtocol = window.location.protocol; var hrefHost = '192.168.18.139'; diff --git a/src/api/thirdApi.js b/src/api/thirdApi.js index 020b15db..88408dff 100644 --- a/src/api/thirdApi.js +++ b/src/api/thirdApi.js @@ -1,5 +1,5 @@ import axios from "axios"; -import { iotPlatformUrl } from '/public/config/env' +import { iotPlatformUrl } from '/public/js/config' import { getDevcieApp } from "@/api/app"; var appInfo = {} diff --git a/src/utils/request.js b/src/utils/request.js index c7b33c3f..43ed6c99 100644 --- a/src/utils/request.js +++ b/src/utils/request.js @@ -4,7 +4,7 @@ import store from '@/store' import { getToken } from '@/utils/auth' import errorCode from '@/utils/errorCode' import { preventCloseFu } from "@/utils/hciot"; -import { BaseUrl } from '/public/config/env' +import { BaseUrl } from '/public/js/config' axios.defaults.headers['Content-Type'] = 'application/json;charset=utf-8' // 创建axios实例 diff --git a/src/views/bigScreen/v1/index.vue b/src/views/bigScreen/v1/index.vue index 53bad8f2..5246ac18 100644 --- a/src/views/bigScreen/v1/index.vue +++ b/src/views/bigScreen/v1/index.vue @@ -68,7 +68,7 @@ import TypeDistributionWrap from "./profile/typeDistribution"; import trendWrap from "./profile/trend"; import MapWrap from "./profile/mapWrap"; import MapWrapPersonal from "./profile/personalCenter"; -import { iotWebSocketAlarmBaseUrl } from "/public/config/env"; +import { iotWebSocketAlarmBaseUrl } from "/public/js/config"; import { getWarningAnalysis, homeCount, appProjectList } from "@/api/app"; export default { diff --git a/src/views/bigScreen/v2/index.vue b/src/views/bigScreen/v2/index.vue index 23e56cdf..7beb4c61 100644 --- a/src/views/bigScreen/v2/index.vue +++ b/src/views/bigScreen/v2/index.vue @@ -68,7 +68,7 @@ import TypeDistributionWrap from "./profile/typeDistribution"; import trendWrap from "./profile/trend"; import MapWrap from "./profile/mapWrap"; import MapWrapPersonal from "./profile/personalCenter"; -import { iotWebSocketAlarmBaseUrl } from "/public/config/env"; +import { iotWebSocketAlarmBaseUrl } from "/public/js/config"; import { getWarningAnalysis, homeCount, appProjectList } from "@/api/app"; export default { diff --git a/src/views/bigScreen/v3/index.vue b/src/views/bigScreen/v3/index.vue index a5745896..7594a9fb 100644 --- a/src/views/bigScreen/v3/index.vue +++ b/src/views/bigScreen/v3/index.vue @@ -81,7 +81,7 @@ import TypeDistributionWrap from "./profile/typeDistribution"; import trendWrap from "./profile/trend"; import MapWrap from "./profile/mapWrap"; import MapWrapPersonal from "./profile/personalCenter"; -import { iotWebSocketAlarmBaseUrl } from "/public/config/env"; +import { iotWebSocketAlarmBaseUrl } from "/public/js/config"; import Cookies from "js-cookie"; import { NextLoading } from '@/utils/loading'; diff --git a/src/views/iot/autocontrol/job/profile/deviceParam.vue b/src/views/iot/autocontrol/job/profile/deviceParam.vue index c78ad730..68a04f3f 100644 --- a/src/views/iot/autocontrol/job/profile/deviceParam.vue +++ b/src/views/iot/autocontrol/job/profile/deviceParam.vue @@ -129,7 +129,7 @@ import SelectTableWrap from "@/components/SelectTable/index"; import axios from "axios"; import { getToken } from "@/utils/auth"; -import { basePlatformUrl } from '/public/config/env' +import { basePlatformUrl } from '/public/js/config' import { getDeviceFunList, getDeviceCmdList } from "@/api/iot/device"; diff --git a/src/views/iot/device/profile/details.vue b/src/views/iot/device/profile/details.vue index 9bb0613c..f911e75c 100644 --- a/src/views/iot/device/profile/details.vue +++ b/src/views/iot/device/profile/details.vue @@ -66,7 +66,7 @@ import InfoWrap from "./info"; import ChildDevice from "./childDevice"; import DeviceLog from "@/views/profile/DeviceDetailsView/deviceLog"; import DeviceRunStartsWrap from "@/views/profile/DeviceRunStarts/index"; -import { iotWebSocketBaseUrl } from "/public/config/env"; +import { iotWebSocketBaseUrl } from "/public/js/config"; import TriggerWrap from "@/views/profile/DeviceTrigger/index"; export default { name: "DetailsWrap", diff --git a/src/views/personal/device/profile/details.vue b/src/views/personal/device/profile/details.vue index 8062b9dd..dc33206e 100644 --- a/src/views/personal/device/profile/details.vue +++ b/src/views/personal/device/profile/details.vue @@ -59,7 +59,7 @@ import InfoWrap from "./info"; import DeviceLog from "@/views/profile/DeviceDetailsView/deviceLog"; import ChildDevice from "./childDevice"; import DeviceRunStartsWrap from "@/views/profile/DeviceRunStarts/index"; -import { iotWebSocketBaseUrl } from "/public/config/env"; +import { iotWebSocketBaseUrl } from "/public/js/config"; export default { name: "DetailsWrap", props: ["sourceId"], diff --git a/src/views/personal/device/profile/runStarts.vue b/src/views/personal/device/profile/runStarts.vue index 967666be..4b2c1bab 100644 --- a/src/views/personal/device/profile/runStarts.vue +++ b/src/views/personal/device/profile/runStarts.vue @@ -67,7 +67,7 @@