问题修复

main
ysn 1 week ago
parent 3c7da8e574
commit c6696ae899
  1. 36
      src/layout/components/SystemSettingDialog.vue
  2. 37
      src/permission.js
  3. 24
      src/utils/request.js
  4. 20
      src/views/cases/components/CaseFormDialog.vue
  5. 9
      src/views/cases/index.vue

@ -33,8 +33,7 @@
<el-radio label="enter">Enter发送</el-radio>
</el-radio-group>
</el-form-item>
<!-- 只能在软件中使用需要访问本地文件系统 -->
<!-- <el-form-item label="视讯存储">
<el-form-item label="视讯存储">
<div class="path-control">
<el-input :value="basicForm.videoPath" disabled class="path-input" />
<div class="path-buttons">
@ -51,7 +50,7 @@
<el-button class="modify-btn">修改</el-button>
</div>
</div>
</el-form-item> -->
</el-form-item>
</el-form>
</el-tab-pane>
<!-- 音频设置 -->
@ -169,11 +168,9 @@ export default {
activeTab: "basic",
basicForm: {
notification: true,
// autoStart: false, // 使
// exitOnClose: true, // 使
sendKey: "enter",
// videoPath: "2026-05/HiuUltraTalk_V01.01.16/HiuTalkStore", // 使
// cachePath: "2026-05/HiuUltraTalk_V01.01.16/HiuTalkStore", // 使
videoPath: "",
cachePath: "",
},
audioForm: {
autoGain: true,
@ -200,15 +197,28 @@ export default {
this.otherForm.signature = signatureData;
this.saveSettings();
},
//
getDefaultPath() {
const version = this.$store.getters.loginInfo?.upgrade_data?.version || "V01.01.16";
return `D:\\RUS_${version}\\HiUTalkStore`;
},
//
loadSettings() {
try {
const savedSettings = localStorage.getItem(SYSTEM_SETTINGS_KEY);
const defaultPath = this.getDefaultPath();
if (savedSettings) {
const settings = JSON.parse(savedSettings);
//
if (settings.basicForm) {
this.basicForm = { ...this.basicForm, ...settings.basicForm };
// 使
if (!this.basicForm.videoPath) {
this.basicForm.videoPath = defaultPath;
}
if (!this.basicForm.cachePath) {
this.basicForm.cachePath = defaultPath;
}
}
if (settings.audioForm) {
this.audioForm = { ...this.audioForm, ...settings.audioForm };
@ -216,6 +226,10 @@ export default {
if (settings.otherForm) {
this.otherForm = { ...this.otherForm, ...settings.otherForm };
}
} else {
// 使
this.basicForm.videoPath = defaultPath;
this.basicForm.cachePath = defaultPath;
}
} catch (e) {
console.error("加载系统设置失败:", e);
@ -260,13 +274,13 @@ export default {
cancelButtonText: "取消",
type: "warning",
}).then(() => {
const version = this.$store.getters.loginInfo?.upgrade_data?.version || "V01.01.16";
const defaultPath = `D:\\RUS_${version}\\HiUTalkStore`;
this.basicForm = {
notification: true,
// autoStart: false,
// exitOnClose: true,
sendKey: "enter",
// videoPath: "2026-05/HiuUltraTalk_V01.01.16/HiuTalkStore",
// cachePath: "2026-05/HiuUltraTalk_V01.01.16/HiuTalkStore",
videoPath: defaultPath,
cachePath: defaultPath,
};
this.audioForm = {
autoGain: true,

@ -15,6 +15,41 @@ const isWhiteList = (path) => {
return whiteList.some(pattern => isPathMatch(pattern, path))
}
// 初始化系统设置(登录时调用)
const initSystemSettings = () => {
const SYSTEM_SETTINGS_KEY = "systemSettings";
try {
const savedSettings = localStorage.getItem(SYSTEM_SETTINGS_KEY);
if (!savedSettings) {
// 获取版本号
const version = store.getters.loginInfo?.upgrade_data?.version || "V01.01.16";
const defaultPath = `D:\\RUS_${version}\\HiUTalkStore`;
// 初始化默认设置
const defaultSettings = {
basicForm: {
notification: true,
sendKey: "enter",
videoPath: defaultPath,
cachePath: defaultPath,
},
audioForm: {
autoGain: true,
echoCancel: true,
noiseReduction: true,
},
otherForm: {
signature: null,
skipEvaluation: false,
},
};
localStorage.setItem(SYSTEM_SETTINGS_KEY, JSON.stringify(defaultSettings));
console.log("系统设置初始化完成");
}
} catch (e) {
console.error("初始化系统设置失败:", e);
}
}
router.beforeEach((to, from, next) => {
NProgress.start()
if (getToken()) {
@ -39,6 +74,8 @@ router.beforeEach((to, from, next) => {
store.dispatch('GetNetConfig').then(res => {
store.dispatch('GetInfo').then(() => {
isRelogin.show = false
// 初始化系统设置(包括视讯存储路径和缓存路径)
initSystemSettings()
store.dispatch('GenerateRoutes').then(accessRoutes => {
// 根据roles权限生成可访问的路由表
router.addRoutes(accessRoutes) // 动态添加可访问路由表

@ -82,32 +82,20 @@ service.interceptors.response.use(res => {
if (res.request.responseType === 'blob' || res.request.responseType === 'arraybuffer') {
return res.data
}
if (code === 401 || code == 910) {
// 防止重复弹窗,使用延时重置锁,兼容并发请求
if (code === 401) {
if (!isRelogin.show) {
isRelogin.show = true
MessageBox.confirm(
'登录状态已过期,您可以继续留在该页面,或者重新登录',
'系统提示',
{
confirmButtonText: '重新登录',
cancelButtonText: '取消',
type: 'warning'
}
).then(() => {
// 退出登录并跳转
return store.dispatch('LogOut')
}).then(() => {
MessageBox.confirm('登录状态已过期,您可以继续留在该页面,或者重新登录', '系统提示', { confirmButtonText: '重新登录', cancelButtonText: '取消', type: 'warning' }).then(() => {
isRelogin.show = false
store.dispatch('LogOut').then(() => {
location.href = '/index'
})
}).catch(() => {
// 捕获异常,保证锁一定释放
}).finally(() => {
// 无论点确定/取消/报错,最终都解锁
isRelogin.show = false
})
}
return Promise.reject('无效的会话,或者会话已过期,请重新登录。')
} else if (code === 500 || code === 901) {
} else if (code === 500 || code === 900 || code === 901 || code === 903) {
Message({ message: msg, type: 'error' })
return Promise.reject(new Error(msg))
} else if (code === 601) {

@ -537,27 +537,17 @@ export default {
date_time: this.form.date_time,
report_id: this.form.id,
time_section: this.form.time_section,
})
.then((response) => {
if (response.code === 200) {
}).then((response) => {
this.$modal.msgSuccess("预约时间修改成功");
this.open = false;
this.$emit("getList");
} else {
this.$modal.msgError(response.msg || "预约时间修改成功失败");
}
})
.catch(() => {
this.$modal.msgError("预约时间修改成功失败");
});
} else {
//
postReportCreate({
...this.form,
exam_rooms: this.form.exam_rooms ? [this.form.exam_rooms] : [],
})
.then((response) => {
if (response.code === 200) {
}).then((response) => {
this.$modal.msgSuccess("新增成功");
this.open = false;
if (response.data && response.data.report_id) {
@ -567,12 +557,6 @@ export default {
}
);
}
} else {
this.$modal.msgError(response.msg || "新增失败");
}
})
.catch(() => {
this.$modal.msgError("新增失败");
});
}
}

@ -268,12 +268,12 @@
</el-table-column>
<el-table-column
label="预约时间"
width="200"
width="220"
align="center"
show-overflow-tooltip
>
<template slot-scope="scope">
<el-button type="text" @click="handleTimeSectionUpdate(scope.row)">
<el-button type="text" @click="handleTimeSectionUpdate(scope.row)" :disabled="scope.row.reporter_name != userInfo.name">
{{ scope.row.date_time }} {{ scope.row.time_section }}
<i class="el-icon-edit el-icon--right"></i>
</el-button>
@ -435,6 +435,8 @@ import {
postReportEquipmentList,
} from "@/api/cases/index.js";
import CaseFormDialog from "./components/CaseFormDialog.vue";
import { mapGetters } from "vuex";
export default {
name: "Case",
components: {
@ -555,6 +557,9 @@ export default {
},
};
},
computed: {
...mapGetters(["userInfo"]),
},
created() {
this.resetQuery();
this.initDataDictionaries();

Loading…
Cancel
Save