diff --git a/.env.development b/.env.development index 4ec5afb..6ca0e51 100644 --- a/.env.development +++ b/.env.development @@ -13,7 +13,7 @@ VITE_APP_CONTEXT_PATH = '/' # 监控地址 VITE_APP_MONITRO_ADMIN = 'http://localhost:9090/admin/applications' -# xxl-job 控制台地址 -VITE_APP_XXL_JOB_ADMIN = 'http://localhost:9100/xxl-job-admin' +# powerjob 控制台地址 +VITE_APP_POWERJOB_ADMIN = 'http://localhost:7700/' VITE_APP_PORT = 80 diff --git a/.env.production b/.env.production index 6e6510a..a5e77b3 100644 --- a/.env.production +++ b/.env.production @@ -10,8 +10,8 @@ VITE_APP_CONTEXT_PATH = '/' # 监控地址 VITE_APP_MONITRO_ADMIN = '/admin/applications' -# 监控地址 -VITE_APP_XXL_JOB_ADMIN = '/xxl-job-admin' +# powerjob 控制台地址 +VITE_APP_POWERJOB_ADMIN = '/powerjob' # 生产环境 VITE_APP_BASE_API = '/prod-api' diff --git a/.gitignore b/.gitignore index 79e7fd9..40df474 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ .DS_Store +.history node_modules/ dist/ npm-debug.log* diff --git a/src/api/login.ts b/src/api/login.ts index b95a0c0..9d6d1b7 100644 --- a/src/api/login.ts +++ b/src/api/login.ts @@ -60,6 +60,21 @@ export function getCodeImg(): AxiosPromise { timeout: 20000 }); } +/** + * 第三方登录 + * @param source 第三方登录类型 + * */ +export function socialLogin(source: string, code: any, state: any): AxiosPromise { + const data = { + code, + state + }; + return request({ + url: '/auth/social-login/' + source, + method: 'get', + params: data + }); +} // 获取用户详细信息 export function getInfo(): AxiosPromise { diff --git a/src/api/system/social/auth.ts b/src/api/system/social/auth.ts new file mode 100644 index 0000000..17a46d3 --- /dev/null +++ b/src/api/system/social/auth.ts @@ -0,0 +1,24 @@ +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/assets/icons/svg/gitee.svg b/src/assets/icons/svg/gitee.svg new file mode 100644 index 0000000..6324608 --- /dev/null +++ b/src/assets/icons/svg/gitee.svg @@ -0,0 +1 @@ + diff --git a/src/layout/components/SocialLogin/index.vue b/src/layout/components/SocialLogin/index.vue new file mode 100644 index 0000000..fad8286 --- /dev/null +++ b/src/layout/components/SocialLogin/index.vue @@ -0,0 +1,36 @@ + + + diff --git a/src/permission.ts b/src/permission.ts index 4713383..c2743eb 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']; +const whiteList = ['/login', '/register', '/social-login']; router.beforeEach(async (to, from, next) => { NProgress.start(); diff --git a/src/router/index.ts b/src/router/index.ts index 9540ab2..76a81bc 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -37,6 +37,11 @@ export const constantRoutes: RouteOption[] = [ } ] }, + { + path: '/social-login', + hidden: true, + component: () => import('@/layout/components/SocialLogin/index.vue') + }, { path: '/login', component: () => import('@/views/login.vue'), diff --git a/src/types/env.d.ts b/src/types/env.d.ts index 7e5134a..032f52b 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_XXL_JOB_ADMIN: string; + VITE_APP_POWERJOB_ADMIN: string; VITE_APP_ENV: string; } interface ImportMeta { diff --git a/src/views/index.vue b/src/views/index.vue index 70912af..4b3bebd 100644 --- a/src/views/index.vue +++ b/src/views/index.vue @@ -21,7 +21,7 @@ * 分布式锁 Lock4j 注解锁、工具锁 多种多样
* 分布式幂等 Lock4j 基于分布式锁实现
* 分布式链路追踪 SkyWalking 支持链路追踪、网格分析、度量聚合、可视化
- * 分布式任务调度 Xxl-Job 高性能 高可靠 易扩展
+ * 分布式任务调度 PowerJob 高性能 高可靠 易扩展
* 文件存储 Minio 本地存储
* 文件存储 七牛、阿里、腾讯 云存储
* 监控框架 SpringBoot-Admin 全方位服务监控
diff --git a/src/views/login.vue b/src/views/login.vue index 11f3aae..709b0ce 100644 --- a/src/views/login.vue +++ b/src/views/login.vue @@ -4,7 +4,7 @@

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

- + @@ -36,6 +36,20 @@ 立即注册 +
+ + + + + + + + + + + + +