From 4b0a798f81ea4ad201421ae02fa896d55a20beb0 Mon Sep 17 00:00:00 2001
From: zhongrj <646384940@qq.com>
Date: Tue, 07 May 2024 13:56:20 +0800
Subject: [PATCH] 新增表单登录接口

---
 src/api/user.js |   29 ++++++++++++++++++++---------
 1 files changed, 20 insertions(+), 9 deletions(-)

diff --git a/src/api/user.js b/src/api/user.js
index 0b31017..c15a73c 100644
--- a/src/api/user.js
+++ b/src/api/user.js
@@ -2,7 +2,7 @@
 import website from "@/config/website";
 
 export const loginByUsername = (tenantId, deptId, roleId, username, password, type, key, code) => request({
-  url: '/api/blade-auth/oauth/token',
+  url: '/api/oauth/token',
   method: 'post',
   headers: {
     'Tenant-Id': tenantId,
@@ -17,14 +17,25 @@
     password,
     grant_type:"password",
     scope: "all",
-    type,
-    // 查全部-暂定
-    loginType:1
+    type
+  }
+});
+
+export const loginForm = (tenant_id,  username, password) => request({
+  url: '/api/oauth/form',
+  method: 'post',
+  headers:{
+    'Content-Type':"application/x-www-form-urlencoded"
+  },
+  params: {
+    tenant_id,
+    username,
+    password
   }
 });
 
 export const loginBySocial = (tenantId, source, code, state) => request({
-  url: '/api/blade-auth/oauth/token',
+  url: '/api/oauth/token',
   method: 'post',
   headers: {
     'Tenant-Id': tenantId
@@ -40,7 +51,7 @@
 })
 
 export const loginBySso = (state, code) => request({
-  url: '/api/blade-auth/oauth/token',
+  url: '/api/oauth/token',
   method: 'post',
   headers: {
     'Tenant-Id': state
@@ -55,7 +66,7 @@
 })
 
 export const refreshToken = (refresh_token, tenantId, deptId, roleId) => request({
-  url: '/api/blade-auth/oauth/token',
+  url: '/api/oauth/token',
   method: 'post',
   headers: {
     'Tenant-Id': tenantId,
@@ -71,7 +82,7 @@
 });
 
 export const registerGuest = (form, oauthId) => request({
-  url: '/api/blade-system/user/register-guest',
+  url: '/api//user/register-guest',
   method: 'post',
   params: {
     tenantId: form.tenantId,
@@ -83,7 +94,7 @@
 });
 
 export const getButtons = () => request({
-  url: '/api/blade-system/menu/buttons',
+  url: '/api//menu/buttons',
   method: 'get'
 });
 

--
Gitblit v1.9.3