fix(系统设置): 修改系统设置bug&登录页面调整
This commit is contained in:
parent
e06854d8b1
commit
6852daad08
|
@ -0,0 +1,13 @@
|
|||
<svg width="26" height="30" viewBox="0 0 26 30" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<g clip-path="url(#clip0_17515_5823)">
|
||||
<path d="M12.9835 0.398435L25.6058 7.68632V22.2608L12.9835 29.5487L0.361194 22.2608V7.68632L12.9835 0.398435ZM12.9835 0L0.015625 7.48646V22.4594L12.9835 29.9458L25.9513 22.4594V7.48646L12.9835 0Z" fill="#783887"/>
|
||||
<path d="M2.0498 8.42262L12.9816 2.11084L23.9148 8.42262L12.9816 14.7344L2.0498 8.42262Z" fill="#783887"/>
|
||||
<path d="M1.84375 8.78101V21.4046L12.7756 27.7164V15.0928L1.84375 8.78101ZM9.3431 23.0963L9.33666 18.6491L7.74034 22.155L6.36322 21.3478L5.62308 16.4699L4.77335 20.4143L2.87143 19.2822L4.41231 13.628L6.83644 15.0502L7.37672 18.4879L8.50755 16.0302L10.875 17.4189L11.2063 24.1885L9.3431 23.0963Z" fill="#783887"/>
|
||||
<path d="M13.1895 15.0928V27.7164L24.1213 21.4046V8.78101L13.1895 15.0928ZM21.8055 19.384C21.7423 20.2312 21.3542 21.1248 20.7443 21.687C20.5199 21.901 20.244 22.1009 19.9164 22.284C19.7901 22.3549 19.6457 22.4284 19.4832 22.507L19.108 22.6824L18.8153 22.801C18.431 22.9558 18.0081 23.1015 17.5477 23.2382C17.3711 23.2897 17.1893 23.34 17.0036 23.389L16.2828 23.6108L16.2428 21.7759L17.375 21.4961C17.375 21.4961 17.8198 21.3801 18.0223 21.3182C18.2634 21.2434 18.4826 21.1673 18.6786 21.0887C19.3891 20.8024 19.7952 20.4775 19.8958 20.1139C19.9538 19.9565 19.9461 19.8289 19.8739 19.7309C19.8017 19.62 19.6521 19.5594 19.4277 19.5491C19.3323 19.5452 19.2111 19.5504 19.0667 19.562L18.6425 19.6058C18.4555 19.6355 18.2879 19.6574 18.1396 19.6716C17.9488 19.6896 17.7747 19.6987 17.6161 19.6961C17.2241 19.6909 16.9159 19.6252 16.6954 19.5001C16.484 19.3673 16.3434 19.1558 16.2751 18.867C16.2261 18.6619 16.2132 18.4105 16.2377 18.1139C16.3009 17.2603 16.6374 16.5563 17.2473 16.0006C17.4755 15.7852 17.7515 15.5841 18.0751 15.3984C18.2015 15.3275 18.3459 15.254 18.5084 15.1753L18.9274 14.9767L19.2111 14.862C19.5335 14.7317 19.8894 14.608 20.2788 14.4906L20.7546 14.3527L21.3077 14.2031L21.3671 15.8033C21.153 15.8368 20.8848 15.8974 20.5612 15.9864C20.146 16.0947 19.7694 16.2172 19.4342 16.3526C18.6915 16.6517 18.4387 16.9109 18.3188 17.2951C18.2737 17.4537 18.275 17.5943 18.293 17.7245C18.315 17.8793 18.3059 17.9257 18.6412 17.9631C18.7431 17.9669 18.872 17.9644 19.0267 17.954L20.0028 17.8496C20.1898 17.8328 20.3587 17.8251 20.507 17.8277C20.8667 17.8328 21.1401 17.8947 21.3284 18.0147C21.5502 18.141 21.6959 18.3512 21.7681 18.6439C21.8171 18.8579 21.83 19.1029 21.8055 19.384Z" fill="#783887"/>
|
||||
</g>
|
||||
<defs>
|
||||
<clipPath id="clip0_17515_5823">
|
||||
<rect width="25.9602" height="30" fill="white"/>
|
||||
</clipPath>
|
||||
</defs>
|
||||
</svg>
|
After Width: | Height: | Size: 2.5 KiB |
|
@ -108,6 +108,7 @@
|
|||
}
|
||||
const { height } = useWindowSize();
|
||||
appStore.innerHeight = height.value;
|
||||
userStore.getAuthentication();
|
||||
});
|
||||
/** 屏幕大小改变时重新赋值innerHeight */
|
||||
useEventListener(window, 'resize', () => {
|
||||
|
|
|
@ -8,6 +8,7 @@ import {
|
|||
EnableAPIKEYUrl,
|
||||
EnableLocalConfigUrl,
|
||||
GetAPIKEYListUrl,
|
||||
getAuthenticationUrl,
|
||||
GetInfoUrl,
|
||||
GetLocalConfigUrl,
|
||||
GetMenuListUrl,
|
||||
|
@ -15,6 +16,7 @@ import {
|
|||
GetPlatformUrl,
|
||||
GetPublicKeyUrl,
|
||||
isLoginUrl,
|
||||
ldapLoginUrl,
|
||||
LoginUrl,
|
||||
LogoutUrl,
|
||||
SavePlatformUrl,
|
||||
|
@ -43,12 +45,22 @@ import type {
|
|||
import type { RouteRecordNormalized } from 'vue-router';
|
||||
|
||||
export function login(data: LoginData) {
|
||||
return MSR.post<LoginRes>({ url: LoginUrl, data });
|
||||
let url = '';
|
||||
if (data.authenticate === 'LOCAL') {
|
||||
url = LoginUrl;
|
||||
} else if (data.authenticate === 'LDAP') {
|
||||
url = ldapLoginUrl;
|
||||
}
|
||||
return MSR.post<LoginRes>({ url, data });
|
||||
}
|
||||
|
||||
export function isLogin() {
|
||||
return MSR.get<LoginRes>({ url: isLoginUrl }, { ignoreCancelToken: true, errorMessageMode: 'none' });
|
||||
}
|
||||
// 获取登录认证方式
|
||||
export function getAuthenticationList() {
|
||||
return MSR.get<string[]>({ url: getAuthenticationUrl }, { ignoreCancelToken: true, errorMessageMode: 'none' });
|
||||
}
|
||||
|
||||
export function logout() {
|
||||
return MSR.get<LoginRes>({ url: LogoutUrl });
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
export const LoginUrl = '/login';
|
||||
export const isLoginUrl = '/is-login';
|
||||
export const ldapLoginUrl = '/ldap/login'; // LDAP登录认证
|
||||
export const getAuthenticationUrl = '/authentication/get-list'; // 获取登录方式
|
||||
export const LogoutUrl = '/signout';
|
||||
export const GetMenuListUrl = '/api/user/menu';
|
||||
export const GetPublicKeyUrl = '/get-key';
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M19.1663 10C19.1663 15.0627 15.0623 19.1667 9.99967 19.1667C4.93706 19.1667 0.833008 15.0627 0.833008 10C0.833008 4.93743 4.93706 0.833374 9.99967 0.833374C15.0623 0.833374 19.1663 4.93743 19.1663 10ZM13.333 7.50004C13.333 9.34097 11.8406 10.8334 9.99967 10.8334C8.15874 10.8334 6.66634 9.34097 6.66634 7.50004C6.66634 5.65911 8.15874 4.16671 9.99967 4.16671C11.8406 4.16671 13.333 5.65911 13.333 7.50004ZM16.5818 16.38C14.9157 18.0986 12.5824 19.1667 9.99965 19.1667C7.41662 19.1667 5.08311 18.0983 3.41693 16.3794C4.40968 14.2666 6.0481 12.0834 7.49964 12.0834H12.4996C13.9504 12.0834 15.5889 14.2682 16.5818 16.38Z" fill="#D9BCE3"/>
|
||||
</svg>
|
After Width: | Height: | Size: 788 B |
|
@ -64,13 +64,13 @@
|
|||
import { Message } from '@arco-design/web-vue';
|
||||
|
||||
import MsIcon from '@/components/pure/ms-icon-font/index.vue';
|
||||
import { FileIconMap, getFileEnum, getFileIcon } from '@/components/pure/ms-upload/iconMap';
|
||||
|
||||
import { useI18n } from '@/hooks/useI18n';
|
||||
import { formatFileSize } from '@/utils';
|
||||
|
||||
import { UploadAcceptEnum, UploadStatus } from '@/enums/uploadEnum';
|
||||
|
||||
import { FileIconMap, getFileIcon } from './iconMap';
|
||||
import type { MsFileItem, UploadType } from './types';
|
||||
|
||||
const { t } = useI18n();
|
||||
|
@ -146,15 +146,11 @@
|
|||
Message.warning(t('ms.upload.overSize'));
|
||||
return Promise.resolve(false);
|
||||
}
|
||||
|
||||
const fileFormatMatch = file.name.match(/\.([a-zA-Z0-9]+)$/);
|
||||
|
||||
// 如果匹配成功,提取文件格式
|
||||
const fileFormatType = fileFormatMatch ? fileFormatMatch[1] : 'none';
|
||||
if (props.accept !== fileFormatType && props.accept !== 'none') {
|
||||
Message.error(
|
||||
props.fileTypeTip ? props?.fileTypeTip : t('ms.upload.fileTypeValidate', { type: props.accept.toUpperCase() })
|
||||
);
|
||||
|
||||
if (props.accept !== getFileEnum(fileFormatType) && props.accept !== 'none') {
|
||||
Message.error(props.fileTypeTip ? props?.fileTypeTip : t('ms.upload.fileTypeValidate', { type: props.accept }));
|
||||
return Promise.resolve(false);
|
||||
}
|
||||
return Promise.resolve(true);
|
||||
|
|
|
@ -34,7 +34,7 @@
|
|||
import { useI18n } from '@/hooks/useI18n';
|
||||
import useAppStore from '@/store/modules/app';
|
||||
|
||||
const defaultPlatformLogo = `${import.meta.env.BASE_URL}images/MS-full-logo.svg`;
|
||||
const defaultPlatformLogo = `${import.meta.env.BASE_URL}images/MeterSphere-logo.svg`;
|
||||
const appStore = useAppStore();
|
||||
const pageConfig = ref({ ...appStore.pageConfig });
|
||||
|
||||
|
|
|
@ -34,7 +34,7 @@
|
|||
import { useI18n } from '@/hooks/useI18n';
|
||||
import useAppStore from '@/store/modules/app';
|
||||
|
||||
const defaultPlatformLogo = `${import.meta.env.BASE_URL}images/MS-full-logo.svg`;
|
||||
const defaultPlatformLogo = `${import.meta.env.BASE_URL}images/MeterSphere-logo.svg`;
|
||||
const appStore = useAppStore();
|
||||
const pageConfig = ref({ ...appStore.pageConfig });
|
||||
|
||||
|
|
|
@ -1,6 +1,11 @@
|
|||
import { defineStore } from 'pinia';
|
||||
|
||||
import { isLogin as userIsLogin, login as userLogin, logout as userLogout } from '@/api/modules/user';
|
||||
import {
|
||||
getAuthenticationList,
|
||||
isLogin as userIsLogin,
|
||||
login as userLogin,
|
||||
logout as userLogout,
|
||||
} from '@/api/modules/user';
|
||||
import { useI18n } from '@/hooks/useI18n';
|
||||
import useLicenseStore from '@/store/modules/setting/license';
|
||||
import { getHashParameters } from '@/utils';
|
||||
|
@ -91,6 +96,15 @@ const useUserStore = defineStore('user', {
|
|||
throw err;
|
||||
}
|
||||
},
|
||||
// 获取登录认证方式
|
||||
async getAuthentication() {
|
||||
try {
|
||||
const res = await getAuthenticationList();
|
||||
console.log(res);
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
},
|
||||
// 登出回调
|
||||
logoutCallBack() {
|
||||
const appStore = useAppStore();
|
||||
|
|
|
@ -143,7 +143,7 @@
|
|||
total: 0,
|
||||
},
|
||||
// TOTO Xpack 不上
|
||||
// ...getTabList(),
|
||||
...getTabList(),
|
||||
]);
|
||||
async function getTabModule() {
|
||||
buggerTab = [];
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
<a-button type="text" class="px-0">{{ record.reviewName }}</a-button>
|
||||
</template>
|
||||
<template #reviewStatus="{ record }">
|
||||
<statusTag :status="record.reviewStatus" />
|
||||
<statusTag :status="record.reviewStatus || 'PREPARED'" />
|
||||
</template>
|
||||
<template #status="{ record }">
|
||||
<MsIcon
|
||||
|
|
|
@ -8,17 +8,20 @@
|
|||
<span class="title-welcome">{{ innerSlogan || t('login.form.title') }}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form mt-[32px] min-w-[416px]">
|
||||
<div class="mb-7 text-[18px] font-medium text-[rgb(var(--primary-5))]">LDAP登录</div>
|
||||
<a-form ref="formRef" :model="userInfo" @submit="handleSubmit">
|
||||
<!-- TOTO 第一版本暂时只考虑普通登录 -->
|
||||
<a-form-item class="login-form-item" field="radio" hide-label>
|
||||
<!-- <a-form-item class="login-form-item" field="radio" hide-label>
|
||||
<a-radio-group v-model="userInfo.authenticate" type="button">
|
||||
<a-radio value="LOCAL">{{ t('login.form.normalLogin') }}</a-radio>
|
||||
<a-radio value="LDAP">LDAP</a-radio>
|
||||
<!-- <a-radio value="OAuth2">{{ t('login.form.oauth2Test') }}</a-radio>
|
||||
<a-radio value="OIDC 90">OIDC 90</a-radio> -->
|
||||
<a-radio value="OAuth2">{{ t('login.form.oauth2Test') }}</a-radio>
|
||||
<a-radio value="OIDC 90">OIDC 90</a-radio>
|
||||
</a-radio-group>
|
||||
</a-form-item>
|
||||
</a-form-item> -->
|
||||
|
||||
<a-form-item
|
||||
class="login-form-item"
|
||||
field="username"
|
||||
|
@ -41,11 +44,23 @@
|
|||
allow-clear
|
||||
/>
|
||||
</a-form-item>
|
||||
<div class="mt-[12px]">
|
||||
<div class="mb-6 mt-[12px]">
|
||||
<a-button type="primary" html-type="submit" long :loading="loading">
|
||||
{{ t('login.form.login') }}
|
||||
</a-button>
|
||||
</div>
|
||||
<a-divider orientation="center" type="dashed">
|
||||
<span class="text-xs font-normal text-[var(--color-text-4)]">{{ t('login.form.modeLoginMethods') }}</span>
|
||||
</a-divider>
|
||||
<div class="flex items-center justify-center">
|
||||
<div class="loginType"> <svg-icon width="18px" height="18px" name="userLogin"></svg-icon></div>
|
||||
<div class="loginType">
|
||||
<span class="type-text text-[10px]">OIDC</span>
|
||||
</div>
|
||||
<div class="loginType">
|
||||
<span class="type-text text-[7px]">OAUTH</span>
|
||||
</div>
|
||||
</div>
|
||||
</a-form>
|
||||
<div v-if="props.isPreview" class="mask"></div>
|
||||
</div>
|
||||
|
@ -58,6 +73,7 @@
|
|||
import { useStorage } from '@vueuse/core';
|
||||
import { Message } from '@arco-design/web-vue';
|
||||
|
||||
import { getAuthenticationList } from '@/api/modules/user';
|
||||
import { GetLoginLogoUrl } from '@/api/requrls/setting/config';
|
||||
import { useI18n } from '@/hooks/useI18n';
|
||||
import useLoading from '@/hooks/useLoading';
|
||||
|
@ -86,7 +102,7 @@
|
|||
});
|
||||
|
||||
const innerSlogan = computed(() => {
|
||||
return props.isPreview ? props.slogan : t(appStore.pageConfig.slogan);
|
||||
return props.isPreview ? props.slogan : appStore.pageConfig.slogan;
|
||||
});
|
||||
|
||||
const errorMessage = ref('');
|
||||
|
@ -146,6 +162,15 @@
|
|||
}
|
||||
}
|
||||
};
|
||||
onMounted(async () => {
|
||||
// userStore.getAuthenticationList();
|
||||
// try {
|
||||
// const res = await getAuthenticationList();
|
||||
// console.log(res);
|
||||
// } catch (error) {
|
||||
// console.log(error);
|
||||
// }
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
|
@ -174,6 +199,21 @@
|
|||
.mask {
|
||||
@apply absolute left-0 top-0 h-full w-full;
|
||||
}
|
||||
.loginType {
|
||||
margin: 0 8px;
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
border: 1px solid var(--color-text-n8);
|
||||
border-radius: 50%;
|
||||
@apply flex cursor-pointer items-center justify-center;
|
||||
.type-text {
|
||||
color: rgb(var(--primary-5));
|
||||
@apply font-medium;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
:deep(.arco-divider-text) {
|
||||
padding: 0 8px !important;
|
||||
}
|
||||
</style>
|
||||
|
|
|
@ -17,9 +17,17 @@
|
|||
import banner from './components/banner.vue';
|
||||
import loginForm from './components/login-form.vue';
|
||||
|
||||
import { useUserStore } from '@/store';
|
||||
|
||||
const props = defineProps<{
|
||||
isPreview?: boolean;
|
||||
}>();
|
||||
|
||||
const userStore = useUserStore();
|
||||
|
||||
onMounted(() => {
|
||||
userStore.getAuthentication();
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
|
|
|
@ -12,4 +12,5 @@ export default {
|
|||
'login.form.register': 'register account',
|
||||
'login.form.normalLogin': 'Normal login',
|
||||
'login.form.oauth2Test': 'OAuth2 Test',
|
||||
'login.form.modeLoginMethods': 'More',
|
||||
};
|
||||
|
|
|
@ -12,4 +12,5 @@ export default {
|
|||
'login.form.register': '注册账号',
|
||||
'login.form.normalLogin': '普通登录',
|
||||
'login.form.oauth2Test': 'OAuth2 测试',
|
||||
'login.form.modeLoginMethods': '更多登录方式',
|
||||
};
|
||||
|
|
|
@ -42,6 +42,7 @@
|
|||
:max-tag-count="2"
|
||||
size="small"
|
||||
class="w-[260px]"
|
||||
:popup-visible="record.showProjectSelect"
|
||||
@change="(value) => selectUserOrProject(value, record, 'project')"
|
||||
@popup-visible-change="visibleChange($event, record, 'project')"
|
||||
>
|
||||
|
@ -64,6 +65,7 @@
|
|||
multiple
|
||||
:max-tag-count="2"
|
||||
class="w-[260px]"
|
||||
:popup-visible="record.showUserSelect"
|
||||
@change="(value) => selectUserOrProject(value, record, 'user')"
|
||||
@popup-visible-change="(value) => visibleChange(value, record, 'user')"
|
||||
>
|
||||
|
@ -119,6 +121,7 @@
|
|||
*/
|
||||
import { onBeforeMount, ref } from 'vue';
|
||||
import { Message } from '@arco-design/web-vue';
|
||||
import { isEqual } from 'lodash-es';
|
||||
|
||||
import MsButton from '@/components/pure/ms-button/index.vue';
|
||||
import MsCard from '@/components/pure/ms-card/index.vue';
|
||||
|
@ -383,11 +386,22 @@
|
|||
};
|
||||
// 面板切换的回调
|
||||
const visibleChange = (visible: boolean, record: MemberItem, type: string) => {
|
||||
const originMapIds =
|
||||
type === 'user'
|
||||
? (record.userRoleIdNameMap || []).map((item: any) => item.id)
|
||||
: (record.projectIdNameMap || []).map((item: any) => item.id);
|
||||
if (!visible) {
|
||||
if (type === 'user' && record.selectUserList.length < 1) {
|
||||
Message.warning(t('organization.member.selectUserEmptyTip'));
|
||||
return;
|
||||
}
|
||||
const currentEditUser = type === 'user' ? record.selectUserList : record.selectProjectList;
|
||||
if (isEqual(originMapIds, currentEditUser)) {
|
||||
record.showProjectSelect = false;
|
||||
record.showUserSelect = false;
|
||||
return;
|
||||
}
|
||||
|
||||
updateUserOrProject(record);
|
||||
}
|
||||
};
|
||||
|
@ -402,6 +416,7 @@
|
|||
}
|
||||
}
|
||||
};
|
||||
|
||||
onBeforeMount(() => {
|
||||
initData();
|
||||
getLinkList();
|
||||
|
|
|
@ -365,7 +365,7 @@
|
|||
|
||||
const defaultLoginImage = `${import.meta.env.BASE_URL}images/login-banner.jpg`;
|
||||
const defaultLoginLogo = `${import.meta.env.BASE_URL}images/login-logo.svg`;
|
||||
const defaultPlatformLogo = `${import.meta.env.BASE_URL}images/MS-full-logo.svg`;
|
||||
const defaultPlatformLogo = `${import.meta.env.BASE_URL}images/MeterSphere-logo.svg`;
|
||||
const { t } = useI18n();
|
||||
const { currentLocale } = useLocale();
|
||||
const appStore = useAppStore();
|
||||
|
|
|
@ -41,7 +41,7 @@ export default {
|
|||
'system.plugin.disablePluginContent':
|
||||
'The project can not integrate with the platform and the default template of the platform is not available, be careful!',
|
||||
'system.plugin.alertDescribe':
|
||||
'The MeterSphere v2.10 LTS release supports plug-ins of DevOps、 API imports、 requests、 project management、 protocols、 and other types',
|
||||
'The MeterSphere v3.0 LTS release supports plug-ins of DevOps、 API imports、 requests、 project management、 protocols、 and other types',
|
||||
'system.plugin.viewTable': 'View the form',
|
||||
'system.plugin.downAddress': 'More open source plug-ins can be downloaded here',
|
||||
'system.plugin.goDownload': 'downloads',
|
||||
|
|
|
@ -63,7 +63,7 @@ export default {
|
|||
'system.plugin.enablePluginSuccess': '启用成功',
|
||||
'system.plugin.disablePluginContent': '项目无法与该平台集成且该平台默认模板不可用,谨慎操作!',
|
||||
'system.plugin.alertDescribe':
|
||||
'MeterSphere v2.10 LTS 版本支持 DevOps、API 导入、请求、项目管理、协议 类型的插件,具体支持插件请',
|
||||
'MeterSphere v3.0 LTS 版本支持 DevOps、API 导入、请求、项目管理、协议 类型的插件,具体支持插件请',
|
||||
'system.plugin.viewTable': '查看表格',
|
||||
'system.plugin.downAddress': '更多开源插件,请在此下载',
|
||||
'system.plugin.goDownload': '去下载',
|
||||
|
|
Loading…
Reference in New Issue