增加退出系统的确认提示。
This commit is contained in:
		@@ -25,15 +25,32 @@
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script lang="ts">
 | 
			
		||||
import { ElMessageBox } from "element-plus";
 | 
			
		||||
import { logout } from "@/utils/account.js";
 | 
			
		||||
 | 
			
		||||
export default {
 | 
			
		||||
    name: "LayoutHeader",
 | 
			
		||||
    setup()
 | 
			
		||||
    {
 | 
			
		||||
        const Logout = () =>
 | 
			
		||||
        /**
 | 
			
		||||
         * 退出登录
 | 
			
		||||
         */
 | 
			
		||||
        const Logout = ():void =>
 | 
			
		||||
        {
 | 
			
		||||
            logout();
 | 
			
		||||
            ElMessageBox.confirm(
 | 
			
		||||
                "是否要退出系统?",
 | 
			
		||||
                "",
 | 
			
		||||
                {
 | 
			
		||||
                    confirmButtonText: "是",
 | 
			
		||||
                    cancelButtonText: "否",
 | 
			
		||||
                    type: "warning",
 | 
			
		||||
                }
 | 
			
		||||
            )
 | 
			
		||||
                .then(() =>
 | 
			
		||||
                {
 | 
			
		||||
                    // debugger;
 | 
			
		||||
                    logout();
 | 
			
		||||
                });
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
        return { Logout, };
 | 
			
		||||
 
 | 
			
		||||
@@ -7,7 +7,6 @@
 | 
			
		||||
 *
 | 
			
		||||
 * Copyright (c) ${2022} by Kane, All Rights Reserved.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
import { type AxiosResponse } from "axios";
 | 
			
		||||
import { service as instance } from "./api/request.js";
 | 
			
		||||
import { API_URL } from "./api/config.js";
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user