fix: 修复钉钉扫码
This commit is contained in:
parent
31a6a528d6
commit
5d278ee3ea
@ -79,9 +79,9 @@ const currentPlatform = reactive<Platform>({
|
|||||||
|
|
||||||
const formatFieldName = (key?: any): string => {
|
const formatFieldName = (key?: any): string => {
|
||||||
const fieldNames: { [key: string]: string } = {
|
const fieldNames: { [key: string]: string } = {
|
||||||
|
corp_id: 'Corp ID',
|
||||||
app_key: 'APP Key',
|
app_key: 'APP Key',
|
||||||
app_secret: 'APP Secret',
|
app_secret: 'APP Secret',
|
||||||
corp_id: 'Corp ID',
|
|
||||||
agent_id: 'Agent ID',
|
agent_id: 'Agent ID',
|
||||||
callback_url: '回调地址'
|
callback_url: '回调地址'
|
||||||
}
|
}
|
||||||
|
|||||||
@ -66,7 +66,7 @@ const props = defineProps<{
|
|||||||
config: {
|
config: {
|
||||||
app_secret: string
|
app_secret: string
|
||||||
app_key: string
|
app_key: string
|
||||||
crop_id: string
|
corp_id: string
|
||||||
}
|
}
|
||||||
}>()
|
}>()
|
||||||
|
|
||||||
@ -86,7 +86,7 @@ const initActive = async () => {
|
|||||||
const data = {
|
const data = {
|
||||||
appKey: props.config.app_key,
|
appKey: props.config.app_key,
|
||||||
appSecret: props.config.app_secret,
|
appSecret: props.config.app_secret,
|
||||||
crop_id: props.config.crop_id
|
corp_id: props.config.corp_id
|
||||||
}
|
}
|
||||||
|
|
||||||
const redirectUri = encodeURIComponent(window.location.origin)
|
const redirectUri = encodeURIComponent(window.location.origin)
|
||||||
@ -104,7 +104,7 @@ const initActive = async () => {
|
|||||||
state: 'fit2cloud-ding-qr',
|
state: 'fit2cloud-ding-qr',
|
||||||
prompt: 'consent',
|
prompt: 'consent',
|
||||||
exclusiveLogin: 'true',
|
exclusiveLogin: 'true',
|
||||||
exclusiveCorpId: data.crop_id
|
exclusiveCorpId: data.corp_id
|
||||||
},
|
},
|
||||||
(loginResult) => {
|
(loginResult) => {
|
||||||
const authCode = loginResult.authCode
|
const authCode = loginResult.authCode
|
||||||
@ -124,7 +124,7 @@ const initActive = async () => {
|
|||||||
watch(
|
watch(
|
||||||
() => props.config,
|
() => props.config,
|
||||||
(newConfig) => {
|
(newConfig) => {
|
||||||
if (newConfig.app_secret && newConfig.app_key && newConfig.crop_id) {
|
if (newConfig.app_secret && newConfig.app_key && newConfig.corp_id) {
|
||||||
isConfigReady.value = true
|
isConfigReady.value = true
|
||||||
initActive()
|
initActive()
|
||||||
}
|
}
|
||||||
|
|||||||
@ -265,24 +265,13 @@ const rules = reactive<FormRules>({
|
|||||||
})
|
})
|
||||||
|
|
||||||
const onChange = (file: any, fileList: UploadFiles, attr: string) => {
|
const onChange = (file: any, fileList: UploadFiles, attr: string) => {
|
||||||
if (attr === 'loginImage') {
|
const isLimit = file?.size / 1024 / 1024 < 10
|
||||||
const isLimit = file?.size / 1024 / 1024 < 5
|
if (!isLimit) {
|
||||||
if (!isLimit) {
|
// @ts-ignore
|
||||||
// @ts-ignore
|
MsgError(`文件大小超过 10M`)
|
||||||
MsgError(`文件大小超过 5M`)
|
return false
|
||||||
return false
|
|
||||||
} else {
|
|
||||||
themeForm.value[attr] = file.raw
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
const isLimit = file?.size / 1024 < 200
|
themeForm.value[attr] = file.raw
|
||||||
if (!isLimit) {
|
|
||||||
// @ts-ignore
|
|
||||||
MsgError(`文件大小超过 200KB`)
|
|
||||||
return false
|
|
||||||
} else {
|
|
||||||
themeForm.value[attr] = file.raw
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
user.setTheme(themeForm.value)
|
user.setTheme(themeForm.value)
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user