From 391eec3114a17e68652434c6eae610799d80290e Mon Sep 17 00:00:00 2001 From: ludc <ludc@vci-tech.com> Date: 星期四, 16 一月 2025 11:13:43 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- Source/plt-web/plt-web-ui/src/api/user.js | 146 ++++++++++++++++-------------------------------- 1 files changed, 49 insertions(+), 97 deletions(-) diff --git a/Source/plt-web/plt-web-ui/src/api/user.js b/Source/plt-web/plt-web-ui/src/api/user.js index b3d90d9..279286c 100644 --- a/Source/plt-web/plt-web-ui/src/api/user.js +++ b/Source/plt-web/plt-web-ui/src/api/user.js @@ -1,19 +1,17 @@ import request from '@/router/axios'; import website from "@/config/website"; -export const loginByUsername = (tenantId, deptId, roleId, username, password, type, key) => request({ +export const loginByUsername = (deptId, roleId, userId, password, type, key) => request({ url: '/api/framework/loginController/login', method: 'post', headers: { - 'Tenant-Id': tenantId, 'Dept-Id': (website.switchMode ? deptId : ''), 'Role-Id': (website.switchMode ? roleId : ''), 'Captcha-Key': key, }, params: { - tenantId, - username, + userId, password, grant_type: (website.captchaMode ? "captcha" : "password"), scope: "all", @@ -21,100 +19,54 @@ } }); -export const loginBySocial = (tenantId, source, state) => request({ - url: '/api/blade-auth/oauth/token', - method: 'post', - headers: { - 'Tenant-Id': tenantId - }, - params: { - tenantId, - source, - state, - grant_type: "social", - scope: "all", - } -}) - -export const loginBySso = (state) => request({ - url: '/api/blade-auth/oauth/token', - method: 'post', - headers: { - 'Tenant-Id': state - }, - params: { - tenantId: state, - grant_type: "authorization_code", - scope: "all", - redirect_uri: website.redirectUri, - } -}) - -export const refreshToken = (refresh_token, tenantId, deptId, roleId) => request({ - url: '/api/blade-auth/oauth/token', - method: 'post', - headers: { - 'Tenant-Id': tenantId, - 'Dept-Id': (website.switchMode ? deptId : ''), - 'Role-Id': (website.switchMode ? roleId : '') - }, - params: { - tenantId, - refresh_token, - grant_type: "refresh_token", - scope: "all", - } -}); - -export const registerGuest = (form, oauthId) => request({ - url: '/api/blade-user/register-guest', - method: 'post', - params: { - tenantId: form.tenantId, - name: form.name, - account: form.account, - password: form.password, - oauthId - } -}); - -export const getButtons = () => request({ - url: '/api/blade-system/menu/buttons', - method: 'get' -}); - -export const getCaptcha = () => request({ - url: '/api/blade-auth/oauth/captcha', - method: 'get', - authorization: false -}); - -export const logout = () => request({ - url: '/api/blade-auth/oauth/logout', - method: 'get', - authorization: false -}); - export const getUserInfo = () => request({ - url: '/api/blade-auth/oauth/user-info', - method: 'get' + url: '/api/framework/loginController/getSessionInfo', + method: 'post' }); -export const sendLogs = (list) => request({ - url: '/api/blade-auth/oauth/logout', - method: 'post', - data: list -}); +// 淇敼瀵嗙爜 +export function changePassword(params) { + let formData = new FormData; + for (let key in params) { + formData.append(key, params[key]) + } + return request({ + url: "/api/userQueryController/changePassword", + method: "post", + data: formData + }); +} -export const clearCache = () => request({ - url: '/api/blade-auth/oauth/clear-cache', - method: 'get', - authorization: false -}); - -export const selcetList = () => request({ - url: '/api/blade-system/tenant/tenant-map', - method: 'get', -}); - - +// 閫�鍑虹櫥褰� +export function logout(params) { + return request({ + url: "/api/framework/loginController/logout", + method: "post", + params + }); +} +// 鎸夐挳鏉冮檺鎺ュ彛 +export function getButtons(params) { + return request({ + url: "/api/smFunctionController/getAllButtons", + method: "get", + params + }); +} +// 鑾峰彇澶村儚 +export function getUserPhoto(params) { + return request({ + url: "/api/userQueryController/getUserPhoto", + method: "get", + responseType:'blob', + params + }); +} +// 涓婁紶澶村儚 +export function updateUserPhoto(formData) { + return request({ + url: "/api/userQueryController/updateUserPhoto", + method: "post", + data:formData + }); +} -- Gitblit v1.9.3