Commit 3a6a6699 authored by 胡占生's avatar 胡占生 🇨🇳

fix:图片回显,在上传图片时,将图片的地址保存到数据库中,在回显时,将地址转换成图片。

parent 7043e66a
......@@ -37,7 +37,8 @@ const useUserStore = defineStore(
getInfo().then(res => {
const user = res.user
console.log('%c [ user ]-38', 'font-size:13px; background:pink; color:#bf2c9f;', user)
const avatar = (user.avatar == "" || user.avatar == null) ? defAva : import.meta.env.VITE_APP_BASE_API + user.avatar;
const avatar = (user.avatar == "" || user.avatar == null) ? defAva : 'http://192.168.4.206'+ user.avatar;
// const avatar = (user.avatar == "" || user.avatar == null) ? defAva : import.meta.env.VITE_APP_BASE_API + user.avatar;
if (res.roles && res.roles.length > 0) { // 验证返回的roles是否是一个非空数组
this.roles = res.roles
......
......@@ -111,9 +111,9 @@ service.interceptors.response.use(res => {
console.log('err' + error)
let { message } = error;
if (message == "Network Error") {
message = "后端接口连接异常";
message = "亲,加载失败,请稍后再试。";
} else if (message.includes("timeout")) {
message = "系统接口请求超时";
message = "亲,网络超时啦。提示您检查网络连接,如路由器、移动数据。引导您重启网络设备或稍等再操作。";
} else if (message.includes("Request failed with status code")) {
message = "系统接口" + message.substr(message.length - 3) + "异常";
}
......
......@@ -45,7 +45,6 @@
plain
icon="Plus"
@click="handleAdd"
v-hasPermi="['monitor:job:add']"
>新增</el-button>
</el-col>
<!-- <el-col :span="1.5">
......
......@@ -74,7 +74,7 @@
</el-form>
<template #footer>
<div class="dialog-footer">
<el-button type="primary" @click="submitForm">确 定</el-button>
<el-button type="primary" :loading="butLoading" @click="submitForm">确 定</el-button>
<el-button @click="cancel">取 消</el-button>
</div>
</template>
......@@ -87,6 +87,7 @@ const { proxy } = getCurrentInstance();
const emit = defineEmits();
const open = ref(false);
const openAdd = ref(false);
const butLoading = ref(false);
const title = ref("");
const titleLevel = ref("");
const loading = ref(true);
......@@ -109,6 +110,7 @@ const { queryParams, form, rules } = toRefs(data);
/** 表单重置 */
function reset() {
butLoading.value = false;
form.value = {
id: undefined,
alarmName: undefined,
......@@ -157,16 +159,19 @@ function submitForm() {
proxy.$refs["algLevelRef"].validate(valid => {
if (valid) {
form.value.alarmShowType=form.value.alarmShowType.join()
butLoading.value = true;
if (form.value.id != undefined) {
updateAlgLevel(form.value).then(response => {
proxy.$modal.msgSuccess("修改成功");
openAdd.value = false;
butLoading.value = false;
getLevelList();
});
} else {
addAlgLevel(form.value).then(response => {
proxy.$modal.msgSuccess("新增成功");
openAdd.value = false;
butLoading.value = false;
getLevelList();
});
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment