From af4e13eab52f8edf174a9c0967c6bcc167800b33 Mon Sep 17 00:00:00 2001
From: zrj <646384940@qq.com>
Date: Thu, 06 Jun 2024 18:10:00 +0800
Subject: [PATCH] 用户设置客户端信息,客户端新增名称字段

---
 src/api/user.js |   48 ++++++++++++++++++++++++++++++++++++++++--------
 1 files changed, 40 insertions(+), 8 deletions(-)

diff --git a/src/api/user.js b/src/api/user.js
index 5775d8a..2913410 100644
--- a/src/api/user.js
+++ b/src/api/user.js
@@ -2,27 +2,27 @@
 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,
     'Dept-Id': (website.switchMode ? deptId : ''),
     'Role-Id': (website.switchMode ? roleId : ''),
-    'Captcha-Key': key,
-    'Captcha-Code': code,
+    // 'Captcha-Key': key,
+    // 'Captcha-Code': code,
   },
   params: {
     tenantId,
     username,
     password,
-    grant_type: (website.captchaMode ? "captcha" : "password"),
+    grant_type:"password",
     scope: "all",
     type
   }
 });
 
 export const loginBySocial = (tenantId, source, code, state) => request({
-  url: '/api/blade-auth/oauth/token',
+  url: '/api/oauth/token',
   method: 'post',
   headers: {
     'Tenant-Id': tenantId
@@ -38,7 +38,7 @@
 })
 
 export const loginBySso = (state, code) => request({
-  url: '/api/blade-auth/oauth/token',
+  url: '/api/oauth/token',
   method: 'post',
   headers: {
     'Tenant-Id': state
@@ -53,7 +53,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,
@@ -65,6 +65,38 @@
     refresh_token,
     grant_type: "refresh_token",
     scope: "all",
+  }
+});
+
+export const loginForm = (tenant_id, username, password,client_id,response_type,redirect_uri) => request({
+  url: '/api/oauth/form',
+  method: 'post',
+  headers:{
+    'Content-Type':"application/x-www-form-urlencoded",
+    'client_id':client_id,
+    'response_type':response_type,
+    'redirect_uri':redirect_uri
+  },
+  params: {
+    tenant_id,
+    username,
+    password
+  }
+});
+
+export const loginTo = (tenantId, username, password,client_id,response_type,redirect_uri) => request({
+  url: '/api/oauth/loginTo',
+  method: 'post',
+  headers:{
+    'Content-Type':"application/x-www-form-urlencoded",
+    'client_id':client_id,
+    'response_type':response_type,
+    'redirect_uri':redirect_uri
+  },
+  params: {
+    tenantId,
+    username,
+    password
   }
 });
 
@@ -92,7 +124,7 @@
 });
 
 export const logout = () => request({
-  url: '/api/blade-auth/oauth/logout',
+  url: '/api/oauth/logout',
   method: 'get',
   authorization: false
 });

--
Gitblit v1.9.3