|
@@ -12,18 +12,21 @@
|
|
|
</el-tab-pane>
|
|
|
</el-tabs>
|
|
|
</div>
|
|
|
+
|
|
|
+
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
|
- import { watch,ref,markRaw} from "vue"
|
|
|
+ import { watch,ref,markRaw,h} from "vue"
|
|
|
|
|
|
import vHeader from "../components/Header.vue"
|
|
|
import vSidetree from "../components/Sidetree.vue"
|
|
|
import { storeToRefs } from 'pinia'
|
|
|
import { useHomeStore } from "../store/home.js"
|
|
|
-
|
|
|
-
|
|
|
+ import app from '../utils/app.js'
|
|
|
+ import {ElMessageBox,ElMessage} from 'element-plus'
|
|
|
+ import loginAPI from "../api/login.js"
|
|
|
|
|
|
const store=useHomeStore()
|
|
|
const { collapse ,currentMenu,menuTabs,activeTab} = storeToRefs(store)
|
|
@@ -49,6 +52,46 @@
|
|
|
})
|
|
|
|
|
|
const loadMenuPage=(val)=>import(/* @vite-ignore */`/src/pages/${val}`)
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ watch(
|
|
|
+ ()=>store.connStatus
|
|
|
+ ,(newVal,oldVal)=>{
|
|
|
+ if(newVal!=401){
|
|
|
+ return
|
|
|
+ }
|
|
|
+ openRelogin()
|
|
|
+ })
|
|
|
+
|
|
|
+ const openRelogin=()=>{
|
|
|
+ return ElMessageBox.prompt('登录已失效,请重新登录',null,{
|
|
|
+ showCancelButton:false,
|
|
|
+ showInput:true,
|
|
|
+ inputType:'password',
|
|
|
+ inputPlaceholder:'请输入密码',
|
|
|
+ inputPattern:/\S+/,
|
|
|
+ inputErrorMessage:'密码不能为空',
|
|
|
+ closeOnClickModal:false,
|
|
|
+ beforeClose: async (action, instance, done) => {
|
|
|
+ //console.log(action)
|
|
|
+ //console.log(instance.inputValue)
|
|
|
+ instance.confirmButtonLoading = true
|
|
|
+ try{
|
|
|
+ let resp=await loginAPI.checkLogin({loginId:app.takeSetting('loginId'),pwd:instance.inputValue})
|
|
|
+
|
|
|
+ done()
|
|
|
+ }
|
|
|
+ catch(err){
|
|
|
+ instance.confirmButtonLoading=false
|
|
|
+ ElMessage.error(err);
|
|
|
+ console.log(err)
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ })
|
|
|
+
|
|
|
+ }
|
|
|
</script>
|
|
|
|
|
|
<style scoped>
|