From 20476e9dd17bbfbcd0ea0cdff61f6b341a7d338f Mon Sep 17 00:00:00 2001
From: RuoYi <yzz_ivy@163.com>
Date: Sun, 26 Jun 2022 13:15:28 +0800
Subject: [PATCH] 默认不启用压缩文件缓存防止node_modules过大
---
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