修改拦截器提示 修复操作栏状态 修复退出登录缓存清空不完整

main
JayChou 3 days ago
parent 8d10a89e72
commit cdf11ae8c9
  1. 5
      src/utils/auth.ts
  2. 1
      src/utils/request.ts
  3. 2
      src/views/compiler/index.vue
  4. 5
      src/views/designRoute/index.vue
  5. 4
      src/views/largeDataScreen/home.vue
  6. 3
      src/views/program/index.vue

@ -14,9 +14,10 @@ const clearLocalStorage = () => {
localStorage.removeItem("product"); localStorage.removeItem("product");
localStorage.removeItem("installationStep"); localStorage.removeItem("installationStep");
localStorage.removeItem("stepIds"); localStorage.removeItem("stepIds");
// localStorage.removeItem("wenduCode"); localStorage.removeItem("graph_operations");
// localStorage.removeItem("shiduCode"); localStorage.removeItem("graph_operations1");
localStorage.removeItem('isStudy') localStorage.removeItem('isStudy')
localStorage.removeItem('complete')
} }
export { export {

@ -47,6 +47,7 @@ server.interceptors.response.use(
return Promise.reject(response); return Promise.reject(response);
case 200: case 200:
case 0: case 0:
return response.data; return response.data;
default: default:
ElMessage.error(message); ElMessage.error(message);

@ -8,7 +8,7 @@
</div> </div>
</div> </div>
<div class="setting"> <div class="setting">
<el-button @click="saveCode" v-if="!isShowStrring">保存</el-button> <el-button @click="saveCode" v-if="isShowStrring">保存</el-button>
<el-button @click="router.back()" v-else>返回</el-button> <el-button @click="router.back()" v-else>返回</el-button>
</div> </div>
</div> </div>

@ -840,8 +840,7 @@ const onRedo = () => {
const wenduCode = "float a;a=1000000*M*S/W;T+(1-exp(-t/a))*100+T0;if(T>=100){T=100;}"; const wenduCode = "float a;a=1000000*M*S/W;T+(1-exp(-t/a))*100+T0;if(T>=100){T=100;}";
const shiduCode = "float b;a=10000*S0/W1;R+(1-exp(-t1/b))*100+R0;if(R>=100){R=100;}"; const shiduCode = "float b;a=10000*S0/W1;R+(1-exp(-t1/b))*100+R0;if(R>=100){R=100;}";
const onSave = () => { const onSave = () => {
setStepEvent(3, formatDate(new Date()));
settingStore.activeStepIndex =4
// console.log(removeDuplicateEdges(formatEdges()), standardData); // console.log(removeDuplicateEdges(formatEdges()), standardData);
// return // return
@ -854,6 +853,8 @@ const onSave = () => {
if(settingStore.shiduCode != shiduCode){ if(settingStore.shiduCode != shiduCode){
return ElMessage.error("湿度代码编写错误"); return ElMessage.error("湿度代码编写错误");
} }
setStepEvent(3, formatDate(new Date()));
settingStore.activeStepIndex =4
ElMessage.success("保存成功"); ElMessage.success("保存成功");
settingStore.setValue( true,'saveRoute'); settingStore.setValue( true,'saveRoute');
localStorage.setItem('saveRoute',true) localStorage.setItem('saveRoute',true)

@ -834,7 +834,7 @@ const isShowStrring = Boolean(localStorage.getItem("falg")) || false;
// labView // labView
const goToLabView = async () => { const goToLabView = async () => {
if (!isShowStrring) { if (isShowStrring) {
await setStepEvent(1, formatDate(new Date())); await setStepEvent(1, formatDate(new Date()));
useSettingStore.activeStepIndex = 2; useSettingStore.activeStepIndex = 2;
} }
@ -842,7 +842,7 @@ const goToLabView = async () => {
router.push("/program"); router.push("/program");
}; };
const goToLabIdea = async () => { const goToLabIdea = async () => {
if (!isShowStrring) { if (isShowStrring) {
await setStepEvent(7, formatDate(new Date())); await setStepEvent(7, formatDate(new Date()));
useSettingStore.activeStepIndex = 8; useSettingStore.activeStepIndex = 8;
} }

@ -39,7 +39,7 @@
</el-form-item> </el-form-item>
</el-form> </el-form>
</el-drawer> </el-drawer>
<div class="setting" v-if="!isShowStrring"> <div class="setting" v-if="isShowStrring">
<el-button @click="onUndo">撤回</el-button> <el-button @click="onUndo">撤回</el-button>
<el-button @click="onRedo">恢复</el-button> <el-button @click="onRedo">恢复</el-button>
<el-button @click="clearLocalStorage">清除缓存</el-button> <el-button @click="clearLocalStorage">清除缓存</el-button>
@ -1535,6 +1535,7 @@ const exportWord = async () => {
}) })
dialogVisible.value = false; dialogVisible.value = false;
ElMessage.success('保存成功') ElMessage.success('保存成功')
localStorage.removeItem("falg");
await setStepEvent(11, formatDate(new Date())); await setStepEvent(11, formatDate(new Date()));
useSettingStore.activeStepIndex = 12 useSettingStore.activeStepIndex = 12
router.push('/studyPage') router.push('/studyPage')

Loading…
Cancel
Save