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

zdppy+vue3+onlyoffice文档管理系统项目实战 20240812上课笔记

遗留问题

1、增加新建和导入按钮,有按钮了,但是还没有完善,图标还不对,需要解决
2、登录功能
3、用户管理
4、角色管理
5、权限管理
6、分享功能

解决新建和导入的图标问题

解决代码:

<a-button type="primary":icon="h(PlusOutlined)"style="display: flex; align-items: center;">新建
</a-button>
<a-button:icon="h(VerticalAlignBottomOutlined)"style="display: flex; align-items: center;">导入
</a-button>

在这里插入图片描述

遗留的问题

1、登录功能
2、用户管理
3、角色管理
4、权限管理
5、分享功能

登录功能

先分析要做什么,怎么做?

  • 1、添加登录页面
  • 2、设计登录界面的基本布局
  • 3、添加登录表单
  • 4、给登录按钮绑定事件,点击时获取登录信息
  • 5、设计登录的接口
  • 6、前后端联调,实现登录功能
  • 7、要记录登录的Token和用户名,跳转到首页

1、添加登录页面

加一个vue文件,然后在vue-router中注册,浏览器访问。

<script setup></script><template><h1>登录界面</h1>
</template><style scoped></style>
{path: '/login',component: () => import("../page/auth/login.vue"),
},

在这里插入图片描述

2、设计登录界面的基本布局

布局的基本设计:
在这里插入图片描述

代码的基本实现:

<template><div class="flex h-screen"><div class="left w-8/12 bg-red-300">左边</div><div class="right w-4/12 bg-teal-200">右边</div></div>
</template>

预览:
在这里插入图片描述

3、添加登录表单

代码:

<script setup>
import { reactive } from 'vue';
const formState = reactive({username: '',password: '',remember: true,
});
const onFinish = values => {console.log('Success:', values);
};
const onFinishFailed = errorInfo => {console.log('Failed:', errorInfo);
};
</script><template><div class="flex h-screen"><div class="w-8/12 bg-purple-500 flex justify-center items-center flex-col"><h1 class="text-white font-bold text-5xl">xx文档管理系统</h1><h3 class="text-gray-200 text-2xl mt-3">欢迎登录本系统</h3></div><div class="w-4/12 bg-blue-500 flex justify-center items-center"><a-card style="width: 60%"><a-form:model="formState":label-col="{ span: 8 }":wrapper-col="{ span: 16 }"autocomplete="off"@finish="onFinish"><a-form-itemlabel="账号"name="username":rules="[{ required: true, message: '账号不能为空' }]"><a-input v-model:value="formState.username" /></a-form-item><a-form-itemlabel="密码"name="password":rules="[{ required: true, message: '密码不能为空' }]"><a-input-password v-model:value="formState.password" /></a-form-item><a-form-item :wrapper-col="{ offset: 8, span: 16 }"><a-button type="primary" html-type="submit">立即登录</a-button></a-form-item></a-form></a-card></div></div>
</template><style scoped></style>

预览:
在这里插入图片描述

添加验证码

准备验证码的静态图片:
在这里插入图片描述

导入:

import pngCaptcha from "../../assets/img/captcha.png"

使用:

<img :src="pngCaptcha">

完整代码:

<script setup>
import {reactive} from 'vue';
import pngCaptcha from "../../assets/img/captcha.png"const formState = reactive({username: '',password: '',captcha: '',
});
const onFinish = values => {console.log('Success:', values);
};
const onFinishFailed = errorInfo => {console.log('Failed:', errorInfo);
};
</script><template><div class="flex h-screen"><div class="w-8/12 bg-purple-500 flex justify-center items-center flex-col"><h1 class="text-white font-bold text-5xl">xx文档管理系统</h1><h3 class="text-gray-200 text-2xl mt-3">欢迎登录本系统</h3></div><div class="w-4/12 bg-blue-500 flex justify-center items-center"><a-card style="width: 60%"><a-form:model="formState":label-col="{ span: 8 }":wrapper-col="{ span: 16 }"autocomplete="off"@finish="onFinish"><a-form-itemlabel="账号"name="username":rules="[{ required: true, message: '账号不能为空' }]"><a-input v-model:value="formState.username"/></a-form-item><a-form-itemlabel="密码"name="password":rules="[{ required: true, message: '密码不能为空' }]"><a-input-password v-model:value="formState.password"/></a-form-item><a-form-itemlabel="验证码"name="captcha":rules="[{ required: true, message: '验证码不能为空' }]"><a-input-password v-model:value="formState.captcha"/><img :src="pngCaptcha"style="width: 100%; height: 50px; margin-top: 10px"></a-form-item><a-form-item :wrapper-col="{ offset: 8, span: 16 }"><a-button type="primary" html-type="submit">立即登录</a-button></a-form-item></a-form></a-card></div></div>
</template><style scoped></style>

效果预览:
在这里插入图片描述

4、给登录按钮绑定事件,点击时获取登录信息

之前的代码已经具备了这样的功能:
在这里插入图片描述

5、设计登录的接口

zdppy框架有一个非常强大的权限组件模块,提供完整登录,注册,权限管理等相关的功能,我们不需要重新编写接口,只需要引入并使用即可。

  • 6、前后端联调,实现登录功能
  • 7、要记录登录的Token和用户名,跳转到首页

遗留的问题

1、登录功能

  • 5、设计登录的接口
  • 6、前后端联调,实现登录功能
  • 7、要记录登录的Token和用户名,跳转到首页

2、注册功能
3、用户管理
4、角色管理
5、权限管理
6、分享功能

tb_user拆成基本信息和详细信息两张表。

http://www.lryc.cn/news/421729.html

相关文章:

  • 怎么将mov视频转换成mp4?将mov视频转换成mp4的方法
  • 大数据技术——实战项目:广告数仓(第五部分)
  • 计算机毕业设计 家电销售展示平台 Java+SpringBoot+Vue 前后端分离 文档报告 代码讲解 安装调试
  • C# 根据MySQL数据库中数据,批量删除OSS上的垃圾文件
  • Vue3+Element-plus+setup使用vuemap/vue-amap实现高德地图API相关操作
  • Windows配置开机直达桌面并跳过锁屏登录界面在 Windows 10 中添加在启动时自动运行的应用
  • pythonUI自动化007::pytest的组成以及运行
  • 开放式耳机哪个品牌好用又实惠?五大口碑精品分享
  • 代码随想录算法训练营day39||动态规划07:多重背包+打家劫舍
  • WebSocket革新:用PHP实现实时Web通信
  • Python教程(十三):常用内置模块详解
  • Linux 下的进程状态
  • 【设计模式】六大基本原则
  • Selenium网页的滚动
  • 图算法系列1: 图算法的分类有哪些?(上)
  • 零样本学习——从多语言语料库数据中对未学习语言进行语音识别的创新技术
  • ViewStub的原理
  • 十一、Spring AOP
  • 【网络】IP的路径选择——路由控制
  • Unity动画模块 之 2D IK(反向动力学)
  • 关于kickstart自动安装脚本以及dhcp的设置
  • AWS云服务器选择最佳区域
  • Unity Android端截图保存并获取展示
  • linux高级编程——文件IO
  • windows C++-在 C++/WinRT 中使用委托处理事件(下)
  • 【实用工具】Stirling-PDF: 优质开源的PDF处理工具/编辑工具-含入门安装教程
  • opencv 深度图视差图可视化案例
  • Golang | Leetcode Golang题解之第330题按要求补齐数组
  • 算法训练(leetcode)第五十二天 | Bellman_ford 队列优化算法(SPFA)、BF算法判断负回路、BF之单源有限最短路(有负回路)
  • SpringBoot中整合RabbitMQ(测试+部署上线 最完整)