mirror of
https://github.com/continew-org/continew-admin-ui.git
synced 2025-10-26 20:57:14 +08:00
Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
@@ -22,3 +22,8 @@ export const getUserInfo = () => {
|
||||
export const getUserRoute = () => {
|
||||
return http.get<Auth.RouteItem[]>(`${BASE_URL}/route`)
|
||||
}
|
||||
|
||||
/** @desc 第三方登录授权 */
|
||||
export function socialAuth(source: string) {
|
||||
return http.get<Auth.SocialAuthAuthorizeResp>(`/oauth/${source}`)
|
||||
}
|
||||
@@ -51,3 +51,8 @@ export interface AccountLoginReq {
|
||||
export interface LoginResp {
|
||||
token: string
|
||||
}
|
||||
|
||||
// 第三方登录授权类型
|
||||
export interface SocialAuthAuthorizeResp {
|
||||
authorizeUrl: string;
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
import { reactive, computed, ref, type Ref } from 'vue'
|
||||
import { useRoute, useRouter } from 'vue-router'
|
||||
import { Modal, Message, type FormInstance } from '@arco-design/web-vue'
|
||||
import { isEqual } from 'lodash'
|
||||
import { isEqual } from 'lodash-es'
|
||||
|
||||
type Option<T> = {
|
||||
key?: string
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { reactive } from 'vue'
|
||||
import _ from 'lodash'
|
||||
import { cloneDeep } from 'lodash-es'
|
||||
|
||||
export function useForm<F extends object>(initValue: F) {
|
||||
const getInitValue = () => _.cloneDeep(initValue)
|
||||
const getInitValue = () => cloneDeep(initValue)
|
||||
|
||||
const form = reactive(getInitValue())
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { isExternal } from '@/utils/validate'
|
||||
import { browse, mapTree } from 'xe-utils'
|
||||
import _ from 'lodash'
|
||||
import { upperFirst, camelCase } from 'lodash-es'
|
||||
import { Message } from '@arco-design/web-vue'
|
||||
|
||||
export function getProperty<T, K extends keyof T>(obj: T, key: K): T[K] {
|
||||
@@ -184,7 +184,7 @@ export const randomHex = () => {
|
||||
export const transformPathToName = (path: string) => {
|
||||
if (!path) return ''
|
||||
if (isExternal(path)) return ''
|
||||
return _.upperFirst(_.camelCase(path))
|
||||
return upperFirst(camelCase(path))
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -39,7 +39,6 @@ const userStore = useUserStore()
|
||||
}
|
||||
|
||||
.card {
|
||||
margin-top: $margin;
|
||||
.content {
|
||||
padding: 8px 20px;
|
||||
.welcome {
|
||||
|
||||
@@ -50,13 +50,24 @@
|
||||
<a-button type="primary" size="large" long :loading="loading" html-type="submit">登录</a-button>
|
||||
</a-space>
|
||||
</a-form-item>
|
||||
<div class="login-right__oauth">
|
||||
<a-divider orientation="center">其他登录方式</a-divider>
|
||||
<div class="list">
|
||||
<a class="item" title="使用 Gitee 账号登录" @click="onOauth('gitee')">
|
||||
<GiSvgIcon name="gitee" :size="24" />
|
||||
</a>
|
||||
<a class="item" title="使用 GitHub 账号登录" @click="onOauth('github')">
|
||||
<GiSvgIcon name="github" :size="24" />
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</a-form>
|
||||
</div>
|
||||
</a-col>
|
||||
</a-row>
|
||||
|
||||
<GiThemeBtn class="theme-btn"></GiThemeBtn>
|
||||
<LoginBg></LoginBg>
|
||||
<GiThemeBtn class="theme-btn" />
|
||||
<LoginBg />
|
||||
|
||||
<!-- <div class="footer">
|
||||
<div class="beian">
|
||||
@@ -67,7 +78,7 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { getImageCaptcha } from '@/apis'
|
||||
import { getImageCaptcha, socialAuth } from '@/apis'
|
||||
import { Message, type FormInstance } from '@arco-design/web-vue'
|
||||
import LoginBg from './components/LoginBg/index.vue'
|
||||
import { useAppStore, useUserStore } from '@/stores'
|
||||
@@ -147,6 +158,12 @@ const getCaptcha = () => {
|
||||
})
|
||||
}
|
||||
|
||||
// 第三方登录授权
|
||||
const onOauth = async (source: string) => {
|
||||
const { data } = await socialAuth(source);
|
||||
window.location.href = data.authorizeUrl;
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
getCaptcha()
|
||||
})
|
||||
@@ -230,6 +247,27 @@ onMounted(() => {
|
||||
font-size: 13px;
|
||||
color: var(--color-text-1);
|
||||
}
|
||||
&__oauth {
|
||||
margin-bottom: 20px;
|
||||
:deep(.arco-divider-text) {
|
||||
color: var(--color-text-4);
|
||||
font-size: 12px;
|
||||
font-weight: 400;
|
||||
line-height: 20px;
|
||||
}
|
||||
:deep(.arco-divider-horizontal) {
|
||||
border-bottom: 1px solid rgb(229, 230, 235);
|
||||
}
|
||||
.list {
|
||||
align-items: center;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
width: 100%;
|
||||
.item {
|
||||
margin-right: 15px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.theme-btn {
|
||||
|
||||
@@ -1,13 +1,3 @@
|
||||
<script lang="ts" setup>
|
||||
import BasicSetting from './components/BasicSetting.vue'
|
||||
</script>
|
||||
|
||||
<script lang="ts">
|
||||
export default {
|
||||
name: 'Config'
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="gi_page">
|
||||
<a-card class="general-card" title="系统配置">
|
||||
@@ -21,6 +11,12 @@ export default {
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import BasicSetting from './components/BasicSetting.vue'
|
||||
|
||||
defineOptions({ name: 'Config' })
|
||||
</script>
|
||||
|
||||
<style scoped lang="less">
|
||||
:deep(.arco-tabs-content) {
|
||||
padding-top: 5px;
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
:title="title"
|
||||
:mask-closable="false"
|
||||
:esc-to-close="false"
|
||||
:width="width >= 600 ? 600 : '100%'"
|
||||
:width="width >= 580 ? 580 : '100%'"
|
||||
@before-ok="save"
|
||||
@close="reset"
|
||||
>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
:title="title"
|
||||
:mask-closable="false"
|
||||
:esc-to-close="false"
|
||||
:width="width >= 520 ? 520 : '100%'"
|
||||
:width="width >= 580 ? 580 : '100%'"
|
||||
@before-ok="save"
|
||||
@close="reset"
|
||||
>
|
||||
|
||||
Reference in New Issue
Block a user