✨ update api url
This commit is contained in:
@@ -16,6 +16,6 @@ VITE_TITLE_NAME='五味子云相册'
|
||||
VITE_APP_TOKEN_KEY='Bearer'
|
||||
|
||||
# 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'
|
||||
|
@@ -4,7 +4,7 @@ import {service} from "@/utils/alova/service.ts";
|
||||
* 获取旋转验证码图片数据
|
||||
*/
|
||||
export const getRotatedCaptchaData = () => {
|
||||
return service.Get('/api/captcha/rotate/get', {
|
||||
return service.Get('/api/captcha/rotate/generate', {
|
||||
meta: {
|
||||
ignoreToken: true
|
||||
},
|
||||
|
@@ -4,7 +4,7 @@ import {service} from "@/utils/alova/service.ts";
|
||||
* 获取Gitee登录链接
|
||||
*/
|
||||
export const getGiteeUrl = () => {
|
||||
return service.Get('/api/oauth/gitee/get_url',
|
||||
return service.Get('/api/oauth/gitee/url',
|
||||
{
|
||||
meta: {
|
||||
ignoreToken: true,
|
||||
|
@@ -4,7 +4,7 @@ import {service} from "@/utils/alova/service.ts";
|
||||
* Get Github OAuth URL
|
||||
*/
|
||||
export const getGithubUrl = (state: string) => {
|
||||
return service.Get('/api/oauth/github/get_url',
|
||||
return service.Get('/api/oauth/github/url',
|
||||
{
|
||||
params: {
|
||||
state: state
|
||||
|
@@ -4,7 +4,7 @@ import {service} from "@/utils/alova/service.ts";
|
||||
* 生成客户端id
|
||||
*/
|
||||
export const generateClientId = () => {
|
||||
return service.Get('/api/client/generate_client_id',
|
||||
return service.Get('/api/client/generate',
|
||||
{
|
||||
meta: {
|
||||
ignoreToken: true,
|
||||
|
@@ -1,7 +1,7 @@
|
||||
import {service} from "@/utils/alova/service.ts";
|
||||
|
||||
export const getQQUrl = (state: string) => {
|
||||
return service.Get('/api/oauth/qq/get_url',
|
||||
return service.Get('/api/oauth/qq/url',
|
||||
{
|
||||
params: {
|
||||
state: state
|
||||
|
@@ -5,7 +5,7 @@ import {service} from "@/utils/alova/service.ts";
|
||||
* @param clientId
|
||||
*/
|
||||
export const generateQrCode = (clientId: string) => {
|
||||
return service.Get('/api/oauth/wechat/get_temp_qrcode',
|
||||
return service.Get('/api/oauth/wechat/qrcode',
|
||||
{
|
||||
params: {
|
||||
client_id: clientId
|
||||
|
@@ -52,7 +52,7 @@ export const sendMessage = (params: any) => {
|
||||
* @param param
|
||||
*/
|
||||
export const phoneLoginApi = (param: PhoneLogin) => {
|
||||
return service.Post('/api/user/phone_login', {
|
||||
return service.Post('/api/user/phone/login', {
|
||||
phone: param.phone,
|
||||
captcha: param.captcha,
|
||||
auto_login: param.auto_login
|
||||
@@ -90,7 +90,7 @@ export const accountLoginApi = (param: AccountLogin) => {
|
||||
* @param param
|
||||
*/
|
||||
export const resetPasswordApi = (param: ResetPassword) => {
|
||||
return service.Post('/api/user/reset_password', {
|
||||
return service.Post('/api/user/reset/password', {
|
||||
phone: param.phone,
|
||||
captcha: param.captcha,
|
||||
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 = () => {
|
||||
return service.Get('/api/user/get_device',
|
||||
return service.Get('/api/user/device',
|
||||
{
|
||||
params: {},
|
||||
meta: {
|
||||
|
@@ -257,7 +257,7 @@ async function resetPasswordSubmit() {
|
||||
.validate()
|
||||
.then(async () => {
|
||||
const res: any = await resetPasswordApi(ResetPasswordForm);
|
||||
if (res.code === 200 && res.success) {
|
||||
if (res.code === 200 && res.data) {
|
||||
message.success(t('login.resetPasswordSuccess'));
|
||||
await router.push('/login');
|
||||
} else {
|
||||
@@ -295,7 +295,7 @@ async function getRotateCaptcha() {
|
||||
*/
|
||||
async function sendMessageByPhone(param: any): Promise<boolean> {
|
||||
const res: any = await sendMessage(param);
|
||||
if (res.code === 200 && res.success) {
|
||||
if (res.code === 200 && res.data) {
|
||||
message.success(t('login.sendCaptchaSuccess'));
|
||||
return true;
|
||||
} else {
|
||||
|
@@ -378,7 +378,7 @@ async function phoneLoginSubmit() {
|
||||
.then(async () => {
|
||||
loginLoading.value = true;
|
||||
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.access_token = res.data.access_token;
|
||||
userStore.user.username = res.data.username;
|
||||
@@ -460,7 +460,7 @@ async function checkAccountLoginCaptcha(angle: number) {
|
||||
};
|
||||
loginLoading.value = true;
|
||||
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.access_token = res.data.access_token;
|
||||
userStore.user.username = res.data.username;
|
||||
@@ -485,7 +485,7 @@ async function checkAccountLoginCaptcha(angle: number) {
|
||||
*/
|
||||
async function sendMessageByPhone(params: any): Promise<boolean> {
|
||||
const res: any = await sendMessage(params);
|
||||
if (res.code === 200 && res.success) {
|
||||
if (res.code === 200) {
|
||||
message.success(t('login.sendCaptchaSuccess'));
|
||||
return true;
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user