ref: 适配分布式架构

This commit is contained in:
lbw 2023-04-07 10:18:18 +08:00
parent e335aa19a2
commit ce008f9f71
4 changed files with 16 additions and 18 deletions

View File

@ -15,7 +15,7 @@
:accept="fileType.join(',')"
>
<template v-if="imageUrl">
<img :src="baseURL + imageUrl" class="upload-image" />
<img :src="imageUrl.indexOf('http') > 0 ? baseURL + imageUrl : imageUrl" class="upload-image" />
<div class="upload-handle" @click.stop>
<div class="handle-icon" @click="editImg" v-if="!self_disabled">
<el-icon><Edit /></el-icon>

View File

@ -455,7 +455,7 @@ export function toUnderline(str: string) {
*
* @param originUrl
*/
const adaptationUrl = (originUrl?: string) => {
const adaptationUrl = (originUrl: string) => {
// 微服务架构 不做路径转换,为空不做路径转换
const isMicro = import.meta.env.VITE_IS_MICRO;
if (validateNull(isMicro) || isMicro === 'true') {

View File

@ -120,6 +120,7 @@ import { clearQuota, delObjs, fetchList, generateQr } from '/@/api/mp/wx-account
import { useMessage, useMessageBox } from '/@/hooks/message';
import { useI18n } from 'vue-i18n';
import commonFunction from '/@/utils/commonFunction';
import other from '/@/utils/other';
const { copyText } = commonFunction();
//
@ -187,7 +188,8 @@ const dialogFormVisible = ref(false);
const wxurl = ref('');
const access = (row: any) => {
dialogFormVisible.value = true;
wxurl.value = row.url + '/mp/' + row.appid + '/portal';
let url = baseUrl + row.url + '/mp/' + row.appid + '/portal';
wxurl.value = other.adaptationUrl(url);
};
const generate = (row: any) => {

View File

@ -128,7 +128,7 @@
</template>
<script lang="ts" name="wx-menu" setup>
import { saveObj, getObj } from '/@/api/mp/wx-menu';
import { saveObj, getObj, publishObj } from '/@/api/mp/wx-menu';
// 使
import { fetchAccountList } from '/@/api/mp/wx-account';
@ -340,22 +340,18 @@ const deleteMenu = () => {
});
};
const handleSave = () => {
useMessageBox()
.confirm('确定要保存该菜单吗?')
.then(() => {
saveObj(accountId.value, {
button: menuList,
})
.then(() => {
useMessage().success('保存成功');
})
.catch((err) => {
useMessage().error(err.msg);
});
});
const handleSave = async () => {
try {
await useMessageBox().confirm('确定要保存该菜单吗?');
await saveObj(accountId.value, { button: menuList });
await publishObj(accountId.value);
useMessage().error('发布成功');
} catch (err:any) {
useMessage().error(err.msg);
}
};
const deleteMaterial = () => {
tempObj.value.replyArticles = [];
tempObj.value.articleId = '';