-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🎈 Merge pull request #176 from ileostar/ui/update-homepage
💄 update background
- Loading branch information
Showing
54 changed files
with
14,920 additions
and
6,790 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,69 +1,29 @@ | ||
import { AxiosResponse } from "axios"; | ||
import http from "@/utils/http"; | ||
|
||
import { request } from "../utils/request"; | ||
import { ResponseData } from "./types/common"; | ||
import { | ||
bindEmailBody, | ||
sendCodeByEmailBody, | ||
updateEmailBody, | ||
verifyEmailBody, | ||
} from "./types/email"; | ||
|
||
interface CustomAxiosResponse<T = any> extends AxiosResponse<T> { | ||
token?: any; | ||
code?: any; | ||
msg?: any; | ||
/** 发送邮箱验证码 */ | ||
export function sendCodeByEmail(body: sendCodeByEmailBody) { | ||
return http.post<ResponseData<null>>("/mail/sendCode", body); | ||
} | ||
|
||
//发送邮箱验证码 | ||
export function sendCodeByEmail(email: string): Promise<CustomAxiosResponse> { | ||
return request({ | ||
url: "/mail/sendCode", | ||
params: { | ||
email: email, | ||
}, | ||
method: "get", | ||
}); | ||
/** 更换邮箱 */ | ||
export function updateEmail(body: updateEmailBody) { | ||
return http.put<ResponseData<null>>("/mail", body); | ||
} | ||
|
||
//更换邮箱 | ||
export function updateEmail( | ||
userId: string, | ||
email: string, | ||
otp: string, | ||
): Promise<CustomAxiosResponse> { | ||
return request({ | ||
url: "/mail", | ||
data: { | ||
email, | ||
userId, | ||
otp, | ||
}, | ||
method: "put", | ||
}); | ||
/** 绑定邮箱 */ | ||
export function bindEmail(body: bindEmailBody) { | ||
return http.post<ResponseData<null>>("/mail/bind", body); | ||
} | ||
|
||
//绑定邮箱 | ||
export function bindEmail( | ||
userId: string, | ||
email: string, | ||
otp: string, | ||
): Promise<CustomAxiosResponse> { | ||
return request({ | ||
url: "/mail/bind", | ||
data: { | ||
email, | ||
userId, | ||
otp, | ||
}, | ||
method: "post", | ||
}); | ||
} | ||
|
||
//验证邮箱 | ||
export function verifyEmail( | ||
email: string, | ||
otp: string, | ||
): Promise<CustomAxiosResponse> { | ||
return request({ | ||
url: "/mail/verify", | ||
data: { | ||
email, | ||
otp | ||
}, | ||
method: "post", | ||
}); | ||
/** 验证邮箱 */ | ||
export function verifyEmail(body: verifyEmailBody) { | ||
return http.post<ResponseData<null>>("/mail/verify", body); | ||
} |
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,48 +1,19 @@ | ||
import { AxiosResponse } from "axios"; | ||
import { request } from "../utils/request"; | ||
import http from "@/utils/http"; | ||
|
||
interface CustomAxiosResponse<T = any> extends AxiosResponse<T> { | ||
code?: any; | ||
msg?: any; | ||
} | ||
import { ResponseData } from "./types/common"; | ||
import { sendBySMSBody, updatePhoneBody, verifyPhoneBody } from "./types/sms"; | ||
|
||
/** | ||
* sms发送短信 | ||
*/ | ||
export function sendBySMS(phone: any) { | ||
return request({ | ||
url: "/sms/sendCode", | ||
data: { | ||
phone: phone, | ||
}, | ||
method: "post", | ||
}); | ||
} | ||
/** 发送短信 */ | ||
export function sendBySMS(body: sendBySMSBody) { | ||
return http.post<ResponseData<null>>("/sms/sendCode", body); | ||
} | ||
|
||
/** | ||
* 手机号验证 | ||
*/ | ||
export function verifyPhone(phone: any,otp:any): Promise<CustomAxiosResponse> { | ||
return request({ | ||
url: "/sms/verify", | ||
data: { | ||
phone: phone, | ||
otp:otp | ||
}, | ||
method: "post", | ||
}); | ||
} | ||
/** 手机号验证 */ | ||
export function verifyPhone(body: verifyPhoneBody) { | ||
return http.post<ResponseData<null>>("/sms/verify", body); | ||
} | ||
|
||
/** | ||
* 更换手机号 | ||
*/ | ||
export function updatePhone(phone: any,otp:any): Promise<CustomAxiosResponse> { | ||
return request({ | ||
url: "/sms", | ||
data: { | ||
phone: phone, | ||
otp:otp | ||
}, | ||
method: "put", | ||
}); | ||
} | ||
/** 更换手机号 */ | ||
export function updatePhone(body: updatePhoneBody) { | ||
return http.put<ResponseData<null>>("/sms", body); | ||
} |
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,37 @@ | ||
import { ResponseData } from "./common"; | ||
|
||
export type defaultSignInBody = { | ||
identifier: string; | ||
password: string; | ||
}; | ||
|
||
export type defaultSignInResponse = { | ||
userId: string; | ||
userName: string; | ||
phone: string; | ||
role: string; | ||
email: string | null; | ||
}; | ||
|
||
export type loginBySMSBody = { | ||
phone: string; | ||
otp: string; | ||
}; | ||
|
||
export type loginBySMSResponse = defaultSignInResponse; | ||
|
||
export type defaultSignUpBody = { | ||
username: string; | ||
password: string | null; | ||
phone: string; | ||
otp: string; | ||
}; | ||
|
||
export interface GithubSignInResponse | ||
extends ResponseData<{ | ||
isSignUp: boolean; | ||
userData: { | ||
username: string; | ||
[index: string]: unknown; | ||
}; | ||
}> {} |
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,8 @@ | ||
import { AxiosResponse } from "axios"; | ||
|
||
export interface ResponseData<T> { | ||
code: number; | ||
msg: string; | ||
data: T; | ||
token?: string; | ||
} |
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,16 @@ | ||
export type sendCodeByEmailBody = { | ||
email: string; | ||
}; | ||
|
||
export type updateEmailBody = { | ||
userId: string; | ||
email: string; | ||
otp: string; | ||
}; | ||
|
||
export type bindEmailBody = updateEmailBody; | ||
|
||
export type verifyEmailBody = { | ||
email: string; | ||
otp: string; | ||
}; |
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,10 @@ | ||
export type sendBySMSBody = { | ||
phone: string; | ||
}; | ||
|
||
export type verifyPhoneBody = { | ||
phone: string; | ||
otp: string; | ||
}; | ||
|
||
export type updatePhoneBody = verifyPhoneBody; |
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,7 @@ | ||
export type uploadFileBody = { | ||
file: string; | ||
}; | ||
|
||
export type uploadFileResponse = { | ||
url: string; | ||
}; |
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,16 @@ | ||
export type getUserInfoResponse = { | ||
avatar: string | null; | ||
nickname: string | null; | ||
username: string | null; | ||
email: string | null; | ||
phone: string; | ||
role: string; | ||
}; | ||
|
||
export type updateUserInfoBody = { | ||
avatar?: string | undefined; | ||
nickname?: string | undefined; | ||
username?: string | undefined; | ||
}; | ||
|
||
export type updateUserInfoResponse = updateUserInfoBody & { userId: string }; |
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 @@ | ||
import http from "@/utils/http"; | ||
|
||
import { ResponseData } from "./types/common"; | ||
import { uploadFileResponse } from "./types/upload"; | ||
|
||
/** 发送短信 */ | ||
export function uploadFile(body: any, headers?: any) { | ||
return http.post<ResponseData<uploadFileResponse>>("/oss/upload", body, headers); | ||
} |
Oops, something went wrong.