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}`)
|
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
|
* @param application_id
|
||||||
@ -245,4 +256,5 @@ export default {
|
|||||||
updatePlatformStatus,
|
updatePlatformStatus,
|
||||||
getPlatformConfig,
|
getPlatformConfig,
|
||||||
publish,
|
publish,
|
||||||
|
updatePlatformConfig
|
||||||
}
|
}
|
||||||
|
|||||||
@ -275,7 +275,8 @@ function redirectAuth(authType: string) {
|
|||||||
window.location.href = url
|
window.location.href = url
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch(() => {})
|
.catch(() => {
|
||||||
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -300,7 +301,7 @@ onBeforeMount(() => {
|
|||||||
loading.value = true
|
loading.value = true
|
||||||
user.asyncGetProfile().then((res) => {
|
user.asyncGetProfile().then((res) => {
|
||||||
// 企业版和专业版:第三方登录
|
// 企业版和专业版:第三方登录
|
||||||
if (hasPermission([EditionConst.IS_EE, EditionConst.IS_PE], 'OR')) {
|
if (user.isPE() || user.isEE()) {
|
||||||
login
|
login
|
||||||
.getAuthType()
|
.getAuthType()
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
|
|||||||
@ -13,7 +13,6 @@ import { onMounted } from 'vue'
|
|||||||
const {load} = useScriptTag(
|
const {load} = useScriptTag(
|
||||||
'https://lf-package-cn.feishucdn.com/obj/feishu-static/lark/passport/qrcode/LarkSSOSDKWebQRCode-1.0.3.js'
|
'https://lf-package-cn.feishucdn.com/obj/feishu-static/lark/passport/qrcode/LarkSSOSDKWebQRCode-1.0.3.js'
|
||||||
)
|
)
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
config: {
|
config: {
|
||||||
app_secret: string
|
app_secret: string
|
||||||
@ -27,15 +26,13 @@ const initActive = async () => {
|
|||||||
console.error('飞书二维码 SDK 加载失败')
|
console.error('飞书二维码 SDK 加载失败')
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
const data = {
|
const data = {
|
||||||
agentId: props.config.app_key,
|
agentId: props.config.app_key,
|
||||||
appSecret: props.config.app_secret
|
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 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({
|
const QRLoginObj = window.QRLogin({
|
||||||
id: 'lark-qr',
|
id: 'lark-qr',
|
||||||
goto: url,
|
goto: url,
|
||||||
|
|||||||
@ -30,7 +30,7 @@
|
|||||||
<el-form-item :label="$t('views.system.password')" prop="config.password">
|
<el-form-item :label="$t('views.system.password')" prop="config.password">
|
||||||
<el-input
|
<el-input
|
||||||
v-model="form.config.password"
|
v-model="form.config.password"
|
||||||
:placeholder="$t('views.userManage.form.password.placeholder')"
|
:placeholder="$t('views.login.loginForm.password.placeholder')"
|
||||||
show-password
|
show-password
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@ -120,7 +120,7 @@ const rules = reactive<FormRules<any>>({
|
|||||||
'config.password': [
|
'config.password': [
|
||||||
{
|
{
|
||||||
required: true,
|
required: true,
|
||||||
message: t('views.userManage.form.password.requiredMessage'),
|
message: t('views.login.loginForm.password.placeholder'),
|
||||||
trigger: 'blur'
|
trigger: 'blur'
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
|||||||
@ -177,7 +177,7 @@ const open = async (platform: Platform) => {
|
|||||||
currentPlatform.config.callback_url = `${defaultCallbackUrl}/api/dingtalk`
|
currentPlatform.config.callback_url = `${defaultCallbackUrl}/api/dingtalk`
|
||||||
break
|
break
|
||||||
case 'lark':
|
case 'lark':
|
||||||
currentPlatform.config.callback_url = `${defaultCallbackUrl}/api/feishu`
|
currentPlatform.config.callback_url = `${defaultCallbackUrl}/api/lark`
|
||||||
break
|
break
|
||||||
default:
|
default:
|
||||||
break
|
break
|
||||||
|
|||||||
@ -30,7 +30,7 @@
|
|||||||
<el-form-item :label="$t('views.system.password')" prop="config.password">
|
<el-form-item :label="$t('views.system.password')" prop="config.password">
|
||||||
<el-input
|
<el-input
|
||||||
v-model="form.config.password"
|
v-model="form.config.password"
|
||||||
:placeholder="$t('views.userManage.form.password.placeholder')"
|
:placeholder="$t('views.login.loginForm.password.placeholder')"
|
||||||
show-password
|
show-password
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@ -120,7 +120,7 @@ const rules = reactive<FormRules<any>>({
|
|||||||
'config.password': [
|
'config.password': [
|
||||||
{
|
{
|
||||||
required: true,
|
required: true,
|
||||||
message: t('views.userManage.form.password.requiredMessage'),
|
message: t('views.login.loginForm.password.placeholder'),
|
||||||
trigger: 'blur'
|
trigger: 'blur'
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
|||||||
@ -148,7 +148,7 @@ function createPlatform(key: string, name: string): Platform {
|
|||||||
|
|
||||||
return {
|
return {
|
||||||
key,
|
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,
|
name,
|
||||||
isActive: false,
|
isActive: false,
|
||||||
isValid: false,
|
isValid: false,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user