切换主题
检测 MDP
提示
如果 MDP 有安装,且没打开,则会自动打开 mdp
示例
- 有安装mdp就会返回成功,不管是否有启动,如果没启动则会自动拉起
- 没有安装就会返回 data: 0
<script setup name="CheckMdp">
import { ref } from 'vue'
import {ElMessage} from 'element-plus'
import { checkInstance, getInstanceFCC } from '../../use-fcc'
import { setLog } from '../../use-log'
const token = ref('')
const userAccount = ref('')
const loading = ref(false)
const checkMdp = async () => {
setLog({
name: '开始检测'
})
if (!await checkInstance()) {
setLog({
name: '检测',
msg: '请先实例化',
type: 'warning'
})
return
}
loading.value = true
let result = await getInstanceFCC().checkMdpExist()
setLog({
name: '检测结果',
msg: result
})
loading.value = false
if (result.status == 200 && result.data && result.data.data == '1') {
ElMessage({
message: '已安装',
type: 'success'
})
} else {
ElMessage({
message: result.msg || '未安装',
type: 'info'
})
}
}
</script>
<template>
<el-form>
<el-form-item>
<el-button type="primary" @click="checkMdp" :loading="loading">检测</el-button>
</el-form-item>
</el-form>
</template>使用方法
typescript
let result = await fccInstance.checkMdpExist();
// {
// "status":200,
// "msg":"调用融合通讯 api 成功。",
// "data":{
// "code":200,
// "data":1 // 1 - 存在,0-不存在
// }
// }1
2
3
4
5
6
7
8
9
2
3
4
5
6
7
8
9
入参说明
无
出参说明
| 出参名称 | 数据类型 | 说明 |
|---|---|---|
| status | number | 调用接口返回结果的状态码,其含义参考融合通讯中台通用状态码。 |
| msg | string | 给开发者的文字提示信息 |
| data | object | 返回的信息 '{code: 200, data: 1 // 1 - 存在,0-不存在}' |
