Commit 70eb3d53 authored by 胥静's avatar 胥静

离线部署代码修改

parent fae43c43
...@@ -68,6 +68,34 @@ ...@@ -68,6 +68,34 @@
} }
] ]
}, },
"oflProduction": {
"index": {
"input": "src/index_offline.html",
"output": "src/index.html"
},
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.offline.ts"
}
],
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
"extractCss": true,
"namedChunks": false,
"aot": true,
"extractLicenses": true,
"vendorChunk": false,
"buildOptimizer": true,
"budgets": [
{
"type": "initial",
"maximumWarning": "5mb",
"maximumError": "10mb"
}
]
},
"test": { "test": {
"fileReplacements": [ "fileReplacements": [
{ {
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
"ng": "ng", "ng": "ng",
"start": "ng serve", "start": "ng serve",
"build": "ng build --prod -c=production", "build": "ng build --prod -c=production",
"oflbuild": "ng build --prod -c=oflProduction",
"test": "ng build --prod -c=test", "test": "ng build --prod -c=test",
"lint": "ng lint", "lint": "ng lint",
"e2e": "ng e2e" "e2e": "ng e2e"
......
<div class="mainCon"> <div class="mainCon">
<div class="title"> <div class="title" *ngIf="!oflflg">
辉度工业云平台<br> 辉度工业云平台<br>
</div> </div>
<div class="title" *ngIf="oflflg">
物联网云平台<br>
</div>
<div class="loginPartOut"> <div class="loginPartOut">
<div class="loginPart"> <div class="loginPart">
<div class="online"> <div class="online">
...@@ -20,7 +23,7 @@ ...@@ -20,7 +23,7 @@
<button nz-button nzType="primary" nzBlock (click)="login()">登录</button> <button nz-button nzType="primary" nzBlock (click)="login()">登录</button>
</div> </div>
<!-- 版权备案号 --> <!-- 版权备案号 -->
<div style="text-align:right;position:absolute;right:0;bottom:80px;color: #ffffff"> <div style="text-align:right;position:absolute;right:0;bottom:80px;color: #ffffff" *ngIf="!oflflg">
<span>版权所有:上海辉泰信息科技有限公司</span> <span>版权所有:上海辉泰信息科技有限公司</span>
<span><br><a style="color:#ffffff;text-decoration:none;" href="https://beian.miit.gov.cn">网站备案:沪ICP备19015228号-2</a></span> <span><br><a style="color:#ffffff;text-decoration:none;" href="https://beian.miit.gov.cn">网站备案:沪ICP备19015228号-2</a></span>
</div> </div>
......
import { Component, OnInit } from '@angular/core'; import { Component, OnInit } from '@angular/core';
import { import {environment} from '../../../environments/environment';
AbstractControl,
FormBuilder,
FormGroup,
Validators
} from '@angular/forms';
import {en_US, NzMessageService, zh_CN, NzI18nService} from 'ng-zorro-antd'; import {en_US, NzMessageService, zh_CN, NzI18nService} from 'ng-zorro-antd';
import { ApiService } from '../../service/api'; import { ApiService } from '../../service/api';
import {PermissionService} from '../../service/permission'; import {PermissionService} from '../../service/permission';
...@@ -19,6 +14,7 @@ import { TranslateService } from '@ngx-translate/core'; ...@@ -19,6 +14,7 @@ import { TranslateService } from '@ngx-translate/core';
export class LoginComponent implements OnInit { export class LoginComponent implements OnInit {
isLoading = false; isLoading = false;
req: any = {}; req: any = {};
oflflg = false;
constructor(private api: ApiService, private message: NzMessageService, constructor(private api: ApiService, private message: NzMessageService,
private permission: PermissionService, private router: Router, private permission: PermissionService, private router: Router,
...@@ -26,6 +22,7 @@ export class LoginComponent implements OnInit { ...@@ -26,6 +22,7 @@ export class LoginComponent implements OnInit {
} }
ngOnInit(): void { ngOnInit(): void {
this.oflflg = environment.offlineFlg == 'OFL' ? true : false;
} }
login() { login() {
......
<div style="text-align: center;height: 50px;line-height: 50px;"> <div style="text-align: center;height: 50px;line-height: 50px;" *ngIf="!oflflg">
<span style="margin-right: 30px">版权所有:上海辉泰信息科技有限公司</span> <span style="margin-right: 30px">版权所有:上海辉泰信息科技有限公司</span>
<span>网站备案:沪ICP备19015228号-2</span> <span>网站备案:沪ICP备19015228号-2</span>
</div> </div>
import { Component, OnInit } from '@angular/core'; import { Component, OnInit } from '@angular/core';
import {environment} from '../../../environments/environment';
@Component({ @Component({
selector: 'app-footer', selector: 'app-footer',
...@@ -6,10 +7,11 @@ import { Component, OnInit } from '@angular/core'; ...@@ -6,10 +7,11 @@ import { Component, OnInit } from '@angular/core';
styleUrls: ['./footer.component.scss'] styleUrls: ['./footer.component.scss']
}) })
export class FooterComponent implements OnInit { export class FooterComponent implements OnInit {
oflflg = false;
constructor() { } constructor() { }
ngOnInit() { ngOnInit() {
this.oflflg = environment.offlineFlg == 'OFL' ? true : false;
} }
} }
...@@ -76,7 +76,7 @@ ...@@ -76,7 +76,7 @@
</div> </div>
</div> </div>
<div nz-row style="margin-top: 30px;"> <div nz-row style="margin-top: 30px;" *ngIf="!oflflg">
<nz-card nzTitle="应用列表" class="cardHover"> <nz-card nzTitle="应用列表" class="cardHover">
<div class="cont-block" *ngFor="let one of useList" (click)="toDetail(one)"> <div class="cont-block" *ngFor="let one of useList" (click)="toDetail(one)">
<nz-card [nzCover]="coverTemplate"> <nz-card [nzCover]="coverTemplate">
......
...@@ -4,6 +4,7 @@ import {ApiService} from '../../service/api'; ...@@ -4,6 +4,7 @@ import {ApiService} from '../../service/api';
import {NzMessageService} from 'ng-zorro-antd'; import {NzMessageService} from 'ng-zorro-antd';
import {TranslateService} from '@ngx-translate/core'; import {TranslateService} from '@ngx-translate/core';
import {Router} from '@angular/router'; import {Router} from '@angular/router';
import {environment} from "../../../environments/environment";
@Component({ @Component({
selector: 'app-home', selector: 'app-home',
...@@ -22,6 +23,7 @@ export class HomeComponent implements OnInit { ...@@ -22,6 +23,7 @@ export class HomeComponent implements OnInit {
dailyUseRateOption; dailyUseRateOption;
dailyUseTimesRateOption; dailyUseTimesRateOption;
deviceTypeOption; deviceTypeOption;
oflflg = false;
device = { device = {
total: 108923, total: 108923,
...@@ -123,6 +125,7 @@ export class HomeComponent implements OnInit { ...@@ -123,6 +125,7 @@ export class HomeComponent implements OnInit {
ngOnInit() { ngOnInit() {
this.init(); this.init();
this.oflflg = environment.offlineFlg == 'OFL' ? true : false;
} }
init() { init() {
......
export const environment = {
production: true,
// baseUrl: 'http://cloud.witium.com/api', // 对外访问测试网地址
// baseUrl: 'http://jiecloud.witium.com/witcloud/api/',
// baseUrl: 'http://127.0.0.1:8094',
// baseUrl: 'http://47.96.79.210:8094',
offlineFlg: 'OFL', // 离线部署flg
baseUrl: 'https://cloud.witium.com/api',
};
...@@ -4,5 +4,6 @@ export const environment = { ...@@ -4,5 +4,6 @@ export const environment = {
// baseUrl: 'http://jiecloud.witium.com/witcloud/api/', // baseUrl: 'http://jiecloud.witium.com/witcloud/api/',
// baseUrl: 'http://127.0.0.1:8094', // baseUrl: 'http://127.0.0.1:8094',
// baseUrl: 'http://47.96.79.210:8094', // baseUrl: 'http://47.96.79.210:8094',
offlineFlg: '', // 离线部署flg
baseUrl: 'https://cloud.witium.com/api', baseUrl: 'https://cloud.witium.com/api',
}; };
export const environment = { export const environment = {
production: false, production: false,
test: true, test: true,
offlineFlg: '', // 离线部署flg
baseUrl: 'http://cloud.witium.com.cn/api/v2', // 测试 baseUrl: 'http://cloud.witium.com.cn/api/v2', // 测试
}; };
...@@ -5,9 +5,11 @@ ...@@ -5,9 +5,11 @@
export const environment = { export const environment = {
production: false, production: false,
test: false, test: false,
baseUrl: 'https://cloud.witium.com/api',
offlineFlg: 'OFL', // 离线部署flg
// baseUrl: 'http://cloud-test.witium.com/api', // 对外访问测试网地址 // baseUrl: 'http://cloud-test.witium.com/api', // 对外访问测试网地址
// baseUrl: 'http://172.16.1.53:8092', // cy // baseUrl: 'http://172.16.1.53:8092', // cy
baseUrl: 'http://172.16.1.52:8094', // zz // baseUrl: 'http://172.16.1.52:8094', // zz
// baseUrl: 'http://cloud.witium.com.cn/api/v2', // 测试 // baseUrl: 'http://cloud.witium.com.cn/api/v2', // 测试
// baseUrl: 'http://jiecloud.witium.com/witcloud/api/', // baseUrl: 'http://jiecloud.witium.com/witcloud/api/',
}; };
......
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