From f63a76f661e852d3b2f6cb3c5ee02d07c49e9fa9 Mon Sep 17 00:00:00 2001
From: abbfun <819589789@qq.com>
Date: Sat, 23 Apr 2022 22:36:48 +0800
Subject: [PATCH] spring-cloud.version 2021.0.1 官方推荐对应 spring-cloud-alibaba 2021.0.1.0 spring-cloud.version 2021.0.1 对应 spring-cloud-alibaba 2021.0.1.0, 官方说明 https://github.com/alibaba/spring-cloud-alibaba/wiki/%E7%89%88%E6%9C%AC%E8%AF%B4%E6%98%8E#%E6%AF%95%E4%B8%9A%E7%89%88%E6%9C%AC%E4%BE%9D%E8%B5%96%E5%85%B3%E7%B3%BB%E6%8E%A8%E8%8D%90%E4%BD%BF%E7%94%A8

---
 ruoyi-ui/src/api/login.js |   40 ++++++++++++++++++++++++++--------------
 1 files changed, 26 insertions(+), 14 deletions(-)

diff --git a/ruoyi-ui/src/api/login.js b/ruoyi-ui/src/api/login.js
index f72fe46..6b0cda0 100644
--- a/ruoyi-ui/src/api/login.js
+++ b/ruoyi-ui/src/api/login.js
@@ -1,26 +1,34 @@
 import request from '@/utils/request'
 
-const client_id = 'web'
-const client_secret = '123456'
-const scope = 'server'
-
 // 登录方法
 export function login(username, password, code, uuid) {
-  const grant_type = 'password'
   return request({
-    url: '/auth/oauth/token',
+    url: '/auth/login',
+    headers: {
+      isToken: false
+    },
     method: 'post',
-    params: { username, password, code, uuid, client_id, client_secret, grant_type, scope }
+    data: { username, password, code, uuid }
+  })
+}
+
+// 注册方法
+export function register(data) {
+  return request({
+    url: '/auth/register',
+    headers: {
+      isToken: false
+    },
+    method: 'post',
+    data: data
   })
 }
 
 // 刷新方法
-export function refreshToken(refresh_token) {
-  const grant_type = 'refresh_token'
+export function refreshToken() {
   return request({
-    url: '/auth/oauth/token',
-    method: 'post',
-    params: { client_id, client_secret, grant_type, scope, refresh_token }
+    url: '/auth/refresh',
+    method: 'post'
   })
 }
 
@@ -35,7 +43,7 @@
 // 退出方法
 export function logout() {
   return request({
-    url: '/auth/token/logout',
+    url: '/auth/logout',
     method: 'delete'
   })
 }
@@ -44,6 +52,10 @@
 export function getCodeImg() {
   return request({
     url: '/code',
-    method: 'get'
+    headers: {
+      isToken: false
+    },
+    method: 'get',
+    timeout: 20000
   })
 }
\ No newline at end of file

--
Gitblit v1.9.3