update api url

This commit is contained in:
landaiqing
2024-11-15 02:05:52 +08:00
parent 33d76461f1
commit 23331318de
10 changed files with 16 additions and 31 deletions

View File

@@ -16,6 +16,6 @@ VITE_TITLE_NAME='五味子云相册'
VITE_APP_TOKEN_KEY='Bearer' VITE_APP_TOKEN_KEY='Bearer'
# the websocket url # the websocket url
VITE_QR_SOCKET_URL='ws://127.0.0.1:80/api/ws/qr_ws' VITE_QR_SOCKET_URL='ws://127.0.0.1:80/api/ws/qrcode'
VITE_MESSAGE_SOCKET_URL='ws://127.0.0.1:80/api/ws/message_ws' VITE_MESSAGE_SOCKET_URL='ws://127.0.0.1:80/api/ws/message'

View File

@@ -4,7 +4,7 @@ import {service} from "@/utils/alova/service.ts";
* 获取旋转验证码图片数据 * 获取旋转验证码图片数据
*/ */
export const getRotatedCaptchaData = () => { export const getRotatedCaptchaData = () => {
return service.Get('/api/captcha/rotate/get', { return service.Get('/api/captcha/rotate/generate', {
meta: { meta: {
ignoreToken: true ignoreToken: true
}, },

View File

@@ -4,7 +4,7 @@ import {service} from "@/utils/alova/service.ts";
* 获取Gitee登录链接 * 获取Gitee登录链接
*/ */
export const getGiteeUrl = () => { export const getGiteeUrl = () => {
return service.Get('/api/oauth/gitee/get_url', return service.Get('/api/oauth/gitee/url',
{ {
meta: { meta: {
ignoreToken: true, ignoreToken: true,

View File

@@ -4,7 +4,7 @@ import {service} from "@/utils/alova/service.ts";
* Get Github OAuth URL * Get Github OAuth URL
*/ */
export const getGithubUrl = (state: string) => { export const getGithubUrl = (state: string) => {
return service.Get('/api/oauth/github/get_url', return service.Get('/api/oauth/github/url',
{ {
params: { params: {
state: state state: state

View File

@@ -4,7 +4,7 @@ import {service} from "@/utils/alova/service.ts";
* 生成客户端id * 生成客户端id
*/ */
export const generateClientId = () => { export const generateClientId = () => {
return service.Get('/api/client/generate_client_id', return service.Get('/api/client/generate',
{ {
meta: { meta: {
ignoreToken: true, ignoreToken: true,

View File

@@ -1,7 +1,7 @@
import {service} from "@/utils/alova/service.ts"; import {service} from "@/utils/alova/service.ts";
export const getQQUrl = (state: string) => { export const getQQUrl = (state: string) => {
return service.Get('/api/oauth/qq/get_url', return service.Get('/api/oauth/qq/url',
{ {
params: { params: {
state: state state: state

View File

@@ -5,7 +5,7 @@ import {service} from "@/utils/alova/service.ts";
* @param clientId * @param clientId
*/ */
export const generateQrCode = (clientId: string) => { export const generateQrCode = (clientId: string) => {
return service.Get('/api/oauth/wechat/get_temp_qrcode', return service.Get('/api/oauth/wechat/qrcode',
{ {
params: { params: {
client_id: clientId client_id: clientId

View File

@@ -52,7 +52,7 @@ export const sendMessage = (params: any) => {
* @param param * @param param
*/ */
export const phoneLoginApi = (param: PhoneLogin) => { export const phoneLoginApi = (param: PhoneLogin) => {
return service.Post('/api/user/phone_login', { return service.Post('/api/user/phone/login', {
phone: param.phone, phone: param.phone,
captcha: param.captcha, captcha: param.captcha,
auto_login: param.auto_login auto_login: param.auto_login
@@ -90,7 +90,7 @@ export const accountLoginApi = (param: AccountLogin) => {
* @param param * @param param
*/ */
export const resetPasswordApi = (param: ResetPassword) => { export const resetPasswordApi = (param: ResetPassword) => {
return service.Post('/api/user/reset_password', { return service.Post('/api/user/reset/password', {
phone: param.phone, phone: param.phone,
captcha: param.captcha, captcha: param.captcha,
password: param.password, password: param.password,
@@ -103,28 +103,13 @@ export const resetPasswordApi = (param: ResetPassword) => {
} }
); );
}; };
/**
* 获取用户权限
* @param user_id
*/
export const getUserPermissions = (user_id: string) => {
return service.Post('/api/auth/permission/get_user_permissions', {
user_id: user_id
},
{
meta: {
ignoreToken: false,
}
}
);
};
/** /**
* 获取用户设备信息 * 获取用户设备信息
*/ */
export const getUserDevice = () => { export const getUserDevice = () => {
return service.Get('/api/user/get_device', return service.Get('/api/user/device',
{ {
params: {}, params: {},
meta: { meta: {

View File

@@ -257,7 +257,7 @@ async function resetPasswordSubmit() {
.validate() .validate()
.then(async () => { .then(async () => {
const res: any = await resetPasswordApi(ResetPasswordForm); const res: any = await resetPasswordApi(ResetPasswordForm);
if (res.code === 200 && res.success) { if (res.code === 200 && res.data) {
message.success(t('login.resetPasswordSuccess')); message.success(t('login.resetPasswordSuccess'));
await router.push('/login'); await router.push('/login');
} else { } else {
@@ -295,7 +295,7 @@ async function getRotateCaptcha() {
*/ */
async function sendMessageByPhone(param: any): Promise<boolean> { async function sendMessageByPhone(param: any): Promise<boolean> {
const res: any = await sendMessage(param); const res: any = await sendMessage(param);
if (res.code === 200 && res.success) { if (res.code === 200 && res.data) {
message.success(t('login.sendCaptchaSuccess')); message.success(t('login.sendCaptchaSuccess'));
return true; return true;
} else { } else {

View File

@@ -378,7 +378,7 @@ async function phoneLoginSubmit() {
.then(async () => { .then(async () => {
loginLoading.value = true; loginLoading.value = true;
const res: any = await phoneLoginApi(phoneLoginForm); const res: any = await phoneLoginApi(phoneLoginForm);
if (res.code === 200 && res.success) { if (res.code === 200 && res.data) {
userStore.user.uid = res.data.uid; userStore.user.uid = res.data.uid;
userStore.user.access_token = res.data.access_token; userStore.user.access_token = res.data.access_token;
userStore.user.username = res.data.username; userStore.user.username = res.data.username;
@@ -460,7 +460,7 @@ async function checkAccountLoginCaptcha(angle: number) {
}; };
loginLoading.value = true; loginLoading.value = true;
const res: any = await accountLoginApi(params); const res: any = await accountLoginApi(params);
if (res.code === 200 && res.success) { if (res.code === 200 && res.data) {
userStore.user.uid = res.data.uid; userStore.user.uid = res.data.uid;
userStore.user.access_token = res.data.access_token; userStore.user.access_token = res.data.access_token;
userStore.user.username = res.data.username; userStore.user.username = res.data.username;
@@ -485,7 +485,7 @@ async function checkAccountLoginCaptcha(angle: number) {
*/ */
async function sendMessageByPhone(params: any): Promise<boolean> { async function sendMessageByPhone(params: any): Promise<boolean> {
const res: any = await sendMessage(params); const res: any = await sendMessage(params);
if (res.code === 200 && res.success) { if (res.code === 200) {
message.success(t('login.sendCaptchaSuccess')); message.success(t('login.sendCaptchaSuccess'));
return true; return true;
} else { } else {