@uniai-fe/uds-templates 0.3.1 → 0.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
package/src/auth/index.tsx
CHANGED
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
} from "./common/container";
|
|
8
8
|
import AuthCompleteTemplate from "./common/complete/Template";
|
|
9
9
|
import { AuthCodeTemplate } from "./common/auth-code";
|
|
10
|
-
import { AuthLogin } from "./login";
|
|
10
|
+
import { AuthLogin } from "./login/markup";
|
|
11
11
|
import { AuthSignup } from "./signup";
|
|
12
12
|
import { FindAccount } from "./find-account";
|
|
13
13
|
import { FindId } from "./find-id";
|
|
@@ -44,6 +44,7 @@ export * from "./find-id";
|
|
|
44
44
|
export * from "./find-password";
|
|
45
45
|
export { default as AuthCompleteTemplate } from "./common/complete/Template";
|
|
46
46
|
|
|
47
|
+
export * from "./login";
|
|
47
48
|
export type * from "./login";
|
|
48
49
|
export type * from "./signup";
|
|
49
50
|
export type * from "./find-account";
|
package/src/auth/login/index.tsx
CHANGED
|
@@ -2,11 +2,4 @@ import "./index.scss";
|
|
|
2
2
|
|
|
3
3
|
export type * from "./types";
|
|
4
4
|
export * from "./hooks";
|
|
5
|
-
|
|
6
|
-
import AuthLoginContainer from "./markup/Container";
|
|
7
|
-
import AuthLoginFormField from "./markup/FormField";
|
|
8
|
-
|
|
9
|
-
export const AuthLogin = {
|
|
10
|
-
Container: AuthLoginContainer,
|
|
11
|
-
FormField: AuthLoginFormField,
|
|
12
|
-
};
|
|
5
|
+
export * from "./jotai";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./user";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jotaiStorage } from "@uniai-fe/util-jotai";
|
|
2
2
|
import { atomWithStorage } from "jotai/utils";
|
|
3
|
-
import type { API_Res_LoginData } from "../types";
|
|
3
|
+
import type { API_Res_LoginData, API_Res_LoginUserFarm } from "../types";
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* 로그인 사용자 정보 세션스토리지로 관리
|
|
@@ -11,3 +11,50 @@ export const userDataAtom = atomWithStorage<API_Res_LoginData | null>(
|
|
|
11
11
|
null,
|
|
12
12
|
jotaiStorage.session<API_Res_LoginData | null>(),
|
|
13
13
|
);
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* 로그인 사용자의 계정 아이디
|
|
17
|
+
* @state
|
|
18
|
+
*/
|
|
19
|
+
export const userAccountNameAtom = atomWithStorage<string>(
|
|
20
|
+
"userAccountName",
|
|
21
|
+
"",
|
|
22
|
+
jotaiStorage.session<string>(),
|
|
23
|
+
);
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* 로그인 사용자 이름
|
|
27
|
+
* @state
|
|
28
|
+
*/
|
|
29
|
+
export const userOwnerNameAtom = atomWithStorage<string>(
|
|
30
|
+
"userOwnerName",
|
|
31
|
+
"",
|
|
32
|
+
jotaiStorage.session<string>(),
|
|
33
|
+
);
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* 로그인 사용자 접근가능한 농장 목록
|
|
37
|
+
*/
|
|
38
|
+
export const userFarmListAtom = atomWithStorage<API_Res_LoginUserFarm[]>(
|
|
39
|
+
"userFarmList",
|
|
40
|
+
[],
|
|
41
|
+
jotaiStorage.session<API_Res_LoginUserFarm[]>(),
|
|
42
|
+
);
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* 현재 선택된 로그인 사용자 농장 정보
|
|
46
|
+
*/
|
|
47
|
+
export const userFarmAtom = atomWithStorage<API_Res_LoginUserFarm | null>(
|
|
48
|
+
"userFarm",
|
|
49
|
+
null,
|
|
50
|
+
jotaiStorage.session<API_Res_LoginUserFarm | null>(),
|
|
51
|
+
);
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* 로그인 사용자 농장 id 코드
|
|
55
|
+
*/
|
|
56
|
+
export const farmIdAtom = atomWithStorage<number>(
|
|
57
|
+
"farmId",
|
|
58
|
+
-1,
|
|
59
|
+
jotaiStorage.session<number>(),
|
|
60
|
+
);
|
|
@@ -17,6 +17,36 @@ export interface API_Req_Login {
|
|
|
17
17
|
password: string;
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
+
/**
|
|
21
|
+
* 로그인 API; 응답 - 농장목록 정보
|
|
22
|
+
* @route /auth/user/login
|
|
23
|
+
* @property {number} id farm_id (농장 id)
|
|
24
|
+
* @property {string} name 농장명
|
|
25
|
+
* @property {string} farm_code 농장 식별번호
|
|
26
|
+
* @property {string} user_access_role 계정 권한/직책 코드 (OWNER: 농장주, EMPLOYEE: 농장직원, REGIONAL_MANAGER: 지역소장)
|
|
27
|
+
*/
|
|
28
|
+
export interface API_Res_LoginUserFarm {
|
|
29
|
+
/**
|
|
30
|
+
* farm_id (농장 id)
|
|
31
|
+
*/
|
|
32
|
+
id: number;
|
|
33
|
+
/**
|
|
34
|
+
* 농장명
|
|
35
|
+
*/
|
|
36
|
+
name: string;
|
|
37
|
+
/**
|
|
38
|
+
* farm_code (농장 식별번호)
|
|
39
|
+
*/
|
|
40
|
+
farm_code: string;
|
|
41
|
+
/**
|
|
42
|
+
* 계정 권한/직책 코드
|
|
43
|
+
* - OWNER: 농장주
|
|
44
|
+
* - EMPLOYEE: 농장직원
|
|
45
|
+
* - REGIONAL_MANAGER: 지역소장
|
|
46
|
+
*/
|
|
47
|
+
user_access_role: string;
|
|
48
|
+
}
|
|
49
|
+
|
|
20
50
|
/**
|
|
21
51
|
* 로그인 API; 응답 - 유저 정보
|
|
22
52
|
* @route /auth/user/login
|
|
@@ -26,11 +56,13 @@ export interface API_Req_Login {
|
|
|
26
56
|
* @property {string} email 사용자 이메일
|
|
27
57
|
* @property {string} full_name 사용자 이름
|
|
28
58
|
* @property {number} gender 사용자 성별 (0: 남, 1: 여)
|
|
29
|
-
* @property {string} birth_date 사용자 생년월일 (yyyy-MM-dd)
|
|
30
59
|
* @property {number | string} phone_number 사용자 전화번호
|
|
60
|
+
* @property {string} birth_date 사용자 생년월일 (yyyy-MM-dd)
|
|
61
|
+
* @property {string} address 사용자 주소
|
|
62
|
+
* @property {API_Res_LoginUserFarm[]} user_farms 사용자가 접근 권한을 가진 농장 목록
|
|
31
63
|
* @property {string} joined_at 가입일 (UTC; yyyy-MM-ddTHH:mm:ss)
|
|
32
64
|
* @property {string | null} closed_at 사용자 탈퇴일 (UTC; yyyy-MM-ddTHH:mm:ss)
|
|
33
|
-
* @property {number} status 가입 승인여부; 0:
|
|
65
|
+
* @property {number} status 가입 승인여부; 0: 대기, 1: 승인, 2: 거절
|
|
34
66
|
* @property {number} [use_sms] SMS 수신 여부; 0: 수신 안함, 1: 수신
|
|
35
67
|
* @property {number} [user_type] 사용자 유형; 0: 일반 사용자, ..., 99: 관리자
|
|
36
68
|
*/
|
|
@@ -77,12 +109,13 @@ export interface API_Res_LoginUserInfo {
|
|
|
77
109
|
*/
|
|
78
110
|
address: string;
|
|
79
111
|
/**
|
|
80
|
-
*
|
|
81
|
-
*
|
|
82
|
-
*
|
|
83
|
-
*
|
|
112
|
+
* 사용자가 접근 권한을 가진 농장 목록
|
|
113
|
+
* @property {number} id farm_id (농장 id)
|
|
114
|
+
* @property {string} name 농장명
|
|
115
|
+
* @property {string} farm_code 농장 식별번호
|
|
116
|
+
* @property {string} user_access_role 계정 권한/직책 코드 (OWNER: 농장주, EMPLOYEE: 농장직원, REGIONAL_MANAGER: 지역소장)
|
|
84
117
|
*/
|
|
85
|
-
|
|
118
|
+
user_farms: API_Res_LoginUserFarm[];
|
|
86
119
|
/**
|
|
87
120
|
* 가입일 (UTC)
|
|
88
121
|
* - yyyy-MM-ddTHH:mm:ss
|
|
@@ -95,8 +128,9 @@ export interface API_Res_LoginUserInfo {
|
|
|
95
128
|
closed_at: string | null;
|
|
96
129
|
/**
|
|
97
130
|
* 가입 승인여부
|
|
98
|
-
* - 0:
|
|
99
|
-
* - 1:
|
|
131
|
+
* - 0: 대기
|
|
132
|
+
* - 1: 승인
|
|
133
|
+
* - 2: 거절
|
|
100
134
|
*/
|
|
101
135
|
status: number;
|
|
102
136
|
/**
|