当前位置: 首页 > news >正文

自己做的视频网站如何赚钱吗做网站软件_手机

自己做的视频网站如何赚钱吗,做网站软件_手机,比特币做空网站,微网站怎么做的好你的 Loading 开箱即可用的 loading#xff0c; 说明#xff1a;vue3-loading 是一个方便在 Vue 3 项目中使用的加载指示器组件的 npm 插件。它允许您轻松地在项目中添加加载动画#xff0c;提升用户体验。 目录 你的 Loading#x1f30d; 安装#x1f6f9; 演示地址…你的 Loading 开箱即可用的 loading 说明vue3-loading 是一个方便在 Vue 3 项目中使用的加载指示器组件的 npm 插件。它允许您轻松地在项目中添加加载动画提升用户体验。 目录 你的 Loading 安装 演示地址 使用方法说明 你的 Pinia 加密插件 安装 使用方法 加密和解密 安装 npm install vue3-loading-plug演示地址 http://project.webcats.cn/bx/43924/16191 使用方法 说明 内置两种loading 【可自行配置】 ​ Loading 是 大loading 可以用于刷新项目页面、路由跳转 。在路由中引入一次 即可全局生效极简配置 ​ smallLoading 是小圆圈 loading一般用于接口请求展示。可以请求拦截器中开启全局接口生效极简配置 在你的主应用程序入口文件例如 main.js中导入并使用 loading import Loading from vue3-loading-plug; app.use(Loading).mount(#app);如果是 ts 请在 global.d.ts 加入 类型 declare module vue3-loading-plug;router router.beforeEach((to, from, next) {if (to.meta.loading) app.config.globalProperties.$Loading.showLoading();next(); });router.afterEach((to) {if (to.meta.loading) app.config.globalProperties.$Loading.hideLoading(); });scrvies // 请求拦截器 service.interceptors.request.use((config) {// 在发送请求之前做些什么app.config.globalProperties.$smallLoading.showLoading();return config;},(error) {// 对请求错误做些什么app.config.globalProperties.$smallLoading.hideLoading();return Promise.reject(error);} );// 封装错误提示函数 Token过期、网络链接错误等 const tipError (value: string, title: string) {ElMessageBox.alert(value, title, {confirmButtonText: 重新登录,type: warning,}).then(() {// Session.clear(); // 清除临时缓存// 清除cookiedocument.cookie.split(;).forEach(fnction (c) {document.cookie c.replace(/^ /, ).replace(/.*/, ;expires new Date().toUTCString() ;path/);});window.location.reload(); // 刷新页面}); };// 响应拦截器 service.interceptors.response.use((response) {// 对响应数据做点什么 这里只返回成功响应数据app.config.globalProperties.$smallLoading.hideLoading();return response.data;},(error) {// 对响应错误数据做点什么这里只显示错误消息app.config.globalProperties.$smallLoading.hideLoading();/* axios.isCancel(error) 是 Axios 库中的一个方法用于判断一个错误对象是否是由于请求取消导致的。当使用 axios.CancelToken 取消请求时会抛出一个带有一个 message 属性的错误对象。axios.isCancel(error) 的作用就是判断这个错误对象的类型如果是由请求取消导致的错误则返回 true否则返回 false。console.log(打印cancelToken.cancel(xxx)传入来的值, error.message);*/if (axios.isCancel(error)) {ElMessage.error(error.message); // 显示错误消息} else {// 不是由请求取消导致的错误let errorMessage; // 错误提示变量const statusData error.response?.data; // 错误data数据const describeForNameMap [[() error.message.indexOf(timeout) ! -1,() (errorMessage 网络超时 ),],[() error.message Network Error,() (errorMessage 网络连接错误 ),],[() statusData.code 100010011,() {// 100010011 token过期errorMessage statusData.message;tipError(errorMessage, 登录过期);},],// 否则 显示错误消息[() statusData, () (errorMessage statusData.message)],];// 获取符合条件的子数组const getDescribe describeForNameMap.find((item) item[0]());// 执行子数组中的函数getDescribe getDescribe[1]();ElMessage.error(errorMessage); // 显示错误消息}} );// 导出 service将其命名为axios , 同时还导出了一个名为cancelToken的变量取消请求 export { service as axios, cancelToken }; 你的 Pinia 加密插件 你的 Pinia 加密插件是一个基于 Pinia 的实用工具用于在 Vue.js 应用程序中加密和解密敏感数据。它提供了一种简单且安全的方式来保护你的数据。 安装 你可以使用 npm 或 yarn 安装插件 pnpm i vue3-encryption-plugin使用方法 在你的主应用程序入口文件例如 main.js中导入并使用 Pinia store 以及加密插件 // main.js import { createApp } from vue; import { createPinia } from pinia; import App from ./App.vue; import EncryptionPlugin from vue3-encryption-plugin;const app createApp(App);const pinia createPinia(); app.use(pinia);// 注册加密插件并提供自定义的密钥可选例如随机的字符串 app.use(EncryptionPlugin, { key: your-custom-secret-key });app.mount(#app);加密和解密 一旦你设置了插件你就可以在组件中使用 $encrypt 和 $decrypt 方法 第一种 getCurrentInstance() !-- YourComponent.vue --import { getCurrentInstance } from vue;setup(){// 获取当前组件的上下文下面两种方式都能获取到组件的上下文。const { ctx } getCurrentInstance(); // 方式一这种方式只能在开发环境下使用生产环境 下的ctx将访问不到const { proxy }: any getCurrentInstance(); // 方式二此方法在开发环境以及生产环境下都能到组件上下文对象推荐// ctx 中包含了组件中由ref和reactive创建的响应式数据对象,以及以下对象及方法;proxy.$attrsproxy.$dataproxy.$elproxy.$emitproxy.$forceUpdateproxy.$nextTickproxy.$optionsproxy.$parentproxy.$propsproxy.$refsproxy.$rootproxy.$slotsproxy.$watch}function handClick() {console.log(这里输出 ,proxy.$encryptionPlugin.encryptData({ name: zk, age: 26}));console.log(这里输出 ,proxy.$encryptionPlugin.decryptData(U2FsdGVkX1/PBDHn2pyLPAf6DmolvylM2QEIDhcf5I3WQWhOh19eos0uZfdbzdDP)); }第二种 injict (推荐) 1src / types / global.d.ts 定义类型 // 加密解密 declare interface EncryptionPlugin {encryptData: T(data: T) string;decryptData: T(encryptedData: string) T; }如果你使用 eslint 请在 .eslintrc.cjs 文件中添加 globals: {// 以下是全局变量 eslint 不会报EncryptionPlugin is not defined.eslint no-undefEncryptionPlugin: readonly,$encryptionPlugin: readonly,},2 页面使用 script setup langts import { inject } from vue;// 使用 inject 函数获取 encryptionPlugin const encryptionPlugin inject(encryptionPlugin) as EncryptionPlugin;function handClick() {// 现在你可以在你的组件中使用 encryptData 和 decryptData 方法了const encryptedData encryptionPlugin.encryptData(Hello World);const decryptedData encryptionPlugin.decryptData(encryptedData);console.log(加密 , encryptedData);console.log(解密 , decryptedData); } /script
http://wiki.neutronadmin.com/news/212936/

相关文章:

  • wordpress免费建站吗wordpress教程之
  • 网站网页设计项目计划书温州微网站制作多少钱
  • vue做网站的好处机器封所有端口 不支持做网站
  • wordpress固定链接分类广告优化是做什么的
  • 汉中网站建设电话阜阳公司做网站
  • 网站建设移动网络公司禁用 wordpress 自带 jquery
  • 盐城市城南新区建设局网站哪些网站可以做视频收费
  • 如何建立一个企业的网站wordpress pdf 免费
  • 北京时代 网站建设北京科技公司名单
  • 广东长城建设集团有限公司 网站网站优化外链
  • 做暖暖视频网站seo发包技术教程
  • 关于推进公司网站开发的请示电子烟网站建设
  • 关于asp.net的网站模板在线网页制作
  • 网站seo系统山东电力建设第一工程公司网站
  • 网页制作网站开发建筑投标网站
  • 请seo的人帮做网站排名产品设计欣赏
  • 网站开发专业分数线重庆网站建设开发公司
  • flash网站的优势一个网站怎么做2个服务器
  • 利用国外网站文章图片做书营利广州安全教育平台登陆
  • 厦门帮忙建设网站网站开发范例文档
  • 小游戏网站怎么做建站温州营销网站公司哪家好
  • seo优化百度seo谷歌seo外贸推广网站seo优化运帝国网站数据库配置文件
  • 一万元做网站房屋3d设计软件
  • 青岛做网站建公司north WordPress教程
  • 桂林北站到象鼻山景区怎么坐车深圳网站建设选哪家
  • 过期的网站域名wordpress 资讯主题
  • 壹六八信息科技网站建设体育网站建设的必要性
  • 蓝图网站建设工作流软件
  • 怎样做动漫照片下载网站义乌手工活外发加工网160网
  • 怎么在微信公众号上做网站重庆市工程建设信息网中项网