Skip to content

Commit

Permalink
chore: modfify 2 alova
Browse files Browse the repository at this point in the history
  • Loading branch information
chansee97 committed Mar 15, 2024
1 parent 87a70d9 commit 76f15c8
Show file tree
Hide file tree
Showing 17 changed files with 300 additions and 263 deletions.
24 changes: 14 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@

<div align='center'>

**English** | [中文](./README.zh-CN.md)
English | [中文](./README.zh-CN.md)
</div>

## 🌈introduction
## introduction

[Nova-admin](https://github.com/chansee97/nova-admin) A free and open-source template for middle platform/back-end based on Vue3, Vite4, Typescript, pinia, Naive UI, and Vue-Router to help improve the development efficiency of middle platform/back-end

## features
## features

- **Latest popular technology stack** - Developed based on the latest technology stack such as Vue3, Vite, TypeScript, NaiveUI, Pinia, etc
- **Network request function encapsulation** - Perfect axios encapsulation and configuration, unified response processing and multi-scenario capability
Expand All @@ -28,7 +28,7 @@
- **Theme Configuration** - Dark Theme Adaptation
- **Code Specification** - Only perform eslint verification at commit time, no too many restrictions, easier development

## 😎project preview & display
## project preview & display

- [Nova-Admin preview](https://admin-nova.vercel.app/)

Expand All @@ -38,11 +38,11 @@
![image.png](https://s2.loli.net/2023/10/10/cy8nrv1kSLpjCT9.png)
![image.png](https://s2.loli.net/2023/10/10/rACdG2fUI6oJN7H.png)

## 💎related projects
## related projects

- [Nova-admin-nest](https://github.com/chansee97/nove-admin-nest) (under development) Nova-Admin supporting background project based on TS, NestJs, typeorm

## 🚧install and use
## install and use

The local development environment is recommended to use pnpm 8.x, Node.js 16.x

Expand All @@ -58,22 +58,26 @@ pnpm build

```

## 🙌 learn to communicate
## learn to communicate

Nova-Admin is a completely open-source and free project. It is still being optimized and iterated. It is designed to help developers more conveniently develop medium and large management systems. If you have any questions, please ask questions in the QQ exchange group.

![image.png](https://s2.loli.net/2023/08/26/PQJjURT7V46Lw2d.png)

## 🧩contribution
## contribution

If you find any issues or have suggestions for improvement, please create an issue or submit a PR. We welcome your contributions!

## 🤗support
## support

If you feel that this project is helpful for your work or study, please help me order a ✨ Star, which will be a great encouragement and support for me, or you can buy me a cup of coffee below

![sponsor](https://cdn.jsdelivr.net/gh/chansee97/static/sponsor.png)

## 🧾License
## [Contributors](https://github.com/chansee97/nova-admin/graphs/contributors)

![Contributors](https://contrib.rocks/image?repo=chansee97/nova-admin)

## License

[MIT](LICENSE)
24 changes: 14 additions & 10 deletions README.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@

<div align='center'>

[English](./README.md) | **中文**
[English](./README.md) | 中文
</div>

## 🌈 介绍
## 介绍

[Nova-admin](https://github.com/chansee97/nova-admin)一个基于Vue3、Vite4、Typescript、pinia、Naive UI、Vue-Router的后台管理免费开源模板,助力提高中后台开发效率

## 特性
## 特性

- **最新流行技术栈** - 基于Vue3、Vite、TypeScript、NaiveUI、Pinia等最新技术栈开发
- **网络请求功能封装** - 完善的axios封装和配置,统一的响应处理和多场景能力
Expand All @@ -28,7 +28,7 @@
- **主题配置** - 黑暗主题适配
- **代码规范** - 仅在提交时进行eslint校验,没有过多限制,开发更简便

## 😎 项目预览&展示
## 项目预览&展示

- [Nova-Admin 预览](https://admin-nova.vercel.app/)

Expand All @@ -38,11 +38,11 @@
![image.png](https://s2.loli.net/2023/10/10/cy8nrv1kSLpjCT9.png)
![image.png](https://s2.loli.net/2023/10/10/rACdG2fUI6oJN7H.png)

## 💎 相关项目
## 相关项目

- [Nova-admin-nest](https://github.com/chansee97/nove-admin-nest) (开发中)基于TS, NestJs, typeorm的Nova-Admin配套后台项目

## 🚧 安装使用
## 安装使用

本地开发环境建议使用 pnpm 8.x 、Node.js 16.x

Expand All @@ -58,22 +58,26 @@ pnpm build

```

## 🙌 学习交流
## 学习交流

Nova-Admin 是完全开源免费的项目,目前仍然在优化迭代中,旨在帮助开发者更方便地进行中大型管理系统开发,有使用问题欢迎在QQ交流群内提问。

![image.png](https://s2.loli.net/2023/08/26/PQJjURT7V46Lw2d.png)

## 🧩贡献
## 贡献

如果您发现了任何问题或有改进建议,请创建一个issue或提交一个PR。我们欢迎您的贡献!

## 🤗 支持
## 支持

如果感觉本项目对你工作或学习有帮助,请帮我点一个✨Star,这将是对我极大的鼓励与支持, 也可以在下方请我喝一杯咖啡

![sponsor](https://cdn.jsdelivr.net/gh/chansee97/static/sponsor.png)

## 🧾License
## [贡献者](https://github.com/chansee97/nova-admin/graphs/contributors)

![Contributors](https://contrib.rocks/image?repo=chansee97/nova-admin)

## 协议

[MIT](LICENSE)
31 changes: 14 additions & 17 deletions index.html
Original file line number Diff line number Diff line change
@@ -1,20 +1,17 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link
rel="icon"
href="/favicon.svg" />
<meta
name="viewport"
content="width=device-width, initial-scale=1.0" />
<title>%VITE_APP_NAME%</title>
</head>
<body>
<div id="appLoading"></div>
<div id="app"></div>
<script
type="module"
src="/src/main.ts"></script>
</body>

<head>
<meta charset="UTF-8" />
<link rel="icon" href="/favicon.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>%VITE_APP_NAME%</title>
</head>

<body>
<div id="appLoading"></div>
<div id="app"></div>
<script type="module" src="/src/main.ts"></script>
</body>

</html>
16 changes: 9 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"admin-template",
"vue-admin",
"vue-admin-template",
"Vite4",
"Vite5",
"Vite",
"vite-admin",
"TypeScript",
Expand All @@ -44,17 +44,14 @@
"build:dev": "vue-tsc --noEmit && vite build --mode dev",
"build:test": "vue-tsc --noEmit && vite build --mode test",
"preview": "vite preview",
"lint": "eslint . --fix",
"lint": "eslint .",
"lint:fix": "eslint . --fix",
"sizecheck": "npx vite-bundle-visualizer"
},
"config": {
"commitizen": {
"path": "./node_modules/cz-customizable"
}
},
"dependencies": {
"@tinymce/tinymce-vue": "^5.1.1",
"@vueuse/core": "^10.9.0",
"alova": "^2.17.1",
"axios": "^1.6.7",
"crypto-js": "^4.2.0",
"echarts": "^5.5.0",
Expand Down Expand Up @@ -91,6 +88,11 @@
"vite-plugin-svg-icons": "^2.0.1",
"vue-tsc": "^1.8.27"
},
"workspaces": {
"packages": [
"packages/*"
]
},
"simple-git-hooks": {
"pre-commit": "pnpm lint-staged"
},
Expand Down
10 changes: 5 additions & 5 deletions src/service/api/login.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
import { mockRequest } from '../http'
import { alovaInstance } from '../http'

interface Ilogin {
username: string
password: string
}

export function fetchLogin(params: Ilogin) {
return mockRequest.post<any>('/login', params)
return alovaInstance.Post<any>('/login', params)
}
export function fetchUpdateToken(params: any) {
return mockRequest.post<ApiAuth.loginToken>('/updateToken', params)
return alovaInstance.Post<ApiAuth.loginToken>('/updateToken', params)
}
export function fetchUserInfo(params: any) {
return mockRequest.get<Auth.UserInfo>('/getUserInfo', { params })
return alovaInstance.Get<Auth.UserInfo>('/getUserInfo', { params })
}
export function fetchUserRoutes(params: { id: number }) {
return mockRequest.get<AppRoute.Route[]>('/getUserRoutes', { params })
return alovaInstance.Get<AppRoute.Route[]>('/getUserRoutes', { params })
}
4 changes: 2 additions & 2 deletions src/service/api/mock.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { mockRequest } from '../http'
import { alovaInstance } from '../http'

export function fetchUserList() {
return mockRequest.get('/userList')
return alovaInstance.Get('/userList')
}
36 changes: 18 additions & 18 deletions src/service/api/test.ts
Original file line number Diff line number Diff line change
@@ -1,45 +1,45 @@
import { mockRequest, request } from '../http'
import qs from 'qs'
import { alovaInstance } from '../http'

/* get方法测试 */
export function fetachGet(params?: any) {
return request.get('/getAPI', { params })
return alovaInstance.Get('/getAPI', { params })
}
/* post方法测试 */
export function fetachPost(data: any) {
return request.post('/postAPI', data)
return alovaInstance.Post('/postAPI', data)
}
/* formPost方法测试 */
export function fetachFormPost(data: any) {
return request.formPost('/postAPI', data)
return alovaInstance.Post('/postAPI', qs.stringify(data), {
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
},
})
}
/* delete方法测试 */
export function fetachDelete() {
return request.delete('/deleteAPI')
return alovaInstance.Delete('/deleteAPI')
}
/* put方法测试 */
export function fetachPut(data: any) {
return request.put('/putAPI', data)
return alovaInstance.Put('/putAPI', data)
}

/* 测试状态码500失败 */
export function testFailedRequest() {
return request.get('/filedRequest')
return alovaInstance.Get('/serverError')
}

/* 测试业务码500失败 */
export function testFailedResponse() {
return request.get('/filedResponse')
return alovaInstance.Post('/businessError')
}
/* 测试token刷新接口 */
export function testUpdataToken() {
return request.get('/updataToken')
/* token失效的接口 */
export function expiredTokenRequest() {
return alovaInstance.Get('/expiredToken')
}
/* 测试token刷新接口 */
export function testFailedResponse_NT() {
return request.get('/failedResponse_NT')
}

/* mock方法测试 */
export function fetchMock() {
return mockRequest.post('/login')
export function refreshToken() {
return alovaInstance.Get('/updataToken')
}
Loading

0 comments on commit 76f15c8

Please sign in to comment.