refactor: ui

This commit is contained in:
wxg0103 2025-06-24 18:21:09 +08:00
parent 263872d5a3
commit ef8c555108
7 changed files with 55 additions and 45 deletions

View File

@ -212,6 +212,17 @@ const getPlatformConfig: (application_id: string, type: string) => Promise<Resul
) => {
return get(`${prefix.value}/${application_id}/platform/${type}`)
}
/**
*
*/
const updatePlatformConfig: (
application_id: string,
type: string,
data: any,
loading?: Ref<boolean>
) => Promise<Result<any>> = (application_id, type, data, loading) => {
return post(`${prefix.value}/${application_id}/platform/${type}`, data, undefined, loading)
}
/**
*
* @param application_id
@ -245,4 +256,5 @@ export default {
updatePlatformStatus,
getPlatformConfig,
publish,
updatePlatformConfig
}

View File

@ -275,7 +275,8 @@ function redirectAuth(authType: string) {
window.location.href = url
}
})
.catch(() => {})
.catch(() => {
})
})
}
@ -300,7 +301,7 @@ onBeforeMount(() => {
loading.value = true
user.asyncGetProfile().then((res) => {
//
if (hasPermission([EditionConst.IS_EE, EditionConst.IS_PE], 'OR')) {
if (user.isPE() || user.isEE()) {
login
.getAuthType()
.then((res) => {

View File

@ -13,7 +13,6 @@ import { onMounted } from 'vue'
const {load} = useScriptTag(
'https://lf-package-cn.feishucdn.com/obj/feishu-static/lark/passport/qrcode/LarkSSOSDKWebQRCode-1.0.3.js'
)
const props = defineProps<{
config: {
app_secret: string
@ -27,15 +26,13 @@ const initActive = async () => {
console.error('飞书二维码 SDK 加载失败')
return
}
const data = {
agentId: props.config.app_key,
appSecret: props.config.app_secret
}
const redirectUrl = encodeURIComponent(`${window.location.origin}/api/feishu`)
const redirectUrl = encodeURIComponent(`${window.location.origin}/api/lark`)
const url = `https://passport.feishu.cn/suite/passport/oauth/authorize?client_id=${data.agentId}&redirect_uri=${redirectUrl}&response_type=code&state=fit2cloud-lark-qr`
const QRLoginObj = window.QRLogin({
id: 'lark-qr',
goto: url,

View File

@ -30,7 +30,7 @@
<el-form-item :label="$t('views.system.password')" prop="config.password">
<el-input
v-model="form.config.password"
:placeholder="$t('views.userManage.form.password.placeholder')"
:placeholder="$t('views.login.loginForm.password.placeholder')"
show-password
/>
</el-form-item>
@ -120,7 +120,7 @@ const rules = reactive<FormRules<any>>({
'config.password': [
{
required: true,
message: t('views.userManage.form.password.requiredMessage'),
message: t('views.login.loginForm.password.placeholder'),
trigger: 'blur'
}
],

View File

@ -177,7 +177,7 @@ const open = async (platform: Platform) => {
currentPlatform.config.callback_url = `${defaultCallbackUrl}/api/dingtalk`
break
case 'lark':
currentPlatform.config.callback_url = `${defaultCallbackUrl}/api/feishu`
currentPlatform.config.callback_url = `${defaultCallbackUrl}/api/lark`
break
default:
break

View File

@ -30,7 +30,7 @@
<el-form-item :label="$t('views.system.password')" prop="config.password">
<el-input
v-model="form.config.password"
:placeholder="$t('views.userManage.form.password.placeholder')"
:placeholder="$t('views.login.loginForm.password.placeholder')"
show-password
/>
</el-form-item>
@ -120,7 +120,7 @@ const rules = reactive<FormRules<any>>({
'config.password': [
{
required: true,
message: t('views.userManage.form.password.requiredMessage'),
message: t('views.login.loginForm.password.placeholder'),
trigger: 'blur'
}
],

View File

@ -148,7 +148,7 @@ function createPlatform(key: string, name: string): Platform {
return {
key,
logoSrc: new URL(`../../../assets/scan/logo_${logo}.svg`, import.meta.url).href,
logoSrc: new URL(`../../../../assets/scan/logo_${logo}.svg`, import.meta.url).href,
name,
isActive: false,
isValid: false,