From ffd0af47ee31a9592cfab56a907e9841a9113c52 Mon Sep 17 00:00:00 2001 From: ludc Date: 星期四, 20 七月 2023 10:37:17 +0800 Subject: [PATCH] 代码提交,前端代码打包 --- Source/UBCS-WEB/dist/src/api/user.js | 120 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 120 insertions(+), 0 deletions(-) diff --git a/Source/UBCS-WEB/dist/src/api/user.js b/Source/UBCS-WEB/dist/src/api/user.js new file mode 100644 index 0000000..e597ab6 --- /dev/null +++ b/Source/UBCS-WEB/dist/src/api/user.js @@ -0,0 +1,120 @@ +import request from '@/router/axios'; +import website from "@/config/website"; + +export const loginByUsername = (tenantId, deptId, roleId, username, password, type, key) => request({ + url: '/api/ubcs-auth/oauth/token', + method: 'post', + headers: { + 'Tenant-Id': tenantId, + 'Dept-Id': (website.switchMode ? deptId : ''), + 'Role-Id': (website.switchMode ? roleId : ''), + 'Captcha-Key': key, + + }, + params: { + tenantId, + username, + password, + grant_type: (website.captchaMode ? "captcha" : "password"), + scope: "all", + type + } +}); + +export const loginBySocial = (tenantId, source, state) => request({ + url: '/api/ubcs-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/ubcs-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/ubcs-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/ubcs-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/ubcs-system/menu/buttons', + method: 'get' +}); + +export const getCaptcha = () => request({ + url: '/api/ubcs-auth/oauth/captcha', + method: 'get', + authorization: false +}); + +export const logout = () => request({ + url: '/api/ubcs-auth/oauth/logout', + method: 'get', + authorization: false +}); + +export const getUserInfo = () => request({ + url: '/api/ubcs-auth/oauth/user-info', + method: 'get' +}); + +export const sendLogs = (list) => request({ + url: '/api/ubcs-auth/oauth/logout', + method: 'post', + data: list +}); + +export const clearCache = () => request({ + url: '/api/ubcs-auth/oauth/clear-cache', + method: 'get', + authorization: false +}); + +export const selcetList = () => request({ + url: '/api/ubcs-system/tenant/tenant-map', + method: 'get', +}); + + -- Gitblit v1.9.3