feat: 微信公众号扫码登陆完成

This commit is contained in:
landaiqing
2024-06-27 23:54:12 +08:00
parent 3628e95674
commit b1f78bb399
11 changed files with 343 additions and 77 deletions

View File

@@ -2,22 +2,13 @@
import web from "@/utils/axios/web.ts";
/**
* 获取所有Minio信息
*/
export const getAllMinioInfo = () => {
return web.request({
url: "/oss/minio/getAllMinioInfo",
method: "get",
});
};
/**
* 第三方登录
* @param type
*/
export const oauthLogin = (type: string) => {
return web.request({
url: "/oauth/render/" + type,
url: "/auth/oauth/render/" + type,
method: "get",
});
};
@@ -28,7 +19,7 @@ export const oauthLogin = (type: string) => {
*/
export const getSms = (data: any) => {
return web.request({
url: "/sms/sendByTemplate/",
url: "/auth/sms/sendByTemplate/",
method: "post",
headers: {
"Content-Type": "application/json;charset=UTF-8",
@@ -43,7 +34,7 @@ export const getSms = (data: any) => {
*/
export const register = (data: API.PhoneRegisterRequest) => {
return web.request({
url: "/auth/user/register",
url: "/auth/auth/user/register",
method: "post",
data: data,
});
@@ -55,7 +46,7 @@ export const register = (data: API.PhoneRegisterRequest) => {
*/
export const login = (data: API.LoginRequest) => {
return web.request({
url: "/auth/user/login",
url: "/auth/auth/user/login",
method: "post",
data: data,
});
@@ -67,7 +58,7 @@ export const login = (data: API.LoginRequest) => {
*/
export const loginByPhone = (data: API.LoginByPhoneRequest) => {
return web.request({
url: "/auth/user/loginByPhone",
url: "/auth/auth/user/loginByPhone",
method: "post",
data: data,
});
@@ -78,8 +69,56 @@ export const loginByPhone = (data: API.LoginByPhoneRequest) => {
*/
export const findPassword = (data: API.findPasswordRequest) => {
return web.request({
url: "/auth/user/findPassword",
url: "/auth/auth/user/findPassword",
method: "post",
data: data,
});
};
/**
* 生成客户端id
*/
export const createClientId = () => {
return web.request({
url: "/auth/auth/user/createClientId",
method: "get",
});
};
/**
* 获取客户端id
* @param clientId
*/
export const getClientId = (clientId: string) => {
return web.request({
url: "/auth/auth/user/getClientId",
method: "post",
data: {
clientId: clientId,
},
});
};
/**
* 获取客户端token
* @param clientId
*/
export const getClientToken = (clientId: string) => {
return web.request({
url: "/auth/auth/user/getClientToken",
method: "post",
params: {
clientId: clientId,
},
});
};
/**
* 生成微信登录二维码
* @param clientId
*/
export const generateQRCode = (clientId: string) => {
return web.request({
url: "/wechat/wx/generateQRCode",
method: "get",
params: {
clientId: clientId,
},
});
};