-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
1. 完成基本框架的搭建 2. 完成基本框架的调试 Signed-off-by: Alan Yeh <[email protected]>
- Loading branch information
Showing
64 changed files
with
819 additions
and
155 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 3 additions & 4 deletions
7
central-gateway/Dockerfile → central-bootstrap/Dockerfile.debug
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,12 @@ | ||
######################################################## | ||
# 使用 Spring Runner 运行本程序 | ||
######################################################## | ||
FROM image | ||
FROM centralx/spring-runner:17 | ||
|
||
ARG STUDIO_COMPONENT | ||
ARG STUDIO_VERSION | ||
|
||
# 复制应用到工作目录 | ||
COPY ${STUDIO_COMPONENT}-${STUDIO_VERSION}.jar application.jar | ||
COPY central-bootstrap-${STUDIO_VERSION}.jar application.jar | ||
|
||
# 暴露端口 | ||
EXPOSE 3000 | ||
EXPOSE 8080 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
58 changes: 58 additions & 0 deletions
58
...dio-views/central-dashboard-view/src/main/node/library/brokers/identity/IdentityBroker.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
import { sha256 } from 'js-sha256' | ||
import type { Account } from '@centralx/types' | ||
import type { AxiosInstance } from 'axios' | ||
|
||
/** | ||
* 认证中心接口 | ||
*/ | ||
export class IdentityBroker { | ||
private http: AxiosInstance | ||
|
||
public constructor(private client: AxiosInstance) { | ||
this.http = client | ||
} | ||
|
||
/** | ||
* 登录 | ||
* @param account 帐户名 | ||
* @param password 密码 | ||
*/ | ||
public async login(account: string, password: string): Promise<void> { | ||
// 对密码进行 sha256 摘要后再提交 | ||
// 防止原始密码被截取 | ||
const hash = sha256.create() | ||
hash.update(password) | ||
|
||
const response = await this.http.post('/identity/api/login', { | ||
account: account, | ||
password: hash.hex(), | ||
secret: 'lLS4p6skBbBVZX30zR5' | ||
}) | ||
|
||
if (response.status !== 200) { | ||
throw new Error(response.data.message) | ||
} | ||
} | ||
|
||
/** | ||
* 退出登录 | ||
*/ | ||
public async logout(): Promise<void> { | ||
return this.http.get('/identity/api/logout') | ||
} | ||
|
||
/** | ||
* 获取当前已登录用户 | ||
*/ | ||
public async getAccount(): Promise<Account | null> { | ||
try { | ||
const response = await this.http.get('/identity/api/account') | ||
if (response.status !== 200) { | ||
return null | ||
} | ||
return response.data | ||
} catch (error) { | ||
return null | ||
} | ||
} | ||
} |
1 change: 1 addition & 0 deletions
1
central-studio-views/central-dashboard-view/src/main/node/library/brokers/identity/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from "./IdentityBroker"; |
2 changes: 2 additions & 0 deletions
2
central-studio-views/central-dashboard-view/src/main/node/library/brokers/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export * from "./identity"; | ||
export * from "./portal"; |
28 changes: 28 additions & 0 deletions
28
...-studio-views/central-dashboard-view/src/main/node/library/brokers/portal/PortalBroker.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import type { Account } from '@centralx/types' | ||
import type { AxiosInstance } from 'axios' | ||
|
||
/** | ||
* 门户(首页)接口 | ||
*/ | ||
export class PortalBroker { | ||
private http: AxiosInstance | ||
|
||
public constructor(private client: AxiosInstance) { | ||
this.http = client | ||
} | ||
|
||
/** | ||
* 获取当前用户信息 | ||
*/ | ||
public async getAccount(): Promise<Account | null> { | ||
const response = await this.http.get('/dashboard/api/account') | ||
return response.data | ||
} | ||
|
||
/** | ||
* 退出登录 | ||
*/ | ||
public async logout(): Promise<void> { | ||
return this.http.get('/dashboard/__logout') | ||
} | ||
} |
1 change: 1 addition & 0 deletions
1
central-studio-views/central-dashboard-view/src/main/node/library/brokers/portal/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from "./PortalBroker"; |
19 changes: 19 additions & 0 deletions
19
central-studio-views/central-dashboard-view/src/main/node/library/types/authority/Role.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import type { Account, Unit } from "../organization"; | ||
|
||
export interface Role { | ||
id?: string; | ||
applicationId?: string; | ||
code?: string; | ||
name?: string; | ||
unitId?: string; | ||
unit?: Unit; | ||
enabled?: boolean; | ||
remark?: string; | ||
|
||
creatorId?: string; | ||
createDate?: number; | ||
creator?: Account; | ||
modifierId?: string; | ||
modifiedDate?: number; | ||
modifier?: Account; | ||
} |
3 changes: 3 additions & 0 deletions
3
central-studio-views/central-dashboard-view/src/main/node/library/types/authority/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import type { Role } from "./Role"; | ||
|
||
export type { Role }; |
1 change: 1 addition & 0 deletions
1
central-studio-views/central-dashboard-view/src/main/node/library/types/gateway/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export type {}; |
1 change: 1 addition & 0 deletions
1
central-studio-views/central-dashboard-view/src/main/node/library/types/identity/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export type {}; |
9 changes: 9 additions & 0 deletions
9
central-studio-views/central-dashboard-view/src/main/node/library/types/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
export * from "./authority"; | ||
export * from "./gateway"; | ||
export * from "./identity"; | ||
export * from "./log"; | ||
export * from "./multicast"; | ||
export * from "./organization"; | ||
export * from "./saas"; | ||
export * from "./storage"; | ||
export * from "./system"; |
1 change: 1 addition & 0 deletions
1
central-studio-views/central-dashboard-view/src/main/node/library/types/log/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export type {}; |
1 change: 1 addition & 0 deletions
1
central-studio-views/central-dashboard-view/src/main/node/library/types/multicast/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export type {}; |
20 changes: 20 additions & 0 deletions
20
...l-studio-views/central-dashboard-view/src/main/node/library/types/organization/Account.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
export interface Account { | ||
id?: string; | ||
username?: string; | ||
email?: string; | ||
mobile?: string; | ||
name?: string; | ||
avatar?: string; | ||
admin?: boolean; | ||
supervisor?: boolean; | ||
|
||
enabled?: boolean; | ||
deleted?: boolean; | ||
|
||
creatorId?: string; | ||
createDate?: number; | ||
creator?: Account; | ||
modifierId?: string; | ||
modifiedDate?: number; | ||
modifier?: Account; | ||
} |
23 changes: 23 additions & 0 deletions
23
...udio-views/central-dashboard-view/src/main/node/library/types/organization/AccountUnit.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import type { Account } from "./Account"; | ||
import type { Department } from "./Department"; | ||
import type { Unit } from "./Unit"; | ||
import type { Rank } from "./Rank"; | ||
|
||
export interface AccountUnit { | ||
id?: string; | ||
accountId?: string; | ||
account?: Account; | ||
unitId?: string; | ||
unit?: Unit; | ||
departments?: Department[]; | ||
rankId?: string; | ||
rank?: Rank; | ||
primary?: boolean; | ||
|
||
creatorId?: string; | ||
createDate?: number; | ||
creator?: Account; | ||
modifierId?: string; | ||
modifiedDate?: number; | ||
modifier?: Account; | ||
} |
Oops, something went wrong.