From 3fb8f1c2516f8e56ec9406426ccb4764c6c50968 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=96=AF=E7=8B=82=E7=9A=84=E7=8B=AE=E5=AD=90Li?= <15040126243@163.com> Date: Sun, 2 Jul 2023 07:32:58 +0000 Subject: [PATCH] =?UTF-8?q?=E5=9B=9E=E9=80=80=20'Pull=20Request=20!20=20:?= =?UTF-8?q?=20=E7=BB=9F=E4=B8=80=E7=99=BB=E5=BD=95=E6=8E=88=E6=9D=83'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.development | 4 +- .env.production | 4 +- .gitignore | 1 - src/api/login.ts | 25 +- src/api/system/client/index.ts | 80 ---- src/api/system/client/types.ts | 138 ------- src/api/system/social/auth.ts | 24 -- src/api/types.ts | 13 +- src/assets/icons/svg/gitee.svg | 1 - src/layout/components/SocialLogin/index.vue | 82 ----- src/permission.ts | 2 +- src/router/index.ts | 6 - src/store/modules/user.ts | 4 +- src/types/env.d.ts | 2 +- src/utils/auth.ts | 2 +- src/views/index.vue | 2 +- src/views/login.vue | 194 ++++------ .../monitor/{powerjob => xxljob}/index.vue | 2 +- src/views/system/client/index.vue | 344 ------------------ src/views/system/menu/index.vue | 2 +- src/views/system/user/profile/index.vue | 16 +- src/views/system/user/profile/thirdParty.vue | 140 ------- 22 files changed, 96 insertions(+), 992 deletions(-) delete mode 100644 src/api/system/client/index.ts delete mode 100644 src/api/system/client/types.ts delete mode 100644 src/api/system/social/auth.ts delete mode 100644 src/assets/icons/svg/gitee.svg delete mode 100644 src/layout/components/SocialLogin/index.vue rename src/views/monitor/{powerjob => xxljob}/index.vue (67%) delete mode 100644 src/views/system/client/index.vue delete mode 100644 src/views/system/user/profile/thirdParty.vue diff --git a/.env.development b/.env.development index 6ca0e51..4ec5afb 100644 --- a/.env.development +++ b/.env.development @@ -13,7 +13,7 @@ VITE_APP_CONTEXT_PATH = '/' # 监控地址 VITE_APP_MONITRO_ADMIN = 'http://localhost:9090/admin/applications' -# powerjob 控制台地址 -VITE_APP_POWERJOB_ADMIN = 'http://localhost:7700/' +# xxl-job 控制台地址 +VITE_APP_XXL_JOB_ADMIN = 'http://localhost:9100/xxl-job-admin' VITE_APP_PORT = 80 diff --git a/.env.production b/.env.production index a5e77b3..6e6510a 100644 --- a/.env.production +++ b/.env.production @@ -10,8 +10,8 @@ VITE_APP_CONTEXT_PATH = '/' # 监控地址 VITE_APP_MONITRO_ADMIN = '/admin/applications' -# powerjob 控制台地址 -VITE_APP_POWERJOB_ADMIN = '/powerjob' +# 监控地址 +VITE_APP_XXL_JOB_ADMIN = '/xxl-job-admin' # 生产环境 VITE_APP_BASE_API = '/prod-api' diff --git a/.gitignore b/.gitignore index 40df474..79e7fd9 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,4 @@ .DS_Store -.history node_modules/ dist/ npm-debug.log* diff --git a/src/api/login.ts b/src/api/login.ts index d4ceb49..b95a0c0 100644 --- a/src/api/login.ts +++ b/src/api/login.ts @@ -2,7 +2,6 @@ import request from '@/utils/request'; import { AxiosPromise } from 'axios'; import { LoginData, LoginResult, VerifyCodeResult, TenantInfo } from './types'; import { UserInfo } from '@/api/system/user/types'; -import { da } from 'element-plus/es/locale'; /** * @param data {LoginData} @@ -10,9 +9,11 @@ import { da } from 'element-plus/es/locale'; */ export function login(data: LoginData): AxiosPromise { const params = { - ...data, - clientId: data.clientId || 'e5cd7e4891bf95d1d19206ce24a7b32e', - grantType: data.grantType || 'password' + tenantId: data.tenantId, + username: data.username.trim(), + password: data.password, + code: data.code, + uuid: data.uuid }; return request({ url: '/auth/login', @@ -59,22 +60,6 @@ export function getCodeImg(): AxiosPromise { timeout: 20000 }); } -/** - * 第三方登录 - * @param source 第三方登录类型 - * */ -export function callback(data: LoginData): AxiosPromise { - const LoginData = { - ...data, - clientId: 'e5cd7e4891bf95d1d19206ce24a7b32e', - grantType: 'social' - }; - return request({ - url: '/auth/social/callback', - method: 'post', - data: LoginData - }); -} // 获取用户详细信息 export function getInfo(): AxiosPromise { diff --git a/src/api/system/client/index.ts b/src/api/system/client/index.ts deleted file mode 100644 index 06544da..0000000 --- a/src/api/system/client/index.ts +++ /dev/null @@ -1,80 +0,0 @@ -import request from '@/utils/request'; -import { AxiosPromise } from 'axios'; -import { ClientVO, ClientForm, ClientQuery } from '@/api/system/client/types'; - -/** - * 查询客户端管理列表 - * @param query - * @returns {*} - */ - -export const listClient = (query?: ClientQuery): AxiosPromise => { - return request({ - url: '/system/client/list', - method: 'get', - params: query - }); -}; - -/** - * 查询客户端管理详细 - * @param id - */ -export const getClient = (id: string | number): AxiosPromise => { - return request({ - url: '/system/client/' + id, - method: 'get' - }); -}; - -/** - * 新增客户端管理 - * @param data - */ -export const addClient = (data: ClientForm) => { - return request({ - url: '/system/client', - method: 'post', - data: data - }); -}; - -/** - * 修改客户端管理 - * @param data - */ -export const updateClient = (data: ClientForm) => { - return request({ - url: '/system/client', - method: 'put', - data: data - }); -}; - -/** - * 删除客户端管理 - * @param id - */ -export const delClient = (id: string | number | Array) => { - return request({ - url: '/system/client/' + id, - method: 'delete' - }); -}; - -/** - * 状态修改 - * @param id ID - * @param status 状态 - */ -export function changeStatus(id: number | string, status: string) { - const data = { - id, - status - }; - return request({ - url: '/system/client/changeStatus', - method: 'put', - data: data - }); -} diff --git a/src/api/system/client/types.ts b/src/api/system/client/types.ts deleted file mode 100644 index e67f95f..0000000 --- a/src/api/system/client/types.ts +++ /dev/null @@ -1,138 +0,0 @@ -export interface ClientVO { - /** - * id - */ - id: string | number; - - /** - * 客户端id - */ - clientId: string | number; - - /** - * 客户端key - */ - clientKey: string; - - /** - * 客户端秘钥 - */ - clientSecret: string; - - /** - * 授权类型 - */ - grantTypeList: string[]; - - /** - * 设备类型 - */ - deviceType: string; - - /** - * token活跃超时时间 - */ - activeTimeout: number; - - /** - * token固定超时 - */ - timeout: number; - - /** - * 状态(0正常 1停用) - */ - status: string; - -} - -export interface ClientForm extends BaseEntity { - /** - * id - */ - id?: string | number; - - /** - * 客户端id - */ - clientId?: string | number; - - /** - * 客户端key - */ - clientKey?: string; - - /** - * 客户端秘钥 - */ - clientSecret?: string; - - /** - * 授权类型 - */ - grantTypeList?: string[]; - - /** - * 设备类型 - */ - deviceType?: string; - - /** - * token活跃超时时间 - */ - activeTimeout?: number; - - /** - * token固定超时 - */ - timeout?: number; - - /** - * 状态(0正常 1停用) - */ - status?: string; - -} - -export interface ClientQuery extends PageQuery { - /** - * 客户端id - */ - clientId?: string | number; - - /** - * 客户端key - */ - clientKey?: string; - - /** - * 客户端秘钥 - */ - clientSecret?: string; - - /** - * 授权类型 - */ - grantType?: string; - - /** - * 设备类型 - */ - deviceType?: string; - - /** - * token活跃超时时间 - */ - activeTimeout?: number; - - /** - * token固定超时 - */ - timeout?: number; - - /** - * 状态(0正常 1停用) - */ - status?: string; - -} diff --git a/src/api/system/social/auth.ts b/src/api/system/social/auth.ts deleted file mode 100644 index 17a46d3..0000000 --- a/src/api/system/social/auth.ts +++ /dev/null @@ -1,24 +0,0 @@ -import request from '@/utils/request'; - -// 绑定账号 -export function authBinding(source: string) { - return request({ - url: '/auth/binding/' + source, - method: 'get' - }); -} - -// 解绑账号 -export function authUnlock(authId: string) { - return request({ - url: '/auth/unlock/' + authId, - method: 'delete' - }); -} -//获取授权列表 -export function getAuthList() { - return request({ - url: '/system/social/list', - method: 'get' - }); -} diff --git a/src/api/types.ts b/src/api/types.ts index e02e645..68fb427 100644 --- a/src/api/types.ts +++ b/src/api/types.ts @@ -15,24 +15,19 @@ export type RegisterForm = { * 登录请求 */ export interface LoginData { - tenantId?: string; - username?: string; - password?: string; + tenantId: string; + username: string; + password: string; rememberMe?: boolean; - socialCode?: string, - socialState?: string, - source?: string, code?: string; uuid?: string; - clientId: string; - grantType: string; } /** * 登录响应 */ export interface LoginResult { - access_token: string; + token: string; } /** diff --git a/src/assets/icons/svg/gitee.svg b/src/assets/icons/svg/gitee.svg deleted file mode 100644 index 6324608..0000000 --- a/src/assets/icons/svg/gitee.svg +++ /dev/null @@ -1 +0,0 @@ - diff --git a/src/layout/components/SocialLogin/index.vue b/src/layout/components/SocialLogin/index.vue deleted file mode 100644 index 7656673..0000000 --- a/src/layout/components/SocialLogin/index.vue +++ /dev/null @@ -1,82 +0,0 @@ - - - diff --git a/src/permission.ts b/src/permission.ts index c2743eb..4713383 100644 --- a/src/permission.ts +++ b/src/permission.ts @@ -10,7 +10,7 @@ import useSettingsStore from '@/store/modules/settings'; import usePermissionStore from '@/store/modules/permission'; NProgress.configure({ showSpinner: false }); -const whiteList = ['/login', '/register', '/social-login']; +const whiteList = ['/login', '/register']; router.beforeEach(async (to, from, next) => { NProgress.start(); diff --git a/src/router/index.ts b/src/router/index.ts index dfd0547..9540ab2 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -37,11 +37,6 @@ export const constantRoutes: RouteOption[] = [ } ] }, - { - path: '/social-login', - hidden: true, - component: () => import('@/layout/components/SocialLogin/index.vue') - }, { path: '/login', component: () => import('@/views/login.vue'), @@ -181,5 +176,4 @@ const router = createRouter({ } }); - export default router; diff --git a/src/store/modules/user.ts b/src/store/modules/user.ts index 2593d1a..6f30437 100644 --- a/src/store/modules/user.ts +++ b/src/store/modules/user.ts @@ -23,8 +23,8 @@ export const useUserStore = defineStore('user', () => { const [err, res] = await to(loginApi(userInfo)); if (res) { const data = res.data; - setToken(data.access_token); - token.value = data.access_token; + setToken(data.token); + token.value = data.token; return Promise.resolve(); } return Promise.reject(err); diff --git a/src/types/env.d.ts b/src/types/env.d.ts index 032f52b..7e5134a 100644 --- a/src/types/env.d.ts +++ b/src/types/env.d.ts @@ -65,7 +65,7 @@ interface ImportMetaEnv { VITE_APP_BASE_URL: string; VITE_APP_CONTEXT_PATH: string; VITE_APP_MONITRO_ADMIN: string; - VITE_APP_POWERJOB_ADMIN: string; + VITE_APP_XXL_JOB_ADMIN: string; VITE_APP_ENV: string; } interface ImportMeta { diff --git a/src/utils/auth.ts b/src/utils/auth.ts index db50ac9..4020003 100644 --- a/src/utils/auth.ts +++ b/src/utils/auth.ts @@ -4,6 +4,6 @@ const tokenStorage = useStorage(TokenKey, null); export const getToken = () => tokenStorage.value; -export const setToken = (access_token: string) => (tokenStorage.value = access_token); +export const setToken = (token: string) => (tokenStorage.value = token); export const removeToken = () => (tokenStorage.value = null); diff --git a/src/views/index.vue b/src/views/index.vue index 4b3bebd..70912af 100644 --- a/src/views/index.vue +++ b/src/views/index.vue @@ -21,7 +21,7 @@ * 分布式锁 Lock4j 注解锁、工具锁 多种多样
* 分布式幂等 Lock4j 基于分布式锁实现
* 分布式链路追踪 SkyWalking 支持链路追踪、网格分析、度量聚合、可视化
- * 分布式任务调度 PowerJob 高性能 高可靠 易扩展
+ * 分布式任务调度 Xxl-Job 高性能 高可靠 易扩展
* 文件存储 Minio 本地存储
* 文件存储 七牛、阿里、腾讯 云存储
* 监控框架 SpringBoot-Admin 全方位服务监控
diff --git a/src/views/login.vue b/src/views/login.vue index 3234864..9559f9b 100644 --- a/src/views/login.vue +++ b/src/views/login.vue @@ -4,8 +4,7 @@

RuoYi-Vue-Plus多租户管理系统

- + @@ -15,14 +14,12 @@ - + - + -
- - - - - - - - - - - - -