项目初始化
This commit is contained in:
19
src/environments/eascs/environment.demo.ts
Normal file
19
src/environments/eascs/environment.demo.ts
Normal file
@ -0,0 +1,19 @@
|
||||
/*
|
||||
* @Description:
|
||||
* @Author: wsm
|
||||
* @Date: 2021-06-18 16:12:05
|
||||
* @LastEditTime: 2021-07-14 10:17:39
|
||||
* @LastEditors: Do not edit
|
||||
* @Reference:
|
||||
*/
|
||||
import { Environment } from '@delon/theme';
|
||||
|
||||
export const environment = {
|
||||
production: true,
|
||||
useHash: true,
|
||||
api: {
|
||||
baseUrl: 'https://scm-api-test.eascs.com',
|
||||
refreshTokenEnabled: false,
|
||||
refreshTokenType: 'auth-refresh',
|
||||
},
|
||||
} as Environment;
|
||||
19
src/environments/eascs/environment.dev.ts
Normal file
19
src/environments/eascs/environment.dev.ts
Normal file
@ -0,0 +1,19 @@
|
||||
/*
|
||||
* @Description:
|
||||
* @Author: wsm
|
||||
* @Date: 2021-06-18 16:12:05
|
||||
* @LastEditTime: 2021-06-30 11:08:23
|
||||
* @LastEditors: wsm
|
||||
* @Reference:
|
||||
*/
|
||||
import { Environment } from '@delon/theme';
|
||||
|
||||
export const environment = {
|
||||
production: true,
|
||||
useHash: true,
|
||||
api: {
|
||||
baseUrl: 'https://scm-api-test.eascs.com',
|
||||
refreshTokenEnabled: false,
|
||||
refreshTokenType: 'auth-refresh',
|
||||
},
|
||||
} as Environment;
|
||||
11
src/environments/eascs/environment.pre.ts
Normal file
11
src/environments/eascs/environment.pre.ts
Normal file
@ -0,0 +1,11 @@
|
||||
import { Environment } from '@delon/theme';
|
||||
|
||||
export const environment = {
|
||||
production: true,
|
||||
useHash: true,
|
||||
api: {
|
||||
baseUrl: 'https://scm-api-pre.eascs.com',
|
||||
refreshTokenEnabled: false,
|
||||
refreshTokenType: 'auth-refresh',
|
||||
},
|
||||
} as Environment;
|
||||
11
src/environments/eascs/environment.prod.ts
Normal file
11
src/environments/eascs/environment.prod.ts
Normal file
@ -0,0 +1,11 @@
|
||||
import { Environment } from '@delon/theme';
|
||||
|
||||
export const environment = {
|
||||
production: true,
|
||||
useHash: true,
|
||||
api: {
|
||||
baseUrl: 'https://scm-api.eascs.com',
|
||||
refreshTokenEnabled: false,
|
||||
refreshTokenType: 'auth-refresh',
|
||||
},
|
||||
} as Environment;
|
||||
11
src/environments/environment.prod.ts
Normal file
11
src/environments/environment.prod.ts
Normal file
@ -0,0 +1,11 @@
|
||||
import { Environment } from '@delon/theme';
|
||||
|
||||
export const environment = {
|
||||
production: true,
|
||||
useHash: true,
|
||||
api: {
|
||||
baseUrl: './',
|
||||
refreshTokenEnabled: true,
|
||||
refreshTokenType: 'auth-refresh'
|
||||
}
|
||||
} as Environment;
|
||||
38
src/environments/environment.service.ts
Normal file
38
src/environments/environment.service.ts
Normal file
@ -0,0 +1,38 @@
|
||||
/*
|
||||
* @Author: Maple
|
||||
* @Date: 2021-03-22 09:50:07
|
||||
* @LastEditors: Do not edit
|
||||
* @LastEditTime: 2021-05-27 11:37:17
|
||||
* @Description:全局环境服务
|
||||
*/
|
||||
import { Injectable } from '@angular/core';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root',
|
||||
})
|
||||
export class EnvironmentService {
|
||||
// 应用ID
|
||||
private appId = `D40B4EFC33FC4803864934872A11B0CE`;
|
||||
// 租户ID
|
||||
private tenantId = `1352892699355607041`;
|
||||
private env: { appId: string; tenantId: string } = { appId: this.appId, tenantId: this.tenantId };
|
||||
constructor() {
|
||||
this.setEnvironment(this.appId, this.tenantId);
|
||||
}
|
||||
/**
|
||||
* 设置环境信息
|
||||
* @param appId 应用ID
|
||||
* @param tenantId 租户ID
|
||||
*/
|
||||
setEnvironment(appId: string, tenantId: string): void {
|
||||
this.env = { appId, tenantId };
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取环境信息
|
||||
* @returns 环境信息
|
||||
*/
|
||||
getEnvironment() {
|
||||
return this.env;
|
||||
}
|
||||
}
|
||||
27
src/environments/environment.ts
Normal file
27
src/environments/environment.ts
Normal file
@ -0,0 +1,27 @@
|
||||
// This file can be replaced during build by using the `fileReplacements` array.
|
||||
// `ng build ---prod` replaces `environment.ts` with `environment.prod.ts`.
|
||||
// The list of file replacements can be found in `angular.json`.
|
||||
|
||||
import { DelonMockModule } from '@delon/mock';
|
||||
import { Environment } from '@delon/theme';
|
||||
|
||||
import * as MOCKDATA from '../../_mock';
|
||||
|
||||
export const environment = {
|
||||
production: false,
|
||||
useHash: true,
|
||||
api: {
|
||||
baseUrl: './',
|
||||
refreshTokenEnabled: true,
|
||||
refreshTokenType: 'auth-refresh'
|
||||
},
|
||||
modules: [DelonMockModule.forRoot({ data: MOCKDATA })]
|
||||
} as Environment;
|
||||
|
||||
/*
|
||||
* In development mode, to ignore zone related error stack frames such as
|
||||
* `zone.run`, `zoneDelegate.invokeTask` for easier debugging, you can
|
||||
* import the following file, but please comment it out in production mode
|
||||
* because it will have performance impact when throw error
|
||||
*/
|
||||
// import 'zone.js/plugins/zone-error'; // Included with Angular CLI.
|
||||
Reference in New Issue
Block a user