fix: 修复钉钉扫码

This commit is contained in:
wxg0103 2024-10-30 12:03:09 +08:00
parent 31a6a528d6
commit 5d278ee3ea
3 changed files with 11 additions and 22 deletions

View File

@ -79,9 +79,9 @@ const currentPlatform = reactive<Platform>({
const formatFieldName = (key?: any): string => {
const fieldNames: { [key: string]: string } = {
corp_id: 'Corp ID',
app_key: 'APP Key',
app_secret: 'APP Secret',
corp_id: 'Corp ID',
agent_id: 'Agent ID',
callback_url: '回调地址'
}

View File

@ -66,7 +66,7 @@ const props = defineProps<{
config: {
app_secret: string
app_key: string
crop_id: string
corp_id: string
}
}>()
@ -86,7 +86,7 @@ const initActive = async () => {
const data = {
appKey: props.config.app_key,
appSecret: props.config.app_secret,
crop_id: props.config.crop_id
corp_id: props.config.corp_id
}
const redirectUri = encodeURIComponent(window.location.origin)
@ -104,7 +104,7 @@ const initActive = async () => {
state: 'fit2cloud-ding-qr',
prompt: 'consent',
exclusiveLogin: 'true',
exclusiveCorpId: data.crop_id
exclusiveCorpId: data.corp_id
},
(loginResult) => {
const authCode = loginResult.authCode
@ -124,7 +124,7 @@ const initActive = async () => {
watch(
() => props.config,
(newConfig) => {
if (newConfig.app_secret && newConfig.app_key && newConfig.crop_id) {
if (newConfig.app_secret && newConfig.app_key && newConfig.corp_id) {
isConfigReady.value = true
initActive()
}

View File

@ -265,24 +265,13 @@ const rules = reactive<FormRules>({
})
const onChange = (file: any, fileList: UploadFiles, attr: string) => {
if (attr === 'loginImage') {
const isLimit = file?.size / 1024 / 1024 < 5
if (!isLimit) {
// @ts-ignore
MsgError(`文件大小超过 5M`)
return false
} else {
themeForm.value[attr] = file.raw
}
const isLimit = file?.size / 1024 / 1024 < 10
if (!isLimit) {
// @ts-ignore
MsgError(`文件大小超过 10M`)
return false
} else {
const isLimit = file?.size / 1024 < 200
if (!isLimit) {
// @ts-ignore
MsgError(`文件大小超过 200KB`)
return false
} else {
themeForm.value[attr] = file.raw
}
themeForm.value[attr] = file.raw
}
user.setTheme(themeForm.value)
}