提交 3f8fcd80 编写于 作者: Cano1997's avatar Cano1997

update: html视图添加票据认证

上级 7469dce9
......@@ -23,13 +23,46 @@ export const HtmlView = defineComponent({
const url = ref('');
const loaded = ref(false);
const getTicket = (params: IData) => {
loaded.value = true;
ibiz.net
.post('/sygw/ticket', params)
.then(res => {
const data = res.data;
if (data.resultCode === '000000') {
url.value = StringUtil.fill(url.value, c.context, data);
}
ibiz.notification.error({
title: data.resultDesc,
});
})
.catch(error => {
ibiz.notification.error({
title: error.message || error.response.data.resultDesc,
});
});
};
watch(
() => c,
() => {
if (c.model && c.model.htmlUrl) {
if (!c.model || loaded.value) {
return;
}
if (c.model.htmlUrl) {
url.value = StringUtil.fill(c.model.htmlUrl, c.context, c.params);
} else {
url.value = '';
}
const viewParams = c.model.source.getPSAppViewParams() || [];
const srfenableaccess = viewParams.find(
x => x.id.toLowerCase() === 'srfenableaccess',
)?.value;
const targetclientid = viewParams.find(
x => x.id.toLowerCase() === 'targetclientid',
)?.value;
if (srfenableaccess === 'true') {
getTicket({ targetclientid });
}
},
{
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册