vue3 腳手架初始化項目生成文件的介紹

在這里插入圖片描述

文章目錄

  • 一、介紹
  • 二、舉例說明
    • 1.src/http/index.js
    • 2.src/router/index.js
    • 3.src/router/routes.js
    • 4.src/stores/index.js
    • 5.src/App.vue
    • 6.src/main.js
    • 7.babel.config.js
    • 8.jsconfig.json
    • 9.vue.config.js
    • 10. .env
    • 11.src/mock/index.js
    • 12.src/mock/mock-i18n.js
    • 13.src/locales/en.json
    • 14.src/locales/zh.json
    • 15.src/locales/index.js
    • 16.src/views/pages/system/system.js
    • 17. .gitignore
    • 18.package.json

一、介紹

  • node_modules文件夾:項目依賴文件夾
  • public文件夾:一般放置一些靜態資源(圖片),需要注意,放在public文件夾中的靜態資源,在webpack打包時,會原封不動的打包到dist文件夾中。
  • src文件夾(程序員源代碼文件夾):
    • assets文件夾:一般也是放置靜態資源(一般放置多個組件共用的靜態資源),需要注意,放在assets文件夾里的靜態資源,在webpack打包時,會把此靜態資源當作一個模塊,打包到JS文件中。
    • components文件夾:一般放置非路由組件(全局組件)。
    • http文件夾:
      • index.js:集中管理 HTTP 請求的配置和處理邏輯,使得在應用中發送 HTTP 請求變得更加簡單和一致。通過使用 Axios 實例和攔截器,可以有效地管理請求和響應,處理身份驗證和錯誤情況,確保用戶體驗的流暢性。
    • App.vue文件:唯一的根組件。
    • main.js文件:程序的入口文件,也是整個程序當中最先執行的文件。
    • pages|views文件夾:路由組件。
    • router文件夾:路由相關配置。
      • index.js:配置路由
      • routes.js:路由規則定義(該文件夾可有可無,可全部放在上面index.js中)
    • store文件夾:
      • index.js:vuex相關配置。
    • utils文件夾:該文件夾里面經常放一些常用的功能模塊,比如正則、臨時身份UUID等等。
    • locales:
      • en.json:英文詞條
      • zh.json:中文詞條
      • index.js:國際化相關配置
    • mock文件夾:模擬json文件及相關接口調用
      • index.js:是一個用于模擬 API 響應的模塊,通常在前端開發中使用。它利用 mockjs 庫來創建虛擬的 API 接口,以便在開發和測試過程中不依賴于后端服務。以下是這個文件的主要功能和組成部分。
      • mock-i18n.js:模擬的詞條文件。
  • babel.config.js文件:babel配置文件(bable相關)。
  • package.json文件:相當于項目的“身份證”,記錄了項目的相關信息(如名字、依賴、運行方式等等)。
  • package-lock.json文件:又叫“緩存性文件”,跟蹤被安裝的每個軟件包的確切版本,以便產品可以以相同的方式被 100% 復制(即使軟件包的維護者更新了軟件包)。即為什么剛開始啟動慢,而后面啟動就很快?因為緩存性文件都記錄下來相關信息了,所以后續啟動很快。
  • README.md文件:項目的說明性文件
  • vue.config.js文件:用于關閉ESLINT校驗工具+配置代理服務器解決跨域
  • jsconfig.json文件:給src文件夾簡寫方法,配置別名,方便引入資源

在這里插入圖片描述
在這里插入圖片描述

二、舉例說明

1.src/http/index.js

/*** @Name:* @Author:賈志博* @description:*/
import axios, { AxiosInstance, AxiosResponse } from "axios";
import {useStore} from "@/stores";// 創建http請求的實例對象
const $http = axios.create({timeout: 30000,withCredentials: false,headers: {'Content-Type': 'application/json;charset=UTF-8','Access-Control-Allow-Origin': '*','X-Requested-With': 'XMLHttpRequest'}
});// 添加請求攔截器
// $http.interceptors.request.use((config) => {
//   const token = ''
//   if (token) {
//     config.headers.Authorization = token;
//   }
//   return config;
// }, (error) => {
//   return Promise.reject(error)
// });// 添加響應攔截器
$http.interceptors.response.use(response=> {const { data } = responseif (response.status === 200) {return data}},error => {if (error.status === 401) {sessionStorage.removeItem('principal');localStorage.removeItem('mldn-session-id')// 路由跳轉到登錄界面window.location.href = `${window.location.origin}/#/`} else if (error.status == 502) {sessionStorage.removeItem('principal');localStorage.removeItem('mldn-session-id')window.location.href = `${window.location.origin}/#/`}return Promise.resolve({code: error.status})}
);const Method = {GET: 'get',POST: 'post',DELETE: 'delete',PUT: 'put',
}export { $http,  Method };

2.src/router/index.js

import { createRouter, createWebHashHistory } from 'vue-router'
import { baseRoutes, routes } from "./routes";
import { useStore } from "@/stores";
import {queryUserMenu} from "@/views/pages/system/system";
import { commonResponse } from "@/views/pages/_common";
import { getSystemType } from "@/views/login/_request";const router = createRouter({history: createWebHashHistory(process.env.BASE_URL),routes: baseRoutes
})
let permissionRoutes = []
let permissionMap = new Map()router.beforeEach((to, from, next) => {var principal = localStorage.getItem('mldn-session-id');var session_prncipal = sessionStorage.getItem('principal');const userName = localStorage.getItem("xnms-user-name");if (session_prncipal == null && principal == null) {principal = null;}if (principal == null) {if (to.name === 'login') {useStore().hasAuth = false;next()} else {useStore().hasAuth = false;next({name: 'login'})}} else if (to.name === 'login') {if(permissionRoutes.length > 0) {const initRouterPush = "/pages/" + permissionRoutes[0].path + "/" + permissionRoutes[0].children[0].path;useStore().setSelectedMenuKeyFunction(permissionRoutes[0].path)useStore().setSelectedMenuItemKeyFunction([permissionRoutes[0].path + "_" + permissionRoutes[0].children[0].path]);useStore().setOpenMenuItemFunction([permissionRoutes[0].path]);next({path: initRouterPush, replace: true});} else {hasAuthHandle(to, next, userName);}} else {hasAuthHandle(to, next, userName);}
});const hasAuthHandle = (to, next, userName) => {if(!useStore().hasAuth) {getSystemType().then(resp => {localStorage.setItem('system-type', resp.data)useStore().setMode(resp.data)queryUserMenu(userName).then(response => {commonResponse({response,onSuccess: () => {permissionRoutes = []permissionMap = new Map()try {const deepRoutes =  JSON.parse(JSON.stringify(routes));fillPermissionMap(permissionMap, response)permissionRoutes = handleRoutes(deepRoutes, permissionMap)if (permissionRoutes.length > 0) {useStore().routes.value = permissionRoutespermissionRoutes.forEach(item => {router.addRoute('pages', item)})}} catch (error) {console.error("Error during deep copy:", error);}useStore().hasAuth = true// 檢查 to 是否在動態加載的路由里const isRouteExists = permissionRoutes.some(route => {if (route.name === to.name || route.path === to.path) {return true;}if (route.children) {return route.children.some(childRoute => {return childRoute.name === to.name || childRoute.path === to.path;});}return false;});if (isRouteExists) {next({...to, replace: true})} else {// 如果 to 不在動態路由里,可以導航到默認頁面if (permissionRoutes.length > 0) {const initRouterPush = "/pages/" + permissionRoutes[0].path + "/" + permissionRoutes[0].children[0].path;useStore().setSelectedMenuKeyFunction(permissionRoutes[0].path)useStore().setSelectedMenuItemKeyFunction([permissionRoutes[0].path + "_" + permissionRoutes[0].children[0].path]);useStore().setOpenMenuItemFunction([permissionRoutes[0].path]);next({path: initRouterPush, replace: true});}}}})})})} else {next()}
}const fillPermissionMap = (permissionMap, response) => {const userName = localStorage.getItem('xnms-user-name')if (userName == "Admin") {response.data?.forEach(item => {const { code, canLook, canEdit } = item;permissionMap.set(code, {view: canLook == true ? 1 : 0,edit: canEdit == true ? 1 : 0})})} else {response.data?.forEach(item => {const { code, canLook, canEdit } = item;if (code.length === 4) {permissionMap.set(code, {view: canLook == true ? 1 : 0,edit: canEdit == true ? 1 : 0})}})response.data?.forEach(item => {const { code} = item;if (code.length === 2) {const children = response.data.filter(child => child.pid === code);const hasViewVisibleChild = children.some(child => child.canLook === 1);const hasEditVisibleChild = children.some(child => child.canEdit === 1);permissionMap.set(code, {view: hasViewVisibleChild ? 1 : 0,edit: hasEditVisibleChild ? 1 : 0});}})}
}const handleRoutes = (routes, permissionMap) => {for (let i = 0; i < routes.length; i++) {const item = routes[i]if (permissionMap?.get(routes[i].meta.key)?.view) {routes[i].meta.edit = permissionMap?.get(routes[i].meta.key)?.editif (item.children?.length) {handleRoutes(item.children, permissionMap)} else {if (!item.component) {let fileExistCommon = truelet pathStr = ''try {const path = item.name.split('_')pathStr = path.reduce((pre, cur, index) => {return `${pre}/${index === path.length - 1 ? cur.charAt(0).toUpperCase() + cur.slice(1) : cur}`})require(`@/views/pages/${pathStr}.vue`)} catch (e) {fileExistCommon = false}let fileExistDiff = trueconst modeName = useStore().getMode() ? 'XPT' : 'NOR'try {require(`@/views/pages/${pathStr}-${modeName}.vue`)} catch (e) {fileExistDiff = false}if (fileExistDiff) {item.component = () => import(`@/views/pages/${pathStr}-${modeName}.vue`)} else if (fileExistCommon) {item.component = () => import(`@/views/pages/${pathStr}.vue`)} else {item.component = () => import('@/views/pages/_error/404.vue')}}}} else {routes.splice(i, 1)i--}}return routes
}export default router

3.src/router/routes.js

import Login from "@/views/login/index.vue";
import Index from "@/views/pages/index.vue";export const baseRoutes = [{path: '/',name: 'login',component: Login,},{path: '/pages',name: 'pages',component: Index,children: []}
]export const routes = [{path: 'topology',name: 'topology',meta: {key: '00'},children: [{path: 'topologyView',name: 'topology_topologyView',breadcrumb: 'menu_topoView',meta: {key: '0000'},},{path: 'electronicMap',name: 'topology_electronicMap',breadcrumb: 'menu_electronicMap',meta: {key: '0001'},},]}
]

4.src/stores/index.js

import {defineStore} from "pinia";
import {ref} from 'vue'export const useStore = defineStore('main', () => {const mode = ref(0)const setMode = (modeVal) => {mode.value = modeVal}const getMode = () => {return mode.value}const openMenuItem = ref([]);const setOpenMenuItemFunction = (modeVal) => {openMenuItem.value = modeVal}const getOpenMenuItemFunction = () => {return openMenuItem}const selectedMenuItemKey = ref(null);const setSelectedMenuItemKeyFunction = (modeVal) => {selectedMenuItemKey.value = modeVal}const getSelectedMenuItemKeyFunction = () => {return selectedMenuItemKey}const selectedMenuKey = ref("");const setSelectedMenuKeyFunction = (modeVal) => {selectedMenuKey.value = modeVal}const getSelectedMenuKeyFunction = () => {return selectedMenuKey}const hasAuth = ref(false)const routes = ref([])const popoverVisible = ref(false);const popoverPosition = ref({ top: 0, left: 0 });const selectTopoNode = ref(null)const websocketRepeaterList = ref([])return {getMode,setMode,setSelectedMenuKeyFunction,getSelectedMenuKeyFunction,setSelectedMenuItemKeyFunction,getSelectedMenuItemKeyFunction,setOpenMenuItemFunction,getOpenMenuItemFunction,hasAuth,routes,popoverVisible,popoverPosition,selectTopoNode,websocketRepeaterList,}
})

使用方式:在其他xx.vue頁面中

import { useStore } from "@/stores";useStore().hasAuth = false;

5.src/App.vue

<template><router-view/>
</template><script setup>
import {reactive, provide} from "vue";
import {useI18n} from "vue-i18n";
import {useStore} from "@/stores";
import {getSystemLanguage} from "@/views/pages/system/system";
const userInfo = reactive({userId: '',token: ''
})
provide('t', useI18n().t)
provide('userInfo', userInfo)const getSystemMode = () => {getSystemLanguage().then(response => {const mode = response.dataif (mode) {localStorage.setItem('xnms-mode', mode)useStore().setMode(parseInt(mode))}})
}getSystemMode()
</script><style>
</style>

6.src/main.js

import { createApp } from 'vue';
import App from './App.vue';
import { createPinia } from "pinia";
// import getRouter from '@/router';
import router from '@/router'
import getI18n from '@/locales';
import SelfComponents from "@/views/pages/_common/selfComponents/index";
import ArcoVue, {Message} from '@arco-design/web-vue';
import ArcoVueIcon from '@arco-design/web-vue/es/icon';
import '@arco-design/web-vue/dist/arco.css';
import '@/assets/index.less';
window.Message = Message
if (process.env.NODE_ENV === 'development') {// import('@/mock')
}const store = createPinia()const promise = Promise.all([getI18n()])
const _beforeMount = await promise
// window.i18n = _beforeMount[0]const app = createApp(App)
app.use(_beforeMount[0]).use(router).use(ArcoVue).use(ArcoVueIcon).use(store).use(SelfComponents)
app.mount('#app')

7.babel.config.js

module.exports = {presets: ['@vue/cli-plugin-babel/preset']
}

8.jsconfig.json

{"compilerOptions": {"target": "es5","module": "esnext","baseUrl": "./","moduleResolution": "node","paths": {"@/*": ["src/*"]},"lib": ["esnext","dom","dom.iterable","scripthost"]}
}

9.vue.config.js

const { defineConfig } = require('@vue/cli-service')
const path = require('path')
// const target = 'http://127.0.0.1:61000/'
// const target = 'http://10.110.24.117:62000/'
const target = 'http://10.110.24.62:61000/'
module.exports = defineConfig({// publicPath: process.env.NODE_ENV === 'development' ? '' : '/XNMS',transpileDependencies: true,lintOnSave: false,assetsDir: 'assets',devServer: {proxy: {'/api': {target,changeOrigin: true,},}},pluginOptions: {i18n: {locale: 'en',fallbackLocale: 'en',localeDir: 'locales',enableLegacy: false,runtimeOnly: false,compositionOnly: false,fullInstall: true}},chainWebpack: config => {config.module.rule('svg').exclude.add(path.resolve('src/assets/svg'))config.module.rule('icons').test(/\.svg$/).include.add(path.resolve('src/assets/svg')).end().use('svg-sprite-loader').loader('svg-sprite-loader').options({ symbolId: 'icon-[name]' })}
})

10. .env

VUE_APP_I18N_LOCALE=en
VUE_APP_I18N_FALLBACK_LOCALE=en

11.src/mock/index.js

import Mock from 'mockjs'
import {i18nList} from './mock-i18n'Mock.mock('/menu/list', 'get', {status: 0,dataList: [{path: 'topology',children: [{path: 'topologyView',name: 'topology_topologyView',},{path: 'electronicMap',name: 'topology_electronicMap',},]}]
})Mock.mock('/api/in', 'get', {code: 200,data: 1,msg: "成功",pagination: null
})Mock.mock(/^\/api\/in\/[\S]*$/, 'get', {code: 200,msg: '',data: {...i18nList()}
})Mock.mock('/api/site_statistic', 'post', {"code": 200,"data": [{"businessData": {"datas": {"additionalProp1": 1,"additionalProp2": 2,"additionalProp3": 3,"additionalProp4": 4,"additionalProp5": 5},},"siteData": {"datas": {"additionalProp1": 1,"additionalProp2": 2,"additionalProp3": 3,"additionalProp4": 4,"additionalProp5": 5},},"siteID": 1,"siteAlias": "站點1",},{"businessData": {"datas": {"additionalProp1": 1,"additionalProp2": 2,"additionalProp3": 3,"additionalProp4": 4,"additionalProp5": 5},},"siteData": {"datas": {"additionalProp1": 1,"additionalProp2": 2,"additionalProp3": 3,"additionalProp4": 4,"additionalProp5": 5},},"siteID": 2,"siteAlias": "站點2",}],"msg": "string","pagination": {"currentPage": 0,"pageSize": 0,"totalPages": 0,"totalRecords": 0}
})Mock.mock('/api/getTransferBusinessData', 'post', {code: 200,data: [{id: '1',name: '站點1',byDateLine: [{date: '2021-01-01',value1: 1,value2: 2}, {date: '2021-01-02',value1: 3,value2: 4}, {date: '2021-01-04',value1: 3,value2: 6}],byBusinessTimePie: {1: 2,2: 4,3: 6,4: 1,5: 3},byTimeLine: [{date: '2021-01-01',value1: 1,value2: 2}, {date: '2021-01-02',value1: 3,value2: 4}, {date: '2021-01-04',value1: 3,value2: 6}],},{id: '2',name: '站點2',byDateLine: [{date: '2021-01-01',value1: 1,value2: 2}, {date: '2021-01-02',value1: 3,value2: 4}, {date: '2021-01-04',],}]
})

12.src/mock/mock-i18n.js

export const i18nList = () => {return {"Title": "XNMS客戶端","XPTTitle": "XNMS","Login": "登  錄","LoginCancel": "取消登錄","LoginCheckPassword": "驗證中…",}
}

13.src/locales/en.json

{"menu_topology": "Topology View","menu_alarm": "Monitoring Alarm","menu_device": "Equipment Parameters","menu_data": "Data Query","menu_business": "Business Statistics",
}

14.src/locales/zh.json

{"menu_topology": "拓撲展示","menu_alarm": "監控告警","menu_device": "設備參數","menu_data": "數據查詢","menu_business": "業務統計",
}

15.src/locales/index.js

import { createI18n } from 'vue-i18n'
import {getI18nLanguagePkg, getNowLanguageType} from "@/views/login/_request";const getNowLanguage = async () => {return new Promise((resolve, reject) => {getNowLanguageType().then(response => {if (response.code === 200) {resolve(response.data)} else {window.Message.warning(response.msg)}})})
}const loadRemoteMessages = async (language) => {return new Promise((resolve, reject) => {getI18nLanguagePkg(language).then(response => {if (response.code === 200) {const messages = {}messages[languageEnum[language]] = response.dataresolve(messages)} else {window.Message.warning(response.msg)}})})
}const getI18n = async () => {const language = await getNowLanguage()localStorage.setItem('xnms-language', language)const remoteMessages = await loadRemoteMessages(language)const i18n = createI18n({legacy: false,locale: languageEnum[language],fallbackLocale: 'zh',messages: remoteMessages,globalInjection: true})return new Promise((resolve) => {resolve(i18n)})
}const languageEnum = {0: 'en',1: 'zh',2: 'ru'
}export default getI18n

16.src/views/pages/system/system.js

import { $http, Method } from "@/http";export const getDeviceManageList = (data) => {return $http({url: `/api/deviceManage/queryDeviceList`,method: Method.POST,data})
}export const getSystemLanguage = (data) => {return $http({url: `/api/config`,method: Method.GET,data})
}export const deleteDevice = (data) => {return $http({url: `/api/deviceManage/deleteRepeater`,method: Method.DELETE,data})
}export const updateDevive = (data) => {return $http({url: `/api/deviceManage/updateDeviceSnmpV3`,method: Method.PUT,data})
}

17. .gitignore

.DS_Store
node_modules
/dist# local env files
.env.local
.env.*.local# Log files
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*# Editor directories and files
.idea
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?

18.package.json

{"name": "xnms","version": "0.1.0","private": true,"scripts": {"serve": "vue-cli-service serve","build": "vue-cli-service build","lint": "vue-cli-service lint","i18n:report": "vue-cli-service i18n:report --src \"./src/**/*.?(js|vue)\" --locales \"./src/locales/**/*.json\""},"dependencies": {"axios": "^1.7.7","core-js": "^3.8.3","echarts": "^5.5.1","html2canvas": "^1.4.1","jspdf": "^3.0.0","leaflet": "^1.9.4","leaflet-polylinedecorator": "^1.6.0","less": "^4.2.0","less-loader": "^12.2.0","mockjs": "^1.1.0","moment": "^2.30.1","pinia": "^2.2.2","svg-sprite-loader": "^6.0.11","vue": "^3.2.13","vue-i18n": "^9.1.0","vue-router": "^4.0.3"},"devDependencies": {"@arco-design/web-vue": "^2.56.2","@babel/core": "^7.12.16","@babel/eslint-parser": "^7.12.16","@intlify/vue-i18n-loader": "^3.0.0","@vue/cli-plugin-babel": "~5.0.0","@vue/cli-plugin-eslint": "~5.0.0","@vue/cli-plugin-router": "~5.0.0","@vue/cli-service": "~5.0.0","eslint": "^7.32.0","eslint-plugin-vue": "^8.0.3","vue-cli-plugin-i18n": "~2.3.2","vue-cli-plugin-mock": "~1.0.3"},"eslintConfig": {"root": true,"env": {"node": true},"extends": ["plugin:vue/vue3-essential","eslint:recommended"],"parserOptions": {"parser": "@babel/eslint-parser"},"rules": {}},"browserslist": ["> 1%","last 2 versions","not dead","not ie 11"]
}

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/web/74976.shtml
繁體地址,請注明出處:http://hk.pswp.cn/web/74976.shtml
英文地址,請注明出處:http://en.pswp.cn/web/74976.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

ubuntu 20.04 編譯和運行A-LOAM

1.搭建文件目錄和clone代碼 mkdir -p A-LOAM/src cd A-LOAM/src git clone https://github.com/HKUST-Aerial-Robotics/A-LOAM cd .. 2.修改代碼文件 2.1 由于PCL版本1.10&#xff0c;將CMakeLists.txt中的C標準改為14&#xff1a; set(CMAKE_CXX_FLAGS "-stdc14"…

【教程】MacBook 安裝 VSCode 并連接遠程服務器

目錄 需求步驟問題處理 需求 在 Mac 上安裝 VSCode&#xff0c;并連接跳板機和服務器。 步驟 Step1&#xff1a;從VSCode官網&#xff08;https://code.visualstudio.com/download&#xff09;下載安裝包&#xff1a; Step2&#xff1a;下載完成之后&#xff0c;直接雙擊就能…

LabVIEW 長期項目開發

LabVIEW 憑借其圖形化編程的獨特優勢&#xff0c;在工業自動化、測試測量等領域得到了廣泛應用。對于長期運行、持續迭代的 LabVIEW 項目而言&#xff0c;其開發過程涵蓋架構設計、代碼管理、性能優化等多個關鍵環節&#xff0c;每個環節都對項目的成功起著至關重要的作用。下面…

用matlab搭建一個簡單的圖像分類網絡

文章目錄 1、數據集準備2、網絡搭建3、訓練網絡4、測試神經網絡5、進行預測6、完整代碼 1、數據集準備 首先準備一個包含十個數字文件夾的DigitsData&#xff0c;每個數字文件夾里包含1000張對應這個數字的圖片&#xff0c;圖片的尺寸都是 28281 像素的&#xff0c;如下圖所示…

Go 語言語法精講:從 Java 開發者的視角全面掌握

《Go 語言語法精講&#xff1a;從 Java 開發者的視角全面掌握》 一、引言1.1 為什么選擇 Go&#xff1f;1.2 適合 Java 開發者的原因1.3 本文目標 二、Go 語言環境搭建2.1 安裝 Go2.2 推薦 IDE2.3 第一個 Go 程序 三、Go 語言基礎語法3.1 變量與常量3.1.1 聲明變量3.1.2 常量定…

如何選擇優質的安全工具柜:材質、結構與功能的考量

在工業生產和實驗室環境中&#xff0c;安全工具柜是必不可少的設備。它不僅承擔著工具的存儲任務&#xff0c;還直接影響工作環境的安全和效率。那么&#xff0c;如何選擇一個優質的安全工具柜呢&#xff1f;關鍵在于對材質、結構和功能的考量。 01材質&#xff1a;耐用與防腐 …

系統與網絡安全------Windows系統安全(11)

資料整理于網絡資料、書本資料、AI&#xff0c;僅供個人學習參考。 制作U啟動盤 U啟動程序 下載制作U啟程序 Ventoy是一個制作可啟動U盤的開源工具&#xff0c;只需要把ISO等類型的文件拷貝到U盤里面就可以啟動了 同時支持x86LegacyBIOS、x86_64UEFI模式。 支持Windows、L…

【5】搭建k8s集群系列(二進制部署)之安裝master節點組件(kube-controller-manager)

注&#xff1a;承接專欄上一篇文章 一、創建配置文件 cat > /opt/kubernetes/cfg/kube-controller-manager.conf << EOF KUBE_CONTROLLER_MANAGER_OPTS"--logtostderrfalse \\ --v2 \\ --log-dir/opt/kubernetes/logs \\ --leader-electtrue \\ --kubeconfig/op…

C#里第一個WPF程序

WPF程序對界面進行優化,但是比WINFORMS的程序要復雜很多, 并且界面UI基本上不適合拖放,所以需要比較多的時間來布局界面, 產且需要開發人員編寫更多的代碼。 即使如此,在面對誘人的界面表現, 隨著客戶對界面的需求提高,還是需要采用這樣的方式來實現。 界面的樣式采…

createContext+useContext+useReducer組合管理React復雜狀態

createContext、useContext 和 useReducer 的組合是 React 中管理全局狀態的一種常見模式。這種模式非常適合在不引入第三方狀態管理庫&#xff08;如 Redux&#xff09;的情況下&#xff0c;管理復雜的全局狀態。 以下是一個經典的例子&#xff0c;展示如何使用 createContex…

記一次常規的網絡安全滲透測試

目錄&#xff1a; 前言 互聯網突破 第一層內網 第二層內網 總結 前言 上個月根據領導安排&#xff0c;需要到本市一家電視臺進行網絡安全評估測試。通過對內外網進行滲透測試&#xff0c;網絡和安全設備的使用和部署情況&#xff0c;以及網絡安全規章流程出具安全評估報告。本…

el-table,新增、復制數據后,之前的勾選狀態丟失

需要考慮是否為 更新數據的方式不對 如果新增數據的方式是直接替換原數據數組&#xff0c;而不是通過正確的響應式數據更新方式&#xff08;如使用 Vue 的 this.$set 等方法 &#xff09;&#xff0c;也可能導致勾選狀態丟失。 因為 Vue 依賴數據的響應式變化來準確更新視圖和…

第15屆藍橋杯java-c組省賽真題

目錄 一.拼正方形 1.題目 2.思路 3.代碼 二.勁舞團 1.題目 2.思路 3.代碼 三.數組詩意 1.題目 2.思路 3.代碼 四.封閉圖形個數 1.題目 2.思路 3.代碼 五.吊墜 1.題目 六.商品庫存管理 1.題目 2.思路 3.代碼 七.挖礦 1.題目 2.思路 3.代碼 八.回文字…

玄機-應急響應-入侵排查

靶機排查目標&#xff1a; 1.web目錄存在木馬&#xff0c;請找到木馬的密碼提交 查看/var/www/html。 使用find命令查找 find ./ -type f -name "*.php | xargs grep "eval("查看到1.php里面存在無條件一句話木馬。 2.服務器疑似存在不死馬&#xff0c;請找…

usbip學習記錄

USB/IP: USB device sharing over IP make menuconfig配置&#xff1a; Device Drivers -> Staging drivers -> USB/IP support Device Drivers -> Staging drivers -> USB/IP support -> Host driver 如果還有作為客戶端的需要&#xff0c;繼續做以下配置&a…

愛普生高精度車規晶振助力激光雷達自動駕駛

在自動駕駛技術快速落地的今天&#xff0c;激光雷達作為車輛的“智慧之眼”&#xff0c;其測距精度與可靠性直接決定了自動駕駛系統的安全上限。而在這雙“眼睛”的核心&#xff0c;愛普生&#xff08;EPSON&#xff09;的高精度車規晶振以卓越性能成為激光雷達實現毫米級感知的…

28--當路由器開始“宮斗“:設備控制面安全配置全解

當路由器開始"宮斗"&#xff1a;設備控制面安全配置全解 引言&#xff1a;路由器的"大腦保衛戰" 如果把網絡世界比作一座繁忙的城市&#xff0c;那么路由器就是路口執勤的交通警察。而控制面&#xff08;Control Plane&#xff09;就是警察的大腦&#xf…

58.基于springboot老人心理健康管理系統

目錄 1.系統的受眾說明 2.相關技術 2.1 B/S結構 2.2 MySQL數據庫 3.系統分析 3.1可行性分析 3.1.1時間可行性 3.1.2 經濟可行性 3.1.3 操作可行性 3.1.4 技術可行性 3.1.5 法律可行性 3.2系統流程分析 3.3系統功能需求分析 3.4 系統非功能需求分析 4.系統設計 …

去中心化固定利率協議

核心機制與分類 協議類型&#xff1a; 借貸協議&#xff08;如Yield、Notional&#xff09;&#xff1a;通過零息債券模型&#xff08;如fyDai、fCash&#xff09;鎖定固定利率。 收益聚合器&#xff08;如Saffron、BarnBridge&#xff09;&#xff1a;通過風險分級或博弈論…

反射率均值與RCS均值的計算方法差異

1. 反射率均值&#xff08;Mean Reflectance&#xff09; 定義&#xff1a; 反射率是物體表面反射的電磁波能量與入射能量的“比例”&#xff0c;通常以百分比或小數表示。 反射率均值是對多個測量點反射率的算術平均&#xff0c;反映目標區域整體的平均反射特性。 特點&a…