docs: update env workflow and role_code contracts
This commit is contained in:
2
backend
2
backend
Submodule backend updated: 94cec746cb...405000ded5
@@ -34,6 +34,7 @@
|
||||
## 4) roles
|
||||
- `id` UUID PK default `gen_random_uuid()`
|
||||
- `role_key` TEXT NOT NULL UNIQUE
|
||||
- `role_code` TEXT NOT NULL(語意代碼,建議格式:`<system>:<module>:<action>`,例如 `mkt:marketing_card:edit`)
|
||||
- `system_id` UUID NOT NULL FK -> `systems(id)` ON DELETE CASCADE
|
||||
- `name` TEXT NOT NULL
|
||||
- `description` TEXT
|
||||
@@ -41,6 +42,7 @@
|
||||
- `created_at` TIMESTAMPTZ NOT NULL default `now()`
|
||||
- `updated_at` TIMESTAMPTZ NOT NULL default `now()`
|
||||
- UNIQUE(`system_id`, `name`)
|
||||
- UNIQUE(`system_id`, `role_code`)
|
||||
|
||||
## 5) site_roles
|
||||
- `id` UUID PK default `gen_random_uuid()`
|
||||
|
||||
@@ -36,6 +36,7 @@
|
||||
"system_key": "SY20260402X0001",
|
||||
"system_name": "Marketing",
|
||||
"role_key": "RL20260402X0002",
|
||||
"role_code": "mkt:marketing_card:edit",
|
||||
"role_name": "campaign_edit"
|
||||
}
|
||||
]
|
||||
@@ -45,3 +46,4 @@
|
||||
## 注意事項
|
||||
- 不提供 user direct role 寫入 API。
|
||||
- User 最終角色由 `user_sites` + `site_roles` 推導。
|
||||
- `role_key` 是唯一識別鍵;業務語意解析請使用 `role_code`。
|
||||
|
||||
@@ -30,9 +30,11 @@ cd frontend
|
||||
npm install
|
||||
npm run dev
|
||||
```
|
||||
- 本地開發固定使用 `frontend/.env.development`。
|
||||
- production build 讀取 `frontend/.env.production`。
|
||||
- 專案路徑:[frontend](../frontend)
|
||||
|
||||
## 4) 必要環境變數([backend/.env](../backend/.env))
|
||||
## 4) 必要環境變數([backend/.env.development](../backend/.env.development))
|
||||
- `KEYCLOAK_BASE_URL`
|
||||
- `KEYCLOAK_REALM`
|
||||
- `KEYCLOAK_CLIENT_ID`
|
||||
|
||||
@@ -63,9 +63,8 @@ docker compose down
|
||||
## 3) 前端部署(Nginx)
|
||||
```bash
|
||||
cd /opt/member-platform/frontend
|
||||
cp .env.example .env
|
||||
```
|
||||
設定:
|
||||
production build 會自動讀取 `.env.production`,請先確認設定:
|
||||
```env
|
||||
VITE_API_BASE_URL=https://memberapi.ose.tw
|
||||
```
|
||||
|
||||
2
frontend
2
frontend
Submodule frontend updated: 1121c50af8...9de368ae57
Reference in New Issue
Block a user