Skip to content

Commit f86afaa

Browse files
committed
feat: web auth
1 parent c5a5fe4 commit f86afaa

File tree

19 files changed

+890
-182
lines changed

19 files changed

+890
-182
lines changed

web/.env

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ VITE_SERVER_BASE_URL=
33

44
# this only used for dev environment, change it to your local api server url if needed
55
# don't change it directly, you should create a .env.local file and set it there
6-
VITE_DEV_SERVER_URL=http://api.dev.laf.run
6+
VITE_DEV_SERVER_URL=http://api.sunlong-dev.lafyun.com/

web/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,4 +70,4 @@
7070
"prettier --write"
7171
]
7272
}
73-
}
73+
}

web/pnpm-lock.yaml

Lines changed: 44 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

web/public/locales/en/translation.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@
281281
"Free": "Free"
282282
},
283283
"star-us-on-github": "Star us on GitHub",
284-
"LoginPanel": {
284+
"AuthPanel": {
285285
"Phone": "Mobile number",
286286
"PhoneTip": "Please enter a valid Mobile phone number",
287287
"ValidationCode": "Validation code",

web/public/locales/zh-CN/translation.json

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -281,14 +281,24 @@
281281
"Free": "免费"
282282
},
283283
"star-us-on-github": "在 GitHub 上支持我们",
284-
"LoginPanel": {
284+
"AuthPanel": {
285285
"Phone": "手机号",
286286
"PhoneTip": "请输入有效的手机号码",
287287
"ValidationCode": "验证码",
288288
"getValidationCode": "获取验证码",
289289
"Login": "登录",
290290
"LoginTip": "请输入手机号和验证码",
291291
"LoginWithGithub": "GitHub 登录",
292-
"ValidationCodeTip": "请输入验证码"
292+
"ValidationCodeTip": "请输入验证码",
293+
"ForgotPassword": "忘记密码",
294+
"Register": "注册",
295+
"ToRegister": "去注册",
296+
"ToLogin": "去登录",
297+
"PasswordLogin": "密码登录",
298+
"PhoneLogin": "手机验证码登录",
299+
"Account": "用户名",
300+
"AccountPlaceholder": "请输入用户名",
301+
"Password": "密码",
302+
"ConfirmPassword": "确认密码"
293303
}
294304
}

web/public/locales/zh/translation.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@
281281
"Free": "免费"
282282
},
283283
"star-us-on-github": "在 GitHub 上支持我们",
284-
"LoginPanel": {
284+
"AuthPanel": {
285285
"Phone": "手机号",
286286
"PhoneTip": "请输入有效的手机号码",
287287
"ValidationCode": "验证码",

web/src/apis/v1/api-auto.d.ts

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -556,4 +556,52 @@ declare namespace Paths {
556556

557557
export type Responses = any;
558558
}
559+
560+
namespace AuthControllerSignup {
561+
export type QueryParameters = any;
562+
563+
export type BodyParameters = any;
564+
565+
export type Responses = any;
566+
}
567+
568+
namespace AuthControllerSigninByPassword {
569+
export type QueryParameters = any;
570+
571+
export type BodyParameters = any;
572+
573+
export type Responses = any;
574+
}
575+
576+
namespace AuthControllerSigninBySmsCode {
577+
export type QueryParameters = any;
578+
579+
export type BodyParameters = any;
580+
581+
export type Responses = any;
582+
}
583+
584+
namespace AuthControllerSendSmsCode {
585+
export type QueryParameters = any;
586+
587+
export type BodyParameters = any;
588+
589+
export type Responses = any;
590+
}
591+
592+
namespace AuthControllerResetPassword {
593+
export type QueryParameters = any;
594+
595+
export type BodyParameters = any;
596+
597+
export type Responses = any;
598+
}
599+
600+
namespace AuthControllerGetProviders {
601+
export type QueryParameters = any;
602+
603+
export type BodyParameters = any;
604+
605+
export type Responses = any;
606+
}
559607
}

web/src/apis/v1/auth.ts

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
// @ts-ignore
2+
/* eslint-disable */
3+
///////////////////////////////////////////////////////////////////////
4+
// //
5+
// this file is autogenerated by service-generate //
6+
// do not edit this file manually //
7+
// //
8+
///////////////////////////////////////////////////////////////////////
9+
/// <reference path = "api-auto.d.ts" />
10+
import request from "@/utils/request";
11+
12+
/**
13+
* Sign up
14+
*/
15+
export async function AuthControllerSignup(
16+
params: Paths.AuthControllerSignup.BodyParameters | any,
17+
): Promise<Paths.AuthControllerSignup.Responses> {
18+
return request(`/v1/auth/passwd/signup`, {
19+
method: "POST",
20+
data: params,
21+
});
22+
}
23+
24+
/**
25+
* Sign in by password
26+
*/
27+
export async function AuthControllerSigninByPassword(
28+
params: Paths.AuthControllerSigninByPassword.BodyParameters | any,
29+
): Promise<Paths.AuthControllerSigninByPassword.Responses> {
30+
return request(`/v1/auth/passwd/signin`, {
31+
method: "POST",
32+
data: params,
33+
});
34+
}
35+
36+
/**
37+
* Sign in by sms code
38+
* @param {string} phone
39+
* @param {string} code
40+
*/
41+
export async function AuthControllerSigninBySmsCode(
42+
params: Paths.AuthControllerSigninBySmsCode.BodyParameters | any,
43+
): Promise<Paths.AuthControllerSigninBySmsCode.Responses> {
44+
return request(`/v1/auth/phone/signin`, {
45+
method: "POST",
46+
data: params,
47+
});
48+
}
49+
50+
/**
51+
* Send sms code
52+
* @param {string} phone
53+
* @param {string} type
54+
*/
55+
export async function AuthControllerSendSmsCode(
56+
params: Paths.AuthControllerSendSmsCode.BodyParameters | any,
57+
): Promise<Paths.AuthControllerSendSmsCode.Responses> {
58+
return request(`/v1/auth/phone/sms/code`, {
59+
method: "POST",
60+
data: params,
61+
});
62+
}
63+
64+
/**
65+
* reset password
66+
* @param {string} phone
67+
* @param {string} code
68+
* @param {string} password
69+
* @param {string} confirmPassword
70+
* @param {string} type
71+
*/
72+
export async function AuthControllerResetPassword(
73+
params: Paths.AuthControllerResetPassword.BodyParameters | any,
74+
): Promise<Paths.AuthControllerResetPassword.Responses> {
75+
return request(`/v1/auth/passwd/reset`, {
76+
method: "POST",
77+
data: params,
78+
});
79+
}
80+
81+
/**
82+
* get providers
83+
*/
84+
export async function AuthControllerGetProviders(
85+
params: Paths.AuthControllerGetProviders.BodyParameters | any,
86+
): Promise<Paths.AuthControllerGetProviders.Responses> {
87+
return request(`/v1/auth/providers`, {
88+
method: "GET",
89+
params: params,
90+
});
91+
}

0 commit comments

Comments
 (0)