refactor: ui
This commit is contained in:
parent
263872d5a3
commit
ef8c555108
@ -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
|
||||
}
|
||||
|
||||
@ -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) => {
|
||||
|
||||
@ -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,
|
||||
|
||||
@ -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'
|
||||
}
|
||||
],
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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'
|
||||
}
|
||||
],
|
||||
|
||||
@ -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,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user