Merge branch 'main' into dev

This commit is contained in:
wanglihui 2023-12-17 21:41:55 +08:00
commit fd4859f1b7
19 changed files with 169 additions and 48 deletions

127
README.md
View File

@ -1,59 +1,136 @@
# tsdd-control
* NODE_ENV node环境变量
* APP_ENV 应用环境变量
# 唐僧叨叨后台管理
### 介绍 📖
唐僧叨叨后台管理一款基于 Vue3.3、TypeScript、Vite5、Pinia、Element-Plus 开源的后台管理框架,使用目前最新技术栈开发;是唐僧叨叨业务管理后台。
- 使用 Vue3.3 + TypeScript 开发单文件组件script setup
- 采用 Vite 作为项目开发、打包工具(配置 gzip/brotli 打包、tsx 语法、跨域代理…)
- 使用 Pinia 替代 Vuex轻量、简单、易用集成 Pinia 持久化插件
- 使用 TypeScript 对 Axios 整个二次封装(请求拦截、取消、常用请求封装…)
- 支持 Element 组件大小切换、多主题布局、暗黑模式、i18n 国际化
- 使用 VueRouter 配置动态路由权限拦截、路由懒加载,支持页面按钮权限控制
- 使用 KeepAlive 对页面进行缓存,支持多级嵌套路由缓存
- 常用自定义指令开发(权限、复制、水印、拖拽、节流、防抖、长按…)
- 使用 Prettier 统一格式化代码,集成 ESLint、Stylelint 代码校验规范
- 使用 husky、lint-staged、commitlint、czg、cz-git 规范提交信息
### 安装使用步骤 📔
环境变量
- NODE_ENV node环境变量
- APP_ENV 应用环境变量
- dev 开发环境
- pord 生产环境
* IS_CONFIG 是否添加配置文件
- IS_CONFIG 是否添加配置文件
## 安装
1. 安装
```sh
pnpm install
```
## 本地开发
2. 本地开发
``` sh
pnpm dev
```
## 编译
3. 编译
``` sh
pnpm build
```
## 配置文件编译
4. 配置文件编译
``` sh
pnpm build:config
```
## 本地预览
5. 本地预览
> 先执行编译再执行该命令
``` sh
pnpm serve
```
## eslint检测
``` sh
pnpm lint
```
### 功能特色 🔨
## eslint修复
- [x] 首页
- [x] 仪表盘
- [x] 主题设置
- [x] 用户
- [x] 新增用户
- [x] 用户列表
- [x] 发消息
- [x] 好友列表
- [x] 封禁
- [x] 封禁用户列表
- [x] 封禁
- [x] 解禁
- [x] 群组
- [x] 群列表
- [x] 发消息
- [x] 群成员
- [x] 聊天记录
- [x] 黑名单成员
- [x] 禁言
- [x] 封禁
- [x] 封禁群列表
- [x] 消息
- [x] 消息记录
- [x] 违禁词列表
- [x] 举报
- [x] 举报用户
- [x] 举报群聊
- [x] 工具
- [x] APP升级
- [x] 设置
- [x] 通用设置
- [x] 修改登录密码
### 功能截图 📷
``` sh
pnpm lint:fix
```
## prettier检测
```sh
pnpm format
```
- 首页
## Git commit
![home](./docs/home/home.png)
``` sh
pnpm cz
```
![theme](./docs/home/theme.png)
![theme](./docs/home/dark.png)
- 用户
![adduser](./docs/user/adduser.png)
![userlist](./docs/user/userlist.png)
![userlist](./docs/user/disablelist.png)
- 群组
![grouplist](./docs/group/grouplist.png)
![groupdisablelist](./docs/group/groupdisablelist.png)
- 消息
![sendmsglist](./docs/message/sendmsglist.png)
![prohibitwords](./docs/message/prohibitwords.png)
- 举报
![report-user](./docs/report/user.png)
![report-group](./docs/report/group.png)
- 工具
![appupdate](./docs/tool/appupdate.png)
- 设置
![currencysetting](./docs/setting/currencysetting.png)
![currencysetting](./docs/setting/updatepwd.png)

Binary file not shown.

After

Width:  |  Height:  |  Size: 225 KiB

BIN
docs/group/grouplist.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 414 KiB

BIN
docs/home/dark.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 316 KiB

BIN
docs/home/home.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 317 KiB

BIN
docs/home/theme.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 369 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 244 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 605 KiB

BIN
docs/report/group.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 265 KiB

BIN
docs/report/user.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 207 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 214 KiB

BIN
docs/setting/updatepwd.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 208 KiB

BIN
docs/tool/appupdate.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 265 KiB

BIN
docs/user/adduser.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 204 KiB

BIN
docs/user/disablelist.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 276 KiB

BIN
docs/user/userlist.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 521 KiB

View File

@ -24,16 +24,20 @@
</el-radio-group>
</el-form-item>
<el-form-item label="安装包">
<el-upload
ref="upload"
action="https://run.mocky.io/v3/9d059bf9-4660-45f2-925d-ce80ad6c4d15"
:limit="1"
:auto-upload="false"
>
<template #trigger>
<el-button type="primary">点击上传APK</el-button>
</template>
</el-upload>
<div class="w-100%">
<el-upload
ref="upload"
:action="actionURL"
:limit="1"
:headers="headers"
:before-upload="beforeUploadFile"
:on-success="onFileSuccess"
>
<template #trigger>
<el-button type="primary">点击上传APK</el-button>
</template>
</el-upload>
</div>
</el-form-item>
<el-form-item label="版本号">
<el-input v-model="formData.app_version" placeholder="请输入版本号" />
@ -59,25 +63,19 @@
<script lang="ts" name="BdAppVersion" setup>
import { ref } from 'vue';
import { ElMessage } from 'element-plus';
import { useUserStore } from '@/stores/modules/user';
// API
import { commonAppversionPost } from '@/api/tool';
import { feileGet } from '@/api/file';
interface IProps {
value: boolean;
}
const props = withDefaults(defineProps<IProps>(), {
value: false
});
const content = ref('');
const loaging = ref<boolean>(false);
const formData = reactive({
app_version: '',
os: 'android',
is_force: 0,
update_desc: '',
download_url: ''
});
const emits = defineEmits<{
(e: 'update:value', item: boolean): void;
(e: 'ok', item: any): void;
@ -89,6 +87,47 @@ watch(
props.value = n;
}
);
const userStore = useUserStore();
const content = ref('');
const loaging = ref<boolean>(false);
const formData = reactive({
app_version: '',
os: 'android',
is_force: 0,
update_desc: '',
download_url: ''
});
/**
* 上传图片
*/
const headers = {
token: userStore.token
};
const actionURL = ref('');
//
const beforeUploadFile = async (rawFile: any) => {
const fileData = {
path: `/${rawFile.uid}/${rawFile.name}`,
type: 'common'
};
const res = (await feileGet(fileData)) as any;
if (res.url) {
actionURL.value = res.url;
return true;
} else {
return false;
}
};
//
const onFileSuccess = (response: any, _uploadFile: any) => {
console.log(response);
formData.download_url = response.path;
};
//
const onClose = () => {
emits('update:value', false);

View File

@ -5,7 +5,7 @@ export const HOME_URL = '/home';
export const LOGIN_URL = '/login';
// 默认主题颜色
export const DEFAULT_PRIMARY = '#5371FF';
export const DEFAULT_PRIMARY = '#E4633B';
// 路由白名单地址(必须是本地存在的路由 staticRouter.ts 中)
export const ROUTER_WHITE_LIST: string[] = ['/login'];

View File

@ -51,7 +51,7 @@
</div>
</div>
<!-- 新增版本 -->
<bd-app-version v-model:value="appVersionAddValue" />
<bd-app-version v-model:value="appVersionAddValue" @ok="onAppVersionOk" />
</bd-page>
</template>
@ -133,6 +133,11 @@ const appVersionAddValue = ref<boolean>(false);
const onAppVersionAdd = () => {
appVersionAddValue.value = true;
};
//
const onAppVersionOk = () => {
getTableList();
};
//
onMounted(() => {
getTableList();