Refactor code structure and remove redundant changes
24
.gitignore
vendored
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
# Nuxt dev/build outputs
|
||||||
|
.output
|
||||||
|
.data
|
||||||
|
.nuxt
|
||||||
|
.nitro
|
||||||
|
.cache
|
||||||
|
dist
|
||||||
|
|
||||||
|
# Node dependencies
|
||||||
|
node_modules
|
||||||
|
|
||||||
|
# Logs
|
||||||
|
logs
|
||||||
|
*.log
|
||||||
|
|
||||||
|
# Misc
|
||||||
|
.DS_Store
|
||||||
|
.fleet
|
||||||
|
.idea
|
||||||
|
|
||||||
|
# Local env files
|
||||||
|
.env
|
||||||
|
.env.*
|
||||||
|
!.env.example
|
||||||
75
README.md
Normal file
@ -0,0 +1,75 @@
|
|||||||
|
# Nuxt Minimal Starter
|
||||||
|
|
||||||
|
Look at the [Nuxt documentation](https://nuxt.com/docs/getting-started/introduction) to learn more.
|
||||||
|
|
||||||
|
## Setup
|
||||||
|
|
||||||
|
Make sure to install dependencies:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# npm
|
||||||
|
npm install
|
||||||
|
|
||||||
|
# pnpm
|
||||||
|
pnpm install
|
||||||
|
|
||||||
|
# yarn
|
||||||
|
yarn install
|
||||||
|
|
||||||
|
# bun
|
||||||
|
bun install
|
||||||
|
```
|
||||||
|
|
||||||
|
## Development Server
|
||||||
|
|
||||||
|
Start the development server on `http://localhost:3000`:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# npm
|
||||||
|
npm run dev
|
||||||
|
|
||||||
|
# pnpm
|
||||||
|
pnpm dev
|
||||||
|
|
||||||
|
# yarn
|
||||||
|
yarn dev
|
||||||
|
|
||||||
|
# bun
|
||||||
|
bun run dev
|
||||||
|
```
|
||||||
|
|
||||||
|
## Production
|
||||||
|
|
||||||
|
Build the application for production:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# npm
|
||||||
|
npm run build
|
||||||
|
|
||||||
|
# pnpm
|
||||||
|
pnpm build
|
||||||
|
|
||||||
|
# yarn
|
||||||
|
yarn build
|
||||||
|
|
||||||
|
# bun
|
||||||
|
bun run build
|
||||||
|
```
|
||||||
|
|
||||||
|
Locally preview production build:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# npm
|
||||||
|
npm run preview
|
||||||
|
|
||||||
|
# pnpm
|
||||||
|
pnpm preview
|
||||||
|
|
||||||
|
# yarn
|
||||||
|
yarn preview
|
||||||
|
|
||||||
|
# bun
|
||||||
|
bun run preview
|
||||||
|
```
|
||||||
|
|
||||||
|
Check out the [deployment documentation](https://nuxt.com/docs/getting-started/deployment) for more information.
|
||||||
202
api/channel/index.ts
Normal file
@ -0,0 +1,202 @@
|
|||||||
|
import { get, post, Delete, put } from '@/utils/axios'
|
||||||
|
import {
|
||||||
|
TpageReq,
|
||||||
|
TpageRes,
|
||||||
|
TcreateReq,
|
||||||
|
TlistRes,
|
||||||
|
TGetChannelPostsRes,
|
||||||
|
PageResultPostsCommentRespVO,
|
||||||
|
sendSingleChatReq,
|
||||||
|
PageResultSessionRespVO,
|
||||||
|
PageResultMessageRespVO,
|
||||||
|
ChannelRespVO,
|
||||||
|
MemberUserRespDTO,
|
||||||
|
SingleMessageVo,
|
||||||
|
} from './types'
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得频道帖子分页
|
||||||
|
* @return {Promise}
|
||||||
|
*/
|
||||||
|
export const page = (params: TpageReq) => {
|
||||||
|
return get<IResponse<TpageRes>>({
|
||||||
|
url: '/prod-api/app-api/business/posts/page',
|
||||||
|
params,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建帖子
|
||||||
|
* @return {Promise}
|
||||||
|
*/
|
||||||
|
export const create = (params: TcreateReq) => {
|
||||||
|
return post<IResponse<number>>({
|
||||||
|
url: '/prod-api/app-api/business/posts/create',
|
||||||
|
data: params,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获得论坛频道列表
|
||||||
|
* @return {Promise}
|
||||||
|
*/
|
||||||
|
export const list = () => {
|
||||||
|
return get<IResponse<TlistRes[]>>({
|
||||||
|
url: '/prod-api/app-api/business/channel/list',
|
||||||
|
})
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获得论坛频道列表
|
||||||
|
* @return {Promise}
|
||||||
|
*/
|
||||||
|
export const getChannelPosts = (params: { id: number }) => {
|
||||||
|
return get<IResponse<TGetChannelPostsRes[]>>({
|
||||||
|
url: '/prod-api/app-api/business/posts/get',
|
||||||
|
params,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 删除频道帖子
|
||||||
|
* @return {Promise}
|
||||||
|
*/
|
||||||
|
export const postsDelete = (params: { id: number }) => {
|
||||||
|
return Delete<IResponse<boolean>>({
|
||||||
|
url: '/prod-api/app-api/business/posts/delete',
|
||||||
|
params,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取帖子详情
|
||||||
|
* @return {Promise}
|
||||||
|
*/
|
||||||
|
export const getChannelDetail = (params: { id: string }) => {
|
||||||
|
return get<IResponse<TGetChannelPostsRes>>({
|
||||||
|
url: '/prod-api/app-api/business/posts/get',
|
||||||
|
params,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取帖子评论列表
|
||||||
|
* @return {Promise}
|
||||||
|
*/
|
||||||
|
export const postscommentpage = (params: { postsId: string; pageNo: number; pageSize: number }) => {
|
||||||
|
return get<IResponse<PageResultPostsCommentRespVO>>({
|
||||||
|
url: '/prod-api/app-api/business/posts-comment/page',
|
||||||
|
params,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 创建帖子评论
|
||||||
|
* @return {Promise}
|
||||||
|
*/
|
||||||
|
export const createPostsComment = (params: { postsId: string; content: string; commentId?: string }) => {
|
||||||
|
return post<IResponse<number>>({
|
||||||
|
url: '/prod-api/app-api/business/posts-comment/create',
|
||||||
|
data: params,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 发送单聊信息
|
||||||
|
* @return {Promise}
|
||||||
|
*/
|
||||||
|
export const sendSingleChat = (params: sendSingleChatReq) => {
|
||||||
|
return post<IResponse<any>>({
|
||||||
|
url: '/prod-api/app-api/mqtt/message/send/single',
|
||||||
|
data: params,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 发送客服消息
|
||||||
|
*/
|
||||||
|
export const sendKefuMessage = (params: SingleMessageVo) => {
|
||||||
|
return post<IResponse<any>>({
|
||||||
|
url: '/prod-api/app-api/mqtt/message/send/kefu',
|
||||||
|
data: params,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得消息记录分页
|
||||||
|
*/
|
||||||
|
export const getMessagePage = (params: { pageNo: number; pageSize: number; fromId?: number; msgType?: number; topic: string }) => {
|
||||||
|
return get<IResponse<PageResultMessageRespVO>>({
|
||||||
|
url: '/prod-api/app-api/mqtt/message/page',
|
||||||
|
params,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 会话列表
|
||||||
|
*/
|
||||||
|
export const conversationList = () => {
|
||||||
|
return get<IResponse<PageResultSessionRespVO[]>>({
|
||||||
|
url: '/prod-api/app-api/mqtt/session/list',
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取聊天记录
|
||||||
|
*/
|
||||||
|
export const getChatDetail = (params: { sessionId: number; pageNo: number; pageSize: number }) => {
|
||||||
|
return get<IResponse<PageResultMessageRespVO>>({
|
||||||
|
url: '/prod-api/app-api/mqtt/message/pageBySession',
|
||||||
|
params,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 清空未读信息
|
||||||
|
*/
|
||||||
|
export const clearUnreadMessage = (params: { id: number }) => {
|
||||||
|
return put<IResponse<boolean>>({
|
||||||
|
url: '/prod-api/app-api/mqtt/session/clear',
|
||||||
|
params,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得论坛频道
|
||||||
|
*/
|
||||||
|
export const getChannelLunTanDetail = (params: { id: string }) => {
|
||||||
|
return get<IResponse<ChannelRespVO>>({
|
||||||
|
url: '/prod-api/app-api/business/channel/get',
|
||||||
|
params,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建论坛关注
|
||||||
|
*/
|
||||||
|
export const createChannelFollow = (params: { channelId: string }) => {
|
||||||
|
return post<IResponse<boolean>>({
|
||||||
|
url: '/prod-api/app-api/business/channel-follow/create',
|
||||||
|
data: params,
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'application/x-www-form-urlencoded',
|
||||||
|
},
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除论坛关注
|
||||||
|
*/
|
||||||
|
export const deleteChannelFollow = (params: { channelId: string }) => {
|
||||||
|
return Delete<IResponse<boolean>>({
|
||||||
|
url: '/prod-api/app-api/business/channel-follow/delete',
|
||||||
|
params,
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'application/x-www-form-urlencoded',
|
||||||
|
},
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据群组ID获取群组成员
|
||||||
|
*/
|
||||||
|
export const getGroupMembers = (params: { channelId: string }) => {
|
||||||
|
return get<IResponse<MemberUserRespDTO[]>>({
|
||||||
|
url: `/prod-api/app-api/mqtt/session/users/${params.channelId}`,
|
||||||
|
})
|
||||||
|
}
|
||||||
223
api/channel/types.ts
Normal file
@ -0,0 +1,223 @@
|
|||||||
|
export interface TpageReq {
|
||||||
|
pageNo: number
|
||||||
|
pageSize: number
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface TpageRes {
|
||||||
|
total: number
|
||||||
|
list: {
|
||||||
|
postsId: number
|
||||||
|
channelId: number
|
||||||
|
postsTitle: string
|
||||||
|
postsCover: string
|
||||||
|
postsContent: string
|
||||||
|
postsTags: string
|
||||||
|
projectDicId: number
|
||||||
|
browseNum: number
|
||||||
|
likeNum: number
|
||||||
|
createTime: string
|
||||||
|
creator: string
|
||||||
|
creatorName: string
|
||||||
|
creatorAvatar: string
|
||||||
|
commentNum: number
|
||||||
|
}[]
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface TcreateReq {
|
||||||
|
// channelId: number | undefined
|
||||||
|
postsTitle: string
|
||||||
|
postsCover?: string
|
||||||
|
postsContent: string
|
||||||
|
postsTags: string
|
||||||
|
projectDicId: number | undefined
|
||||||
|
channelId?: string
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface TlistRes {
|
||||||
|
createTime: string
|
||||||
|
updateTime: string
|
||||||
|
creator: string
|
||||||
|
updater: string
|
||||||
|
deleted: boolean
|
||||||
|
channelId: number
|
||||||
|
channelTitle: string
|
||||||
|
channelTopic: string
|
||||||
|
channelIcon: string
|
||||||
|
status: number
|
||||||
|
chinnelProfile: string
|
||||||
|
projectDicId: number
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface TGetChannelPostsRes {
|
||||||
|
postsId: number
|
||||||
|
channelId: number
|
||||||
|
postsTitle: string
|
||||||
|
postsCover: string
|
||||||
|
postsContent: string
|
||||||
|
postsTags: string
|
||||||
|
projectDicId: number
|
||||||
|
browseNum: number
|
||||||
|
likeNum: number
|
||||||
|
createTime: string
|
||||||
|
creator: string
|
||||||
|
creatorName: string
|
||||||
|
creatorAvatar: string
|
||||||
|
commentNum: number
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface PageResultPostsCommentRespVO {
|
||||||
|
list: {
|
||||||
|
commentId: number
|
||||||
|
postsId: number
|
||||||
|
content: string
|
||||||
|
quoteUser: string
|
||||||
|
quoteContent: string
|
||||||
|
createTime: string
|
||||||
|
creator: string
|
||||||
|
creatorName: string
|
||||||
|
creatorAvatar: string
|
||||||
|
}[]
|
||||||
|
total: number
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 聊天消息
|
||||||
|
*/
|
||||||
|
export interface chatMessagesReq {
|
||||||
|
msgType: number
|
||||||
|
content: string
|
||||||
|
toId: number
|
||||||
|
userId: number
|
||||||
|
createTime: string
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 消息类型 消息类型 0:文本 1:图片 2:视频 3:文件
|
||||||
|
*/
|
||||||
|
export type msgType = 0 | 1 | 2 | 3
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 发送单聊信息
|
||||||
|
*/
|
||||||
|
export interface sendSingleChatReq {
|
||||||
|
/** 消息类型 0:文本 1:图片 2:视频 3:文件,示例值(11854) */
|
||||||
|
msgType: msgType
|
||||||
|
/** 内容,示例值(11854) */
|
||||||
|
content: string
|
||||||
|
/** 对方userId,示例值(11854) */
|
||||||
|
toId: number
|
||||||
|
/** 客户端ID,示例值(11854) */
|
||||||
|
userId: number
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 会话列表
|
||||||
|
*/
|
||||||
|
export interface PageResultSessionRespVO {
|
||||||
|
sessionId: number
|
||||||
|
sessionCode: string
|
||||||
|
sessionType: string
|
||||||
|
fromId: number
|
||||||
|
fromTitle: string
|
||||||
|
name: string
|
||||||
|
fromUser: {
|
||||||
|
id: number
|
||||||
|
nickname: string
|
||||||
|
status: number
|
||||||
|
avatar: string
|
||||||
|
mobile: string
|
||||||
|
createTime: string
|
||||||
|
levelId: number
|
||||||
|
point: number
|
||||||
|
}
|
||||||
|
toId: number
|
||||||
|
toTitle: string
|
||||||
|
toUser: {
|
||||||
|
id: number
|
||||||
|
nickname: string
|
||||||
|
status: number
|
||||||
|
avatar: string
|
||||||
|
mobile: string
|
||||||
|
createTime: string
|
||||||
|
levelId: number
|
||||||
|
point: number
|
||||||
|
}
|
||||||
|
lastMsg: any
|
||||||
|
unreadCount: number
|
||||||
|
createTime: string
|
||||||
|
updateTime: string
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 聊天记录
|
||||||
|
*/
|
||||||
|
export interface PageResultMessageRespVO {
|
||||||
|
list: {
|
||||||
|
msgId?: number
|
||||||
|
sessionId?: number
|
||||||
|
fromId?: number
|
||||||
|
fromUser?: {
|
||||||
|
id: number
|
||||||
|
nickname: string
|
||||||
|
status: number
|
||||||
|
avatar: string
|
||||||
|
mobile: string
|
||||||
|
createTime: string
|
||||||
|
levelId: number
|
||||||
|
point: number
|
||||||
|
}
|
||||||
|
toId?: number | string
|
||||||
|
toUser?: {
|
||||||
|
id: number
|
||||||
|
nickname: string
|
||||||
|
status: number
|
||||||
|
avatar: string
|
||||||
|
mobile: string
|
||||||
|
createTime: string
|
||||||
|
levelId: number
|
||||||
|
point: number
|
||||||
|
}
|
||||||
|
msgType: number
|
||||||
|
content: string
|
||||||
|
ext?: string
|
||||||
|
createTime: string
|
||||||
|
}[]
|
||||||
|
total: number
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface ChannelRespVO {
|
||||||
|
channelId: string
|
||||||
|
channelTitle: string
|
||||||
|
channelIcon: string
|
||||||
|
status: number
|
||||||
|
channelProfile: string
|
||||||
|
followCount: number
|
||||||
|
hotTags: any[]
|
||||||
|
projectDicId: number
|
||||||
|
createTime: string
|
||||||
|
isFollow: boolean
|
||||||
|
chatUserCount: number
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 群组成员
|
||||||
|
*/
|
||||||
|
export interface MemberUserRespDTO {
|
||||||
|
id: number
|
||||||
|
nickname: string
|
||||||
|
status: number
|
||||||
|
avatar: string
|
||||||
|
mobile: string
|
||||||
|
createTime: string
|
||||||
|
levelId: number
|
||||||
|
point: number
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface SingleMessageVo {
|
||||||
|
userId: number
|
||||||
|
toId?: number
|
||||||
|
content: string
|
||||||
|
msgType: number
|
||||||
|
sessionId?: string
|
||||||
|
createTime?: string
|
||||||
|
}
|
||||||
82
api/common/index.ts
Normal file
@ -0,0 +1,82 @@
|
|||||||
|
import { post, get } from '@/utils/axios'
|
||||||
|
import type { AppMemberUserInfoRespVO, NotifyMessageRespVO, fileCreateReqVO } from '@/api/common/types'
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取省份地区
|
||||||
|
* @return {Promise}
|
||||||
|
*/
|
||||||
|
export const tree = (params: { id?: number | string }) => {
|
||||||
|
return get<IResponse<any[]>>({
|
||||||
|
url: '/prod-api/app-api/system/area/tree',
|
||||||
|
params,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 上传附件
|
||||||
|
* @return {Promise}
|
||||||
|
*/
|
||||||
|
export const upload = (uploadUrl = '/prod-api/app-api/infra/file/upload', params: any) => {
|
||||||
|
return post<IResponse<any>>({
|
||||||
|
url: uploadUrl,
|
||||||
|
data: params,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 上传附件
|
||||||
|
* @return {Promise}
|
||||||
|
*/
|
||||||
|
export const uploadV2 = (uploadUrl = '/prod-api/app-api/infra/file/presigned-url', params: any) => {
|
||||||
|
return get<IResponse<any>>({
|
||||||
|
url: uploadUrl,
|
||||||
|
params: params,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建文件
|
||||||
|
*/
|
||||||
|
export const creatFile = (params: fileCreateReqVO) => {
|
||||||
|
return post<IResponse<any>>({
|
||||||
|
url: '/prod-api/app-api/infra/file/create',
|
||||||
|
data: params,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取用户信息
|
||||||
|
* @return {Promise}
|
||||||
|
*/
|
||||||
|
export const getUserInfo = () => {
|
||||||
|
return get<IResponse<AppMemberUserInfoRespVO>>({
|
||||||
|
url: '/prod-api/app-api/member/user/get',
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 发送验证码
|
||||||
|
* templateCode:"user-sms-login",description:"会员用户 - 手机号登陆")
|
||||||
|
* MEMBER_LOGIN( scene:1,description:"会员用户 - 修改手机")
|
||||||
|
* MEMBER_UPDATE_MOBILE( scene:2,templateCode: "user-update-mobile",MEMBER UPDATE PASSWORD
|
||||||
|
* ( scene: 3,templateCode:"user-update-password", description:"会员用户 - 修改密码"),
|
||||||
|
* MEMBER_RESET_PASSWORD( scene:4,templateCode:"user-reset-password",description:"会员用户 - 忘记密码"),
|
||||||
|
ADMIN_MEMBER_LOGIN( scene: 21, templateCode: "admin-sms-login", description:"后台用户 -手机号登录")
|
||||||
|
description:"后台用户 -手机号注册"),
|
||||||
|
ADMIN_MEMBER REGISTER( scene: 22,templateCode:"admin-sms-register",
|
||||||
|
ADMIN _MEMBER RESET PASSWORD( scene: 23,templateCode:"admin-reset-password", description:"后台用户 - 忘记密码");
|
||||||
|
* @return {Promise}
|
||||||
|
*/
|
||||||
|
export const sendSms = (params: { mobile: string; scene: number }) => {
|
||||||
|
return post<IResponse<any>>({
|
||||||
|
url: '/prod-api/app-api/member/auth/send-sms-code',
|
||||||
|
data: params,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获得站内信
|
||||||
|
*/
|
||||||
|
export const getMessage = (params: { id: number }) => {
|
||||||
|
return get<IResponse<NotifyMessageRespVO>>({
|
||||||
|
url: '/prod-api/app-api/system/notify-message/get',
|
||||||
|
params,
|
||||||
|
})
|
||||||
|
}
|
||||||
97
api/common/types.ts
Normal file
@ -0,0 +1,97 @@
|
|||||||
|
//权限请求入参
|
||||||
|
export interface IGetPermissionsReq {
|
||||||
|
menuId: string | number
|
||||||
|
}
|
||||||
|
//权限请求出参
|
||||||
|
export interface IPermissions {
|
||||||
|
createTime: string
|
||||||
|
embed: string
|
||||||
|
hidden: string
|
||||||
|
icon: string
|
||||||
|
id: string
|
||||||
|
keepAlive: boolean
|
||||||
|
menuName: string
|
||||||
|
menuOrder: number
|
||||||
|
menuPermission: string
|
||||||
|
menuRemark: string | null
|
||||||
|
menuUrl: string
|
||||||
|
pageUrl: string
|
||||||
|
parentId: string
|
||||||
|
}
|
||||||
|
//列表设置用户习惯查询请求入参
|
||||||
|
export interface IListsetReq {
|
||||||
|
/** 用户习惯,json字符串 */
|
||||||
|
habit: string
|
||||||
|
/** 页面类型,为列表取的唯一标识 */
|
||||||
|
pageType: string
|
||||||
|
/** 当前登录用户id */
|
||||||
|
userId: string
|
||||||
|
/** 主键ID */
|
||||||
|
id?: number | string
|
||||||
|
}
|
||||||
|
//列表设置用户习惯编辑请求入参
|
||||||
|
export interface IEditListsetReq {
|
||||||
|
/** 用户习惯,json字符串 */
|
||||||
|
habit: string
|
||||||
|
/** 页面类型,为列表取的唯一标识 */
|
||||||
|
pageType: string
|
||||||
|
/** 主键ID */
|
||||||
|
id?: number | string
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface FilePreviewRespVO {
|
||||||
|
id: number
|
||||||
|
fileId: number
|
||||||
|
path: string
|
||||||
|
name: string
|
||||||
|
previewUrl: string
|
||||||
|
type: string
|
||||||
|
size: number
|
||||||
|
createTime: string
|
||||||
|
md5: string
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得基本信息
|
||||||
|
*/
|
||||||
|
export interface AppMemberUserInfoRespVO {
|
||||||
|
id: number
|
||||||
|
nickname: string
|
||||||
|
avatar: string
|
||||||
|
mobile: string
|
||||||
|
sex: number
|
||||||
|
point: number
|
||||||
|
experience: number
|
||||||
|
level: {
|
||||||
|
id: number
|
||||||
|
name: string
|
||||||
|
level: number
|
||||||
|
icon: string
|
||||||
|
}
|
||||||
|
brokerageEnabled: boolean
|
||||||
|
vipLevel: number // 会员等级
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface NotifyMessageRespVO {
|
||||||
|
id: number
|
||||||
|
userId: number
|
||||||
|
userType: string
|
||||||
|
templateId: number
|
||||||
|
templateCode: string
|
||||||
|
templateNickname: string
|
||||||
|
templateContent: string
|
||||||
|
templateType: number
|
||||||
|
templateParams: any
|
||||||
|
readStatus: boolean
|
||||||
|
readTime: string
|
||||||
|
createTime: string
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface fileCreateReqVO {
|
||||||
|
configId: number
|
||||||
|
path: string
|
||||||
|
name: string
|
||||||
|
url: string
|
||||||
|
type?: string
|
||||||
|
size: number
|
||||||
|
}
|
||||||
118
api/drawe-detail/index.ts
Normal file
@ -0,0 +1,118 @@
|
|||||||
|
import { get, post, Delete } from '@/utils/axios'
|
||||||
|
import { ProjectRespVO, PageResultProjectCommentResVO, ProjectDrawPageRespVO, UserExtendSimpleRespDTO, ProjectDrawMemberRespVO } from './types'
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取图纸详情
|
||||||
|
* @return {Promise}
|
||||||
|
*/
|
||||||
|
export const getDetail = (params: { id?: number | string }) => {
|
||||||
|
return get<IResponse<ProjectRespVO>>({
|
||||||
|
url: '/prod-api/app-api/business/app/project-draw/preview',
|
||||||
|
params,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取评论列表
|
||||||
|
* @return {Promise}
|
||||||
|
*/
|
||||||
|
export const getCommentList = (params: { relationId?: number | string; pageNum?: number; pageSize?: number }) => {
|
||||||
|
return get<IResponse<PageResultProjectCommentResVO>>({
|
||||||
|
url: '/prod-api/app-api/business/app/project-comment/page',
|
||||||
|
params,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 发表评论
|
||||||
|
* @return {Promise}
|
||||||
|
*/
|
||||||
|
export const createComment = (params: { relationId?: number | string; content?: string; projectId?: number | string }) => {
|
||||||
|
return post<IResponse<boolean>>({
|
||||||
|
url: '/prod-api/app-api/business/app/project-comment/create',
|
||||||
|
data: params,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 当前类型top数据
|
||||||
|
* @return {Promise}
|
||||||
|
*/
|
||||||
|
export const getRelationRecommend = (params: { type?: number | string; projectType?: number | string }) => {
|
||||||
|
return get<IResponse<ProjectDrawPageRespVO[]>>({
|
||||||
|
url: '/prod-api/app-api/business/app/project-draw/top-list',
|
||||||
|
params,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 举报
|
||||||
|
* @return {Promise}
|
||||||
|
*/
|
||||||
|
export const report = (params: { id?: number | string; title?: string; comments?: string; files?: any; projectId: any; drawId: any }) => {
|
||||||
|
return post<IResponse<boolean>>({
|
||||||
|
url: '/prod-api/app-api/business/project-report/create',
|
||||||
|
data: params,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取图纸发布人信息
|
||||||
|
* @return {Promise}
|
||||||
|
*/
|
||||||
|
export const getUserInfo = (params: { id?: number | string }) => {
|
||||||
|
return get<IResponse<UserExtendSimpleRespDTO>>({
|
||||||
|
url: '/prod-api/app-api/business/app/project-draw/preview-user-info',
|
||||||
|
params,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 当前用户的主要作品内容
|
||||||
|
*/
|
||||||
|
export const getMainWork = (params: { id?: number | string; limit: number; memberId?: number | string }) => {
|
||||||
|
return get<IResponse<ProjectDrawMemberRespVO[]>>({
|
||||||
|
url: '/prod-api/app-api/business/app/project-draw/preview-user-projects',
|
||||||
|
params,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 创建内容信息
|
||||||
|
*/
|
||||||
|
export const createContent = (params: { projectId: any; drawId: any }) => {
|
||||||
|
return post<IResponse<boolean>>({
|
||||||
|
url: '/prod-api/app-api/business/project-member-favorites/create',
|
||||||
|
data: params,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建用户项目、工具箱下载
|
||||||
|
*/
|
||||||
|
export const createUserProject = (params: { relationId: any; type: any }) => {
|
||||||
|
return post<IResponse<string>>({
|
||||||
|
url: '/prod-api/app-api/business/project-member-file/create',
|
||||||
|
data: params,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 删除项目订单用户收藏信息
|
||||||
|
*/
|
||||||
|
export const deleteProject = (params: { id: any }) => {
|
||||||
|
return Delete<IResponse<boolean>>({
|
||||||
|
url: '/prod-api/app-api/business/project-member-favorites/delete',
|
||||||
|
data: params,
|
||||||
|
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除工具箱信息
|
||||||
|
*/
|
||||||
|
export const deleteTool = (params: { id: any }) => {
|
||||||
|
return Delete<IResponse<boolean>>({
|
||||||
|
url: '/prod-api/app-api/business/project-resource/delete',
|
||||||
|
data: params,
|
||||||
|
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
|
||||||
|
})
|
||||||
|
}
|
||||||
149
api/drawe-detail/types.ts
Normal file
@ -0,0 +1,149 @@
|
|||||||
|
export interface ProjectRespVO {
|
||||||
|
id: number
|
||||||
|
title: string
|
||||||
|
description: string
|
||||||
|
ownedUserId: string
|
||||||
|
status: number
|
||||||
|
createTime: string
|
||||||
|
isDomestic: number
|
||||||
|
ownedUserIdInfo?: any
|
||||||
|
area: string
|
||||||
|
country: string
|
||||||
|
province: string
|
||||||
|
city: string
|
||||||
|
county: string
|
||||||
|
address: string
|
||||||
|
editions: string
|
||||||
|
labels: string[]
|
||||||
|
type: number
|
||||||
|
projectId: number
|
||||||
|
projectType: string[]
|
||||||
|
formatType: string[]
|
||||||
|
source: number
|
||||||
|
editType: boolean
|
||||||
|
points: number
|
||||||
|
downloadId: string
|
||||||
|
files: OtherFiles[]
|
||||||
|
coverImages: CoverImages[]
|
||||||
|
renderings: Renderings[]
|
||||||
|
otherFiles: OtherFiles[]
|
||||||
|
checked: boolean
|
||||||
|
recommend: boolean
|
||||||
|
hotPoint: number
|
||||||
|
editTypeName: string
|
||||||
|
editionsName: string
|
||||||
|
projectTypeName: string
|
||||||
|
favoriteId?: string
|
||||||
|
relationDraws: RelationDraws[]
|
||||||
|
filesInfo: {
|
||||||
|
fileSize: string
|
||||||
|
count: number
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
interface RelationDraws {
|
||||||
|
id: number
|
||||||
|
projectId: number
|
||||||
|
title: string
|
||||||
|
description: string
|
||||||
|
ownedUserId: string
|
||||||
|
type: number
|
||||||
|
points: number
|
||||||
|
coverImages: CoverImages[]
|
||||||
|
ownedUserIdInfo?: any
|
||||||
|
recommend: boolean
|
||||||
|
hotPoint: number
|
||||||
|
commentsPoint: number
|
||||||
|
previewPoint: number
|
||||||
|
}
|
||||||
|
|
||||||
|
interface Renderings {
|
||||||
|
id: number
|
||||||
|
title: string
|
||||||
|
relationId: number
|
||||||
|
type: number
|
||||||
|
url: string
|
||||||
|
}
|
||||||
|
|
||||||
|
interface CoverImages {
|
||||||
|
id: number
|
||||||
|
title: string
|
||||||
|
relationId: number
|
||||||
|
type: number
|
||||||
|
url: string
|
||||||
|
}
|
||||||
|
interface OtherFiles {
|
||||||
|
id: number
|
||||||
|
title: string
|
||||||
|
relationId: number
|
||||||
|
type: number
|
||||||
|
url: string
|
||||||
|
size: number
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface PageResultProjectCommentResVO {
|
||||||
|
list: ProjectCommentResVO[]
|
||||||
|
total: number
|
||||||
|
}
|
||||||
|
|
||||||
|
interface ProjectCommentResVO {
|
||||||
|
id: number
|
||||||
|
projectId: number
|
||||||
|
relationId: number
|
||||||
|
content: string
|
||||||
|
url: string
|
||||||
|
creator: number
|
||||||
|
creatorInfo: {
|
||||||
|
avatar: string
|
||||||
|
name: string
|
||||||
|
nickName: string
|
||||||
|
createTime: string
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface ProjectDrawPageRespVO {
|
||||||
|
id: number
|
||||||
|
projectId: number
|
||||||
|
title: string
|
||||||
|
description: string
|
||||||
|
ownedUserId: string
|
||||||
|
editions?: string[]
|
||||||
|
type: number
|
||||||
|
createTime: string
|
||||||
|
projectType: string[]
|
||||||
|
status: number
|
||||||
|
recommend: boolean
|
||||||
|
points: number
|
||||||
|
iconUrl: string
|
||||||
|
hotPoint: number
|
||||||
|
commentsPoint: number
|
||||||
|
previewPoint: number
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface UserExtendSimpleRespDTO {
|
||||||
|
id: number
|
||||||
|
avatar: string
|
||||||
|
memberId: number
|
||||||
|
nickname: string
|
||||||
|
isDomestic: number
|
||||||
|
area: string
|
||||||
|
country: string
|
||||||
|
province: string
|
||||||
|
city: string
|
||||||
|
county: string
|
||||||
|
labels: string[]
|
||||||
|
description: string
|
||||||
|
files: any[]
|
||||||
|
fansCount: number
|
||||||
|
projectCount: number
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface ProjectDrawMemberRespVO {
|
||||||
|
id: number
|
||||||
|
projectId: number
|
||||||
|
title: string
|
||||||
|
description: string
|
||||||
|
ownedUserId: string
|
||||||
|
type: number
|
||||||
|
createTime: string
|
||||||
|
}
|
||||||
110
api/home/index.ts
Normal file
@ -0,0 +1,110 @@
|
|||||||
|
import { get } from '@/utils/axios'
|
||||||
|
import {
|
||||||
|
ThotTopReq,
|
||||||
|
ProjectDrawPageRespVO,
|
||||||
|
ProjectDictNodeVO,
|
||||||
|
ProjectDrawStatisticAppRespVO,
|
||||||
|
ProjectTrendingScoreUserInfoVO,
|
||||||
|
PageResultIndexSettingRespVO,
|
||||||
|
} from './type'
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取热门信息的top信息
|
||||||
|
* @param params
|
||||||
|
* @returns
|
||||||
|
*/
|
||||||
|
export const hotTop = (params: ThotTopReq) => {
|
||||||
|
return get<IResponse<ProjectDrawPageRespVO[]>>({
|
||||||
|
url: '/prod-api/app-api/business/app/project-draw/hot-top',
|
||||||
|
params,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取推荐信息的top信息
|
||||||
|
* @param params
|
||||||
|
* @returns
|
||||||
|
*/
|
||||||
|
export const recommendTop = (params: ThotTopReq) => {
|
||||||
|
return get<IResponse<ProjectDrawPageRespVO[]>>({
|
||||||
|
url: '/prod-api/app-api/business/app/project-draw/recommend-top',
|
||||||
|
params,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取最新图纸信息
|
||||||
|
*/
|
||||||
|
export const newDraw = (params: { type: number; limit: number }) => {
|
||||||
|
return get<IResponse<ProjectDrawPageRespVO[]>>({
|
||||||
|
url: '/prod-api/app-api/business/project/index/draw-new',
|
||||||
|
params,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 首页-热点标签
|
||||||
|
*/
|
||||||
|
export const hotTag = (params: { type: number; limit: number; size: number }) => {
|
||||||
|
return get<IResponse<ProjectDictNodeVO[]>>({
|
||||||
|
url: '/prod-api/app-api/business/project/index/index-hot-tab',
|
||||||
|
params,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 首页-标签
|
||||||
|
*/
|
||||||
|
export const tag = () => {
|
||||||
|
return get<IResponse<ProjectDictNodeVO[]>>({
|
||||||
|
url: '/prod-api/app-api/business/project/index/index-tab',
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取top数据
|
||||||
|
*/
|
||||||
|
export const top = (params: { type: number; limit: number }) => {
|
||||||
|
return get<IResponse<ProjectDrawStatisticAppRespVO[]>>({
|
||||||
|
url: '/prod-api/app-api/business/project/index/top',
|
||||||
|
params,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取用户top数据
|
||||||
|
*/
|
||||||
|
export const userTop = (params: { type?: number }) => {
|
||||||
|
return get<IResponse<ProjectTrendingScoreUserInfoVO[]>>({
|
||||||
|
url: '/prod-api/app-api/business/project/index/user-top',
|
||||||
|
params,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置首页设置信息分页
|
||||||
|
*/
|
||||||
|
export const settinngPage = (params: { pageNo?: number; pageSize: number; type: number; status: number; innerType?: number }) => {
|
||||||
|
return get<IResponse<PageResultIndexSettingRespVO>>({
|
||||||
|
url: '/prod-api/admin-api/system/index-setting/page',
|
||||||
|
params,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获得首页设置信息分页
|
||||||
|
*/
|
||||||
|
export const getSettingPage = (params: { type: number }) => {
|
||||||
|
return get<IResponse<PageResultIndexSettingRespVO[]>>({
|
||||||
|
url: '/prod-api/app-api/system/index-setting/list',
|
||||||
|
params,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 首页-标签2
|
||||||
|
*/
|
||||||
|
export const tab2 = () => {
|
||||||
|
return get<IResponse<ProjectDictNodeVO[]>>({
|
||||||
|
url: '/prod-api/app-api/business/project/index/index-tab2',
|
||||||
|
})
|
||||||
|
}
|
||||||
107
api/home/type.ts
Normal file
@ -0,0 +1,107 @@
|
|||||||
|
export interface ThotTopReq {
|
||||||
|
/** 类型: 1 图纸 2 文本 3 模型 */
|
||||||
|
type: number
|
||||||
|
/** 项目分类 */
|
||||||
|
projectType: string
|
||||||
|
/** 是否国内 0 国外 1 国内 */
|
||||||
|
isDomestic: number
|
||||||
|
projectTypeTop?: string
|
||||||
|
}
|
||||||
|
export interface ProjectDrawPageRespVO {
|
||||||
|
/** 主键 */
|
||||||
|
id: number
|
||||||
|
/** 项目id */
|
||||||
|
projectId: number
|
||||||
|
/** 标题 */
|
||||||
|
title: string
|
||||||
|
/** 版本 */
|
||||||
|
editions: any[]
|
||||||
|
/** 类型: 1 图纸 2 文本 3 模型 */
|
||||||
|
type: number
|
||||||
|
/** 创建时间 */
|
||||||
|
createTime: string
|
||||||
|
/** 项目分类 */
|
||||||
|
projectType: any[]
|
||||||
|
/** 状态 */
|
||||||
|
status: number
|
||||||
|
/** 是否推荐 */
|
||||||
|
recommend: boolean
|
||||||
|
/** 金币 */
|
||||||
|
points: number
|
||||||
|
/** 封面图片 */
|
||||||
|
iconUrl: string
|
||||||
|
/** 热度 */
|
||||||
|
hotPoint: number
|
||||||
|
/** 描述 */
|
||||||
|
description: string
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface ProjectDictNodeVO {
|
||||||
|
id?: string
|
||||||
|
parentId?: string
|
||||||
|
name?: string
|
||||||
|
isChildren?: true
|
||||||
|
sort?: number
|
||||||
|
level?: number
|
||||||
|
children?: {
|
||||||
|
id?: string
|
||||||
|
parentId?: string
|
||||||
|
name?: string
|
||||||
|
isChildren?: true
|
||||||
|
sort?: number
|
||||||
|
level?: number
|
||||||
|
children?: any[]
|
||||||
|
parent?: any
|
||||||
|
type?: number
|
||||||
|
checked?: true
|
||||||
|
}[]
|
||||||
|
|
||||||
|
parent?: any
|
||||||
|
type?: number
|
||||||
|
checked?: true
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface ProjectDrawStatisticAppRespVO {
|
||||||
|
pairs?: {
|
||||||
|
id: string
|
||||||
|
name: string
|
||||||
|
}[]
|
||||||
|
projectType?: number | any[]
|
||||||
|
projectTypeName?: string
|
||||||
|
count?: number
|
||||||
|
type?: number
|
||||||
|
title?: string
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface ProjectTrendingScoreUserInfoVO {
|
||||||
|
avatar: string
|
||||||
|
memberId: number
|
||||||
|
nickname: string
|
||||||
|
isDomestic: number
|
||||||
|
area: string
|
||||||
|
country: string
|
||||||
|
province: string
|
||||||
|
city: string
|
||||||
|
county: string
|
||||||
|
labels: any[]
|
||||||
|
description: string
|
||||||
|
files: any
|
||||||
|
fansCount: number
|
||||||
|
projectCount: number
|
||||||
|
ownUserId: number
|
||||||
|
projectType: string
|
||||||
|
score: number
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface PageResultIndexSettingRespVO {
|
||||||
|
id: number
|
||||||
|
name: string
|
||||||
|
url: string
|
||||||
|
sort: number
|
||||||
|
type: number
|
||||||
|
innerType: number
|
||||||
|
rowType: number
|
||||||
|
content: string
|
||||||
|
status: number
|
||||||
|
createTime: string
|
||||||
|
}
|
||||||
69
api/login/index.ts
Normal file
@ -0,0 +1,69 @@
|
|||||||
|
import { post, put } from '@/utils/axios'
|
||||||
|
import { LoginParams, LoginResponseData, AppAuthLoginRespVO } from './types'
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新建图纸
|
||||||
|
* @param params
|
||||||
|
* @returns
|
||||||
|
*/
|
||||||
|
export const login = (params: LoginParams) => {
|
||||||
|
return post<IResponse<LoginResponseData>>({
|
||||||
|
url: '/prod-api/app-api/member/auth/login',
|
||||||
|
data: params,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 发送手机验证码
|
||||||
|
*/
|
||||||
|
export const sendCode = (params: { mobile: string }) => {
|
||||||
|
return post<IResponse<any>>({
|
||||||
|
url: '/prod-api/app-api/member/auth/send-sms-code',
|
||||||
|
data: params,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 使用手机 + 验证码登录
|
||||||
|
*/
|
||||||
|
export const loginByMobile = (params: { mobile: string; code: string; socialCode?: string; socialType?: string; socialState?: string }) => {
|
||||||
|
return post<IResponse<AppAuthLoginRespVO>>({
|
||||||
|
url: '/prod-api/app-api/member/auth/sms-login',
|
||||||
|
data: params,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 发送邮箱验证码
|
||||||
|
*/
|
||||||
|
export const sendEmailCode = (params: { email: string }) => {
|
||||||
|
return post<IResponse<any>>({
|
||||||
|
url: '/prod-api/app-api/member/auth/send-email-code',
|
||||||
|
data: params,
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'application/x-www-form-urlencoded',
|
||||||
|
},
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 使用邮箱 + 验证码登录
|
||||||
|
*/
|
||||||
|
export const loginByEmail = (params: { email: string; code: string }) => {
|
||||||
|
return post<IResponse<AppAuthLoginRespVO>>({
|
||||||
|
url: '/prod-api/app-api/member/auth/verify-code',
|
||||||
|
data: params,
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'application/x-www-form-urlencoded',
|
||||||
|
},
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 重置密码
|
||||||
|
*/
|
||||||
|
export const resetPassoword = (params: { password: string; code: string }) => {
|
||||||
|
return put<IResponse<boolean>>({
|
||||||
|
url: '/prod-api/app-api/member/user/update-password',
|
||||||
|
data: params,
|
||||||
|
})
|
||||||
|
}
|
||||||
21
api/login/types.ts
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
export interface LoginParams {
|
||||||
|
mobile: string
|
||||||
|
password: string
|
||||||
|
socialCode?: string
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface LoginResponseData {
|
||||||
|
userId: number
|
||||||
|
accessToken: string
|
||||||
|
refreshToken: string
|
||||||
|
expiresTime: number
|
||||||
|
openid: string
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface AppAuthLoginRespVO {
|
||||||
|
userId: number
|
||||||
|
accessToken: string
|
||||||
|
refreshToken: string
|
||||||
|
expiresTime: string
|
||||||
|
openid: string
|
||||||
|
}
|
||||||
96
api/pay/index.ts
Normal file
@ -0,0 +1,96 @@
|
|||||||
|
import { get, post } from '@/utils/axios'
|
||||||
|
import { AppPayWalletPackageRespVO, PayOrderSubmitReqVO, PayOrderRespVO, PageResultAppPayWalletRechargeRespVO } from './types'
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得VIP列表
|
||||||
|
* @param params
|
||||||
|
* @returns
|
||||||
|
*/
|
||||||
|
export const listVip = () => {
|
||||||
|
return get<IResponse<AppPayWalletPackageRespVO[]>>({
|
||||||
|
url: '/prod-api/app-api/pay/wallet-recharge-package/list-vip',
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 提交支付订单
|
||||||
|
*/
|
||||||
|
export const submitPayOrder = (data: PayOrderSubmitReqVO) => {
|
||||||
|
return post<
|
||||||
|
IResponse<{
|
||||||
|
displayContent: string
|
||||||
|
displayMode: string
|
||||||
|
orderId: number
|
||||||
|
status: number
|
||||||
|
}>
|
||||||
|
>({
|
||||||
|
url: '/prod-api/app-api/pay/order/submit',
|
||||||
|
data,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建示例订单
|
||||||
|
*/
|
||||||
|
export const createOrder = (params: { spuId: number }) => {
|
||||||
|
return post<IResponse<string>>({
|
||||||
|
url: '/prod-api/app-api/pay/demo-order/create',
|
||||||
|
params,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得钱包充值套餐列表
|
||||||
|
*/
|
||||||
|
export const listWalletRechargePackage = () => {
|
||||||
|
return get<IResponse<AppPayWalletPackageRespVO[]>>({
|
||||||
|
url: '/prod-api/app-api/pay/wallet-recharge-package/list',
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取支付状态
|
||||||
|
*/
|
||||||
|
export const getPayStatus = (params: { id: number }) => {
|
||||||
|
return get<IResponse<PayOrderRespVO>>({
|
||||||
|
url: '/prod-api/app-api/pay/order/get',
|
||||||
|
params,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过code获取token
|
||||||
|
*/
|
||||||
|
export const getTokenByCode = (params: { type: number; code: string; state: string }) => {
|
||||||
|
return post<IResponse<string>>({
|
||||||
|
url: '/prod-api/app-api/member/social-user/bind',
|
||||||
|
data: params,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 社交快捷登录,使用 code 授权码
|
||||||
|
*/
|
||||||
|
export const socialLoginByCode = (params: { type: number; code: string; state: string }) => {
|
||||||
|
return post<
|
||||||
|
IResponse<{
|
||||||
|
accessToken: string
|
||||||
|
refreshToken: string
|
||||||
|
userId: string
|
||||||
|
expiresTime: number
|
||||||
|
openid: string
|
||||||
|
}>
|
||||||
|
>({
|
||||||
|
url: '/prod-api/app-api/member/auth/social-login',
|
||||||
|
data: params,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得钱包充值记录分页
|
||||||
|
*/
|
||||||
|
export const getWalletRechargeRecordPage = (params: { pageNo: number; pageSize: number }) => {
|
||||||
|
return get<IResponse<PageResultAppPayWalletRechargeRespVO>>({
|
||||||
|
url: '/prod-api/app-api/pay/wallet-transaction/page',
|
||||||
|
params,
|
||||||
|
})
|
||||||
|
}
|
||||||
63
api/pay/types.ts
Normal file
@ -0,0 +1,63 @@
|
|||||||
|
export interface AppPayWalletPackageRespVO {
|
||||||
|
id: number
|
||||||
|
name: string
|
||||||
|
payPrice: number
|
||||||
|
bonusPrice: number
|
||||||
|
type: number
|
||||||
|
brokerageRate: number
|
||||||
|
profile: string
|
||||||
|
remark: string
|
||||||
|
btnloading: boolean
|
||||||
|
qrCodeUrl: string
|
||||||
|
level: number
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface PayOrderSubmitReqVO {
|
||||||
|
id: number
|
||||||
|
memberId: string
|
||||||
|
channelCode: string
|
||||||
|
channelExtras?: any
|
||||||
|
displayMode?: string
|
||||||
|
returnUrl?: string
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface PayOrderRespVO {
|
||||||
|
appId: number
|
||||||
|
channelId: number
|
||||||
|
channelCode: string
|
||||||
|
merchantOrderId: string
|
||||||
|
subject: string
|
||||||
|
body: string
|
||||||
|
notifyUrl: string
|
||||||
|
price: number
|
||||||
|
channelFeeRate: number
|
||||||
|
channelFeePrice: number
|
||||||
|
status: number
|
||||||
|
userIp: string
|
||||||
|
expireTime: string
|
||||||
|
successTime: string
|
||||||
|
extensionId: number
|
||||||
|
no: string
|
||||||
|
refundPrice: number
|
||||||
|
channelUserId: string
|
||||||
|
channelOrderNo: string
|
||||||
|
id: number
|
||||||
|
createTime: string
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface PageResultAppPayWalletRechargeRespVO {
|
||||||
|
list: AppPayWalletRechargeRespVO[]
|
||||||
|
total: number
|
||||||
|
}
|
||||||
|
export interface AppPayWalletRechargeRespVO {
|
||||||
|
id: number
|
||||||
|
totalPrice: number
|
||||||
|
payPrice: number
|
||||||
|
bonusPrice: number
|
||||||
|
payChannelCode: string
|
||||||
|
payChannelName: string
|
||||||
|
payOrderId: number
|
||||||
|
payOrderChannelOrderNo: string
|
||||||
|
payTime: string
|
||||||
|
refundStatus: number
|
||||||
|
}
|
||||||
202
api/personal-center/index.ts
Normal file
@ -0,0 +1,202 @@
|
|||||||
|
import { get, post, put, Delete } from '@/utils/axios'
|
||||||
|
import {
|
||||||
|
UserExtendSaveReqVO,
|
||||||
|
UserExtendRespVO,
|
||||||
|
UserAuthInfoRespVO,
|
||||||
|
PageResultProjectHistoryResVO,
|
||||||
|
PageResultMemberPointRecordRespVO,
|
||||||
|
UserStatisticsLineRespVO,
|
||||||
|
UserStatisticsBarRespVO,
|
||||||
|
UserStatisticsCountRespVO,
|
||||||
|
PageResultProjectMemberFavoritesRespVO,
|
||||||
|
} from './types'
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取用户信息
|
||||||
|
* @returns
|
||||||
|
*/
|
||||||
|
export const getUserInfo = () => {
|
||||||
|
return get<IResponse<UserExtendRespVO>>({
|
||||||
|
url: '/prod-api/app-api/member/user-extend/get',
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建用户信息
|
||||||
|
* @param params
|
||||||
|
* @returns
|
||||||
|
*/
|
||||||
|
export const userExtend = (params: UserExtendSaveReqVO) => {
|
||||||
|
return post<IResponse<number>>({
|
||||||
|
url: '/prod-api/app-api/member/user-extend/create',
|
||||||
|
data: params,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新用户信息
|
||||||
|
* @param params
|
||||||
|
* @returns
|
||||||
|
*/
|
||||||
|
export const updateUserExtend = (params: UserExtendSaveReqVO) => {
|
||||||
|
return put<IResponse<number>>({
|
||||||
|
url: '/prod-api/app-api/member/user-extend/update',
|
||||||
|
data: params,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取用户信息
|
||||||
|
* @param params
|
||||||
|
* @returns
|
||||||
|
*/
|
||||||
|
export const getUserAuthInfo = () => {
|
||||||
|
return get<IResponse<UserAuthInfoRespVO>>({
|
||||||
|
url: '/prod-api/app-api/member/user-auth-info/get',
|
||||||
|
})
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 创建用户信息
|
||||||
|
* @param params
|
||||||
|
* @returns
|
||||||
|
*/
|
||||||
|
export const createUserAuthInfo = (params: UserAuthInfoRespVO) => {
|
||||||
|
return post<IResponse<number>>({
|
||||||
|
url: '/prod-api/app-api/member/user-auth-info/create',
|
||||||
|
data: params,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 更新用户信息
|
||||||
|
* @param params
|
||||||
|
* @returns
|
||||||
|
*/
|
||||||
|
export const updateUserAuthInfo = (params: UserAuthInfoRespVO) => {
|
||||||
|
return put<IResponse<number>>({
|
||||||
|
url: '/prod-api/app-api/member/user-auth-info/update',
|
||||||
|
data: params,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得内容信息分页
|
||||||
|
*/
|
||||||
|
export const getContentPage = (params: { type: number }) => {
|
||||||
|
return get<IResponse<PageResultProjectHistoryResVO>>({
|
||||||
|
url: '/prod-api/app-api/business/project-history/page',
|
||||||
|
params,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获得用户项目工具箱下载分页
|
||||||
|
*/
|
||||||
|
export const getUserToolBoxPage = (params: { pageNum: number; pageSize: number; type?: number }) => {
|
||||||
|
return get<IResponse<PageResultProjectHistoryResVO>>({
|
||||||
|
url: '/prod-api/app-api/business/project-member-file/page',
|
||||||
|
params,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 签到
|
||||||
|
*/
|
||||||
|
export const signIn = () => {
|
||||||
|
return post<
|
||||||
|
IResponse<{
|
||||||
|
day: number
|
||||||
|
point: number
|
||||||
|
experience: number
|
||||||
|
createTime: string
|
||||||
|
}>
|
||||||
|
>({
|
||||||
|
url: '/prod-api/app-api/member/sign-in/record/create',
|
||||||
|
})
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获得用户积分记录分页
|
||||||
|
*/
|
||||||
|
export const getUserPointPage = (params: { pageNo: number; pageSize: number }) => {
|
||||||
|
return get<IResponse<PageResultMemberPointRecordRespVO>>({
|
||||||
|
url: '/prod-api/app-api/member/point/record/page',
|
||||||
|
params,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 近期收益和近期活跃
|
||||||
|
*/
|
||||||
|
export const getRecentIncomeAndActive = (params: { type: number; limit: number }) => {
|
||||||
|
return get<IResponse<UserStatisticsLineRespVO>>({
|
||||||
|
url: '/prod-api/app-api/member/statistics/line',
|
||||||
|
params,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
资源下载分布
|
||||||
|
*/
|
||||||
|
export const getResourceDistribution = (params: { type: number; limit: number }) => {
|
||||||
|
return get<IResponse<UserStatisticsBarRespVO>>({
|
||||||
|
url: '/prod-api/app-api/member/statistics/bar',
|
||||||
|
params,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 我的数据统计 包括我的金币 我的关注 我的发布等等
|
||||||
|
*/
|
||||||
|
export const getUserStatistics = () => {
|
||||||
|
return get<IResponse<UserStatisticsCountRespVO>>({
|
||||||
|
url: '/prod-api/app-api/member/statistics/count',
|
||||||
|
params: {},
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'application/x-www-form-urlencoded ',
|
||||||
|
},
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得项目订单用户收藏信息分页
|
||||||
|
*/
|
||||||
|
export const getUserFavoritePage = (params: { pageNo: number; pageSize: number; userId: any; type: number }) => {
|
||||||
|
return get<IResponse<PageResultProjectMemberFavoritesRespVO>>({
|
||||||
|
url: '/prod-api/app-api/business/project-member-favorites/page',
|
||||||
|
params,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/***
|
||||||
|
* 自己发布的-内容信息分页
|
||||||
|
*/
|
||||||
|
export const getOwnContentPage = (params: { pageNo: number; pageSize: number; type: number }) => {
|
||||||
|
return get<IResponse<PageResultProjectMemberFavoritesRespVO>>({
|
||||||
|
url: '/prod-api/app-api/business/app/project-draw/my-page',
|
||||||
|
params,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 下架
|
||||||
|
*/
|
||||||
|
export const offShelf = (params: { id: number }) => {
|
||||||
|
return put<IResponse<boolean>>({
|
||||||
|
url: '/prod-api/app-api/business/app/project-draw/down',
|
||||||
|
data: params,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除资源
|
||||||
|
*/
|
||||||
|
export const deleteResource = (params: { id: number }) => {
|
||||||
|
return Delete<IResponse<boolean>>({
|
||||||
|
url: '/prod-api/app-api/business/app/project-draw/delete',
|
||||||
|
params,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得信息拓展
|
||||||
|
*/
|
||||||
|
export const getUserExtend = () => {
|
||||||
|
return get<IResponse<UserExtendRespVO>>({
|
||||||
|
url: '/prod-api/app-api/member/user-extend/get',
|
||||||
|
})
|
||||||
|
}
|
||||||
173
api/personal-center/types.ts
Normal file
@ -0,0 +1,173 @@
|
|||||||
|
export interface UserExtendSaveReqVO {
|
||||||
|
phone?: string
|
||||||
|
username?: string
|
||||||
|
avatar?: string
|
||||||
|
id?: number
|
||||||
|
memberId?: number
|
||||||
|
status?: number
|
||||||
|
trueName?: string
|
||||||
|
email?: string
|
||||||
|
isDomestic?: number
|
||||||
|
area?: string
|
||||||
|
country?: string
|
||||||
|
province?: string
|
||||||
|
city?: string
|
||||||
|
county?: string
|
||||||
|
labels?: string[]
|
||||||
|
description?: string
|
||||||
|
authStatus?: number
|
||||||
|
nickname?: string
|
||||||
|
files: {
|
||||||
|
id: number
|
||||||
|
memberId: number
|
||||||
|
relationId: number
|
||||||
|
title: string
|
||||||
|
type: number
|
||||||
|
url: string
|
||||||
|
sort: number
|
||||||
|
fileId: number
|
||||||
|
}[]
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface UserExtendRespVO {
|
||||||
|
id: number
|
||||||
|
memberId: number
|
||||||
|
status: number
|
||||||
|
nickname: string
|
||||||
|
mobile: string
|
||||||
|
email: string
|
||||||
|
isDomestic: number
|
||||||
|
area: string
|
||||||
|
country: string
|
||||||
|
province: string
|
||||||
|
city: string
|
||||||
|
county: string
|
||||||
|
labels: string[]
|
||||||
|
description: string
|
||||||
|
authStatus: number
|
||||||
|
createTime: string
|
||||||
|
files: {
|
||||||
|
id: number
|
||||||
|
memberId: number
|
||||||
|
relationId: number
|
||||||
|
title: string
|
||||||
|
type: number
|
||||||
|
url: string
|
||||||
|
createTime: string
|
||||||
|
sort: number
|
||||||
|
fileId: number
|
||||||
|
}[]
|
||||||
|
userAuthInfo: {
|
||||||
|
id: number
|
||||||
|
memberId: number
|
||||||
|
status: number
|
||||||
|
trueName: string
|
||||||
|
idNo: string
|
||||||
|
createTime: string
|
||||||
|
files: {
|
||||||
|
id: number
|
||||||
|
memberId: number
|
||||||
|
relationId: number
|
||||||
|
title: string
|
||||||
|
type: number
|
||||||
|
url: string
|
||||||
|
createTime: string
|
||||||
|
sort: number
|
||||||
|
fileId: number
|
||||||
|
}[]
|
||||||
|
}
|
||||||
|
unionWechat: boolean
|
||||||
|
unionQq: boolean
|
||||||
|
avatar: string
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface UserAuthInfoRespVO {
|
||||||
|
id?: number
|
||||||
|
memberId?: number
|
||||||
|
status?: number
|
||||||
|
trueName?: string
|
||||||
|
idNo?: string
|
||||||
|
createTime?: string
|
||||||
|
files: {
|
||||||
|
id: number
|
||||||
|
memberId: number
|
||||||
|
relationId: number
|
||||||
|
title: string
|
||||||
|
type: number
|
||||||
|
url: string
|
||||||
|
createTime: string
|
||||||
|
sort: number
|
||||||
|
fileId: number
|
||||||
|
}[]
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface ProjectHistoryResVO {
|
||||||
|
id: number
|
||||||
|
projectId: number
|
||||||
|
relationId: number
|
||||||
|
type: number
|
||||||
|
title: string
|
||||||
|
content: string
|
||||||
|
url: string
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface PageResultProjectHistoryResVO {
|
||||||
|
list: ProjectHistoryResVO[]
|
||||||
|
total: number
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface PageResultMemberPointRecordRespVO {
|
||||||
|
list: {
|
||||||
|
id: number
|
||||||
|
userId: number
|
||||||
|
nickname: string
|
||||||
|
bizId: string
|
||||||
|
bizType: number
|
||||||
|
title: string
|
||||||
|
description: string
|
||||||
|
point: number
|
||||||
|
totalPoint: number
|
||||||
|
createTime: string
|
||||||
|
}[]
|
||||||
|
total: number
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface UserStatisticsLineRespVO {
|
||||||
|
data: any[]
|
||||||
|
checkedXAxis: string
|
||||||
|
xaxis: any[]
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface UserStatisticsBarRespVO {
|
||||||
|
series: {
|
||||||
|
data: any[]
|
||||||
|
}[]
|
||||||
|
xaxis: any[]
|
||||||
|
}
|
||||||
|
export interface UserStatisticsCountRespVO {
|
||||||
|
pointCount: number
|
||||||
|
followCount: number
|
||||||
|
fansCount: number
|
||||||
|
projectCount: number
|
||||||
|
downloadCount: number
|
||||||
|
currencyCount: number
|
||||||
|
previewCount: number
|
||||||
|
revenueCount: number
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface PageResultProjectMemberFavoritesRespVO {
|
||||||
|
list: {
|
||||||
|
id: number
|
||||||
|
userId: number
|
||||||
|
projectId: number
|
||||||
|
drawId: number
|
||||||
|
createTime: string
|
||||||
|
title: string
|
||||||
|
description: string
|
||||||
|
iconUrl: string
|
||||||
|
recommend: true
|
||||||
|
hotPoint: number
|
||||||
|
ownedUserId: string
|
||||||
|
}[]
|
||||||
|
total: number
|
||||||
|
}
|
||||||
24
api/toolbox/index.ts
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
import { post, get } from '@/utils/axios'
|
||||||
|
import { TcreateReq, TpageReq, TpageRes } from './types'
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新建工具箱
|
||||||
|
* @param params
|
||||||
|
* @returns
|
||||||
|
*/
|
||||||
|
export const create = (params: TcreateReq) => {
|
||||||
|
return post<IResponse<number>>({
|
||||||
|
url: '/prod-api/app-api/business/app/project-resource/create',
|
||||||
|
data: params,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/***
|
||||||
|
* 获得内容信息分页
|
||||||
|
*/
|
||||||
|
export const page = (params: TpageReq) => {
|
||||||
|
return get<IResponse<TpageRes>>({
|
||||||
|
url: '/prod-api/app-api/business/app/project-resource/page',
|
||||||
|
params,
|
||||||
|
})
|
||||||
|
}
|
||||||
61
api/toolbox/types.ts
Normal file
@ -0,0 +1,61 @@
|
|||||||
|
export interface TcreateReq {
|
||||||
|
id?: number
|
||||||
|
title: string
|
||||||
|
description: string
|
||||||
|
labels: string[]
|
||||||
|
createAddress?: string
|
||||||
|
createIp?: string
|
||||||
|
projectType: number[]
|
||||||
|
files: {
|
||||||
|
id: number
|
||||||
|
title: string
|
||||||
|
fileId: number
|
||||||
|
drawId: number
|
||||||
|
type: number
|
||||||
|
url: string
|
||||||
|
sort: number
|
||||||
|
}[]
|
||||||
|
coverImages: {
|
||||||
|
id: number
|
||||||
|
title: string
|
||||||
|
fileId: number
|
||||||
|
drawId: number
|
||||||
|
type: number
|
||||||
|
url: string
|
||||||
|
sort: number
|
||||||
|
}[]
|
||||||
|
points: number
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface TpageReq {
|
||||||
|
pageNum: number
|
||||||
|
pageSize: number
|
||||||
|
title?: string
|
||||||
|
ownedUserId?: string
|
||||||
|
labels?: string[]
|
||||||
|
status?: number
|
||||||
|
recommend?: boolean
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface TpageRes {
|
||||||
|
list: TpageItem[]
|
||||||
|
total: number
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface TpageItem {
|
||||||
|
id: number
|
||||||
|
title: string
|
||||||
|
createTime: string
|
||||||
|
labels: string[]
|
||||||
|
status: number
|
||||||
|
recommend: boolean
|
||||||
|
points: number
|
||||||
|
iconUrl: string
|
||||||
|
hotPoint: number
|
||||||
|
description: string
|
||||||
|
previewPoint: number
|
||||||
|
previewUrl: string
|
||||||
|
previewImageUrl: string
|
||||||
|
commentsPoint: number
|
||||||
|
ownedUserId: string
|
||||||
|
}
|
||||||
88
api/upnew/index.ts
Normal file
@ -0,0 +1,88 @@
|
|||||||
|
import { post, get } from '@/utils/axios'
|
||||||
|
import { TcreateReq, pageReq, pageRes, recommendTopReq, recommendTopRes, parentRes, ProjectDictNodeVO } from './types'
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新建图纸
|
||||||
|
* @param params
|
||||||
|
* @returns
|
||||||
|
*/
|
||||||
|
export const create = (params: TcreateReq) => {
|
||||||
|
return post<IResponse<boolean>>({
|
||||||
|
url: '/prod-api/app-api/business/app/project/create',
|
||||||
|
data: params,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取具有上下级的字典信息
|
||||||
|
* @param params
|
||||||
|
* @returns
|
||||||
|
*/
|
||||||
|
export const parent = (params: { type: string | number; parentId: number }) => {
|
||||||
|
return get<IResponse<parentRes[]>>({
|
||||||
|
url: '/prod-api/app-api/business/app/dict/parent',
|
||||||
|
params,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取具有上下级的字典信息
|
||||||
|
* @param params
|
||||||
|
* @returns
|
||||||
|
*/
|
||||||
|
export const indexTabs = () => {
|
||||||
|
return get<IResponse<parentRes[]>>({
|
||||||
|
url: '/prod-api/app-api/business/project/index/index-tab3',
|
||||||
|
})
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 模糊查询获取标签内容
|
||||||
|
* @param params
|
||||||
|
* @returns
|
||||||
|
*/
|
||||||
|
export const keywords = (params: { type: string | number; keywords: string }) => {
|
||||||
|
return get<IResponse<boolean>>({
|
||||||
|
url: '/prod-api/app-api/business/app/dict/label-keywords',
|
||||||
|
params,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取格式类型字典信息
|
||||||
|
* @param params
|
||||||
|
* @returns
|
||||||
|
*/
|
||||||
|
export const labels = (params: { type: string | number }) => {
|
||||||
|
return get<IResponse<boolean>>({
|
||||||
|
url: '/prod-api/app-api/business/app/dict/labels',
|
||||||
|
params,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获得项目表内容信息分页
|
||||||
|
* @param params
|
||||||
|
* @returns
|
||||||
|
*/
|
||||||
|
export const page = (params: pageReq) => {
|
||||||
|
return get<IResponse<pageRes>>({
|
||||||
|
url: '/prod-api/app-api/business/app/project-draw/page',
|
||||||
|
params,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获得项目表内容信息分页
|
||||||
|
* @param params
|
||||||
|
* @returns
|
||||||
|
*/
|
||||||
|
export const recommendTop = (params: recommendTopReq) => {
|
||||||
|
return get<IResponse<recommendTopRes[]>>({
|
||||||
|
url: '/prod-api/app-api/business/app/project-draw/recommend-top',
|
||||||
|
params,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 首页-标签
|
||||||
|
*/
|
||||||
|
export const homeLabel = () => {
|
||||||
|
return get<IResponse<ProjectDictNodeVO[]>>({
|
||||||
|
url: '/prod-api/app-api/business/app/dict/index-tab',
|
||||||
|
})
|
||||||
|
}
|
||||||
160
api/upnew/types.ts
Normal file
@ -0,0 +1,160 @@
|
|||||||
|
// 定义 files 数组中每个元素的类型
|
||||||
|
export interface FileItem {
|
||||||
|
id: number
|
||||||
|
title: string
|
||||||
|
drawId: number
|
||||||
|
type: number
|
||||||
|
url: string
|
||||||
|
sort: number
|
||||||
|
}
|
||||||
|
|
||||||
|
// 定义整个 JSON 对象的类型
|
||||||
|
export interface TcreateReq {
|
||||||
|
activeName: string
|
||||||
|
id: number | string
|
||||||
|
type: any[]
|
||||||
|
isDomestic: number | string
|
||||||
|
province: string // 省份编码
|
||||||
|
city: string // 城市编码
|
||||||
|
county: string // 区县编码
|
||||||
|
draws: TcreateDrawsReq[]
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface TcreateDrawsReq {
|
||||||
|
id: number | string
|
||||||
|
projectId: number | string
|
||||||
|
title: string
|
||||||
|
description: string
|
||||||
|
ownedUserId: string
|
||||||
|
editions: string
|
||||||
|
labels: any[]
|
||||||
|
type: number
|
||||||
|
source: number | string
|
||||||
|
editType: boolean | string
|
||||||
|
status: any
|
||||||
|
createAddress: string
|
||||||
|
createIp: string
|
||||||
|
files: FileItem[]
|
||||||
|
province: string // 省份编码
|
||||||
|
city: string // 城市编码
|
||||||
|
county: string // 区县编码
|
||||||
|
points: number | undefined // 金币
|
||||||
|
projectType: any[] // 项目类型
|
||||||
|
formatType: any[] // 格式类型
|
||||||
|
coverImages: any[] // 封面图片
|
||||||
|
otherFiles: any[] // 附件信息
|
||||||
|
renderings: any[] // 效果图
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface pageReq {
|
||||||
|
pageNo?: number
|
||||||
|
pageSize?: number
|
||||||
|
projectId?: number | string
|
||||||
|
title?: string
|
||||||
|
ownedUserId?: string
|
||||||
|
editions?: string
|
||||||
|
labels?: any[]
|
||||||
|
type?: number // 类型: 1 图纸 2 文本 3 模型
|
||||||
|
source?: number | string
|
||||||
|
editType?: boolean | string
|
||||||
|
status?: any
|
||||||
|
createAddress?: string
|
||||||
|
createIp?: string
|
||||||
|
projectType?: string
|
||||||
|
}
|
||||||
|
export interface pageRes {
|
||||||
|
list: {
|
||||||
|
id?: number
|
||||||
|
projectId?: number
|
||||||
|
title?: string
|
||||||
|
editions?: string[]
|
||||||
|
ownedUserIdInfo?: any
|
||||||
|
type?: number
|
||||||
|
createTime?: string
|
||||||
|
projectType?: string[]
|
||||||
|
status?: number
|
||||||
|
recommend?: boolean
|
||||||
|
points?: number
|
||||||
|
iconUrl?: string
|
||||||
|
previewPoint?: number
|
||||||
|
commentsPoint?: number
|
||||||
|
hotPoint?: number
|
||||||
|
}[]
|
||||||
|
total: number
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface recommendTopReq {
|
||||||
|
/** 类型: 1 图纸 2 文本 3 模型 */
|
||||||
|
type: number
|
||||||
|
/** 项目分类 */
|
||||||
|
projectType: number
|
||||||
|
/** 是否国内 0 国外 1 国内 */
|
||||||
|
isDomestic: number
|
||||||
|
}
|
||||||
|
export interface recommendTopRes {
|
||||||
|
/** 主键 */
|
||||||
|
id: number
|
||||||
|
/** 项目id */
|
||||||
|
projectId: number
|
||||||
|
/** 标题 */
|
||||||
|
title: string
|
||||||
|
/** 版本 */
|
||||||
|
editions: any[]
|
||||||
|
/** 类型: 1 图纸 2 文本 3 模型 */
|
||||||
|
type: number
|
||||||
|
/** 创建时间 */
|
||||||
|
createTime: string
|
||||||
|
/** 项目分类 */
|
||||||
|
projectType: any[]
|
||||||
|
/** 状态 */
|
||||||
|
status: number
|
||||||
|
/** 是否推荐 */
|
||||||
|
recommend: boolean
|
||||||
|
/** 金币 */
|
||||||
|
points: number
|
||||||
|
/** 封面图片 */
|
||||||
|
iconUrl: string
|
||||||
|
/** 热度 */
|
||||||
|
hotPoint: number
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取具有上下级的字典信息
|
||||||
|
*/
|
||||||
|
export interface parentRes {
|
||||||
|
/** 主键 */
|
||||||
|
id: number
|
||||||
|
/** 名称 */
|
||||||
|
name: string
|
||||||
|
/** 父级id */
|
||||||
|
parentId: number
|
||||||
|
/** 类型 */
|
||||||
|
type: number
|
||||||
|
/** 是否子级 */
|
||||||
|
isChildren: boolean
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 首页-标签
|
||||||
|
*/
|
||||||
|
export interface ProjectDictNodeVO {
|
||||||
|
id: string
|
||||||
|
parentId: string
|
||||||
|
name: string
|
||||||
|
isChildren: boolean
|
||||||
|
sort: number
|
||||||
|
children: {
|
||||||
|
id: string
|
||||||
|
parentId: string
|
||||||
|
name: string
|
||||||
|
isChildren: boolean
|
||||||
|
sort: number
|
||||||
|
children: {
|
||||||
|
id: string
|
||||||
|
parentId: string
|
||||||
|
name: string
|
||||||
|
isChildren: boolean
|
||||||
|
sort: number
|
||||||
|
}[]
|
||||||
|
}[]
|
||||||
|
}
|
||||||
6
app.vue
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<NuxtLoadingIndicator />
|
||||||
|
<NuxtWelcome />
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
BIN
assets/images/1.png
Normal file
|
After Width: | Height: | Size: 149 B |
BIN
assets/images/2.png
Normal file
|
After Width: | Height: | Size: 257 B |
BIN
assets/images/3.png
Normal file
|
After Width: | Height: | Size: 441 B |
BIN
assets/images/4.png
Normal file
|
After Width: | Height: | Size: 8.8 KiB |
BIN
assets/images/404.png
Normal file
|
After Width: | Height: | Size: 96 KiB |
BIN
assets/images/404_cloud.png
Normal file
|
After Width: | Height: | Size: 4.7 KiB |
BIN
assets/images/account.png
Normal file
|
After Width: | Height: | Size: 800 B |
BIN
assets/images/add.png
Normal file
|
After Width: | Height: | Size: 5.9 KiB |
BIN
assets/images/add2.png
Normal file
|
After Width: | Height: | Size: 962 B |
BIN
assets/images/add3.png
Normal file
|
After Width: | Height: | Size: 739 B |
BIN
assets/images/add4.png
Normal file
|
After Width: | Height: | Size: 691 B |
BIN
assets/images/add5.png
Normal file
|
After Width: | Height: | Size: 614 B |
BIN
assets/images/add6.png
Normal file
|
After Width: | Height: | Size: 609 B |
BIN
assets/images/add7.png
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
assets/images/add8.png
Normal file
|
After Width: | Height: | Size: 6.1 KiB |
BIN
assets/images/architectural_example-imperial.dwg
Normal file
BIN
assets/images/aucad.png
Normal file
|
After Width: | Height: | Size: 42 KiB |
BIN
assets/images/avater.png
Normal file
|
After Width: | Height: | Size: 15 KiB |
BIN
assets/images/avater2.png
Normal file
|
After Width: | Height: | Size: 13 KiB |
BIN
assets/images/banner.png
Normal file
|
After Width: | Height: | Size: 420 KiB |
BIN
assets/images/banner2.png
Normal file
|
After Width: | Height: | Size: 162 KiB |
BIN
assets/images/cad-industrial-design.png
Normal file
|
After Width: | Height: | Size: 244 KiB |
BIN
assets/images/cad-workstation.png
Normal file
|
After Width: | Height: | Size: 283 KiB |
BIN
assets/images/cad_0 (1).png
Normal file
|
After Width: | Height: | Size: 556 B |
BIN
assets/images/cad_0 (2).png
Normal file
|
After Width: | Height: | Size: 470 B |
BIN
assets/images/cad_0 (3).png
Normal file
|
After Width: | Height: | Size: 429 B |
BIN
assets/images/cad_0 (4).png
Normal file
|
After Width: | Height: | Size: 395 B |
BIN
assets/images/card2.png
Normal file
|
After Width: | Height: | Size: 1.8 MiB |
BIN
assets/images/chat.png
Normal file
|
After Width: | Height: | Size: 1.2 KiB |
BIN
assets/images/collect.png
Normal file
|
After Width: | Height: | Size: 649 B |
BIN
assets/images/community-banner.png
Normal file
|
After Width: | Height: | Size: 245 KiB |
BIN
assets/images/community-bg.png
Normal file
|
After Width: | Height: | Size: 2.9 KiB |
BIN
assets/images/demo.png
Normal file
|
After Width: | Height: | Size: 48 KiB |
BIN
assets/images/detail.png
Normal file
|
After Width: | Height: | Size: 388 KiB |
BIN
assets/images/download.png
Normal file
|
After Width: | Height: | Size: 145 KiB |
BIN
assets/images/email-v2.png
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
assets/images/email.png
Normal file
|
After Width: | Height: | Size: 2.2 KiB |
BIN
assets/images/empty.png
Normal file
|
After Width: | Height: | Size: 15 KiB |
BIN
assets/images/fabu.png
Normal file
|
After Width: | Height: | Size: 588 B |
BIN
assets/images/fabu_2 (1).png
Normal file
|
After Width: | Height: | Size: 630 B |
BIN
assets/images/fabu_2 (2).png
Normal file
|
After Width: | Height: | Size: 839 B |
BIN
assets/images/fabu_2 (3).png
Normal file
|
After Width: | Height: | Size: 832 B |
BIN
assets/images/fans.png
Normal file
|
After Width: | Height: | Size: 639 B |
BIN
assets/images/file.png
Normal file
|
After Width: | Height: | Size: 287 B |
BIN
assets/images/folder.png
Normal file
|
After Width: | Height: | Size: 255 B |
BIN
assets/images/foreign_banner.png
Normal file
|
After Width: | Height: | Size: 353 KiB |
BIN
assets/images/hardware-tools.png
Normal file
|
After Width: | Height: | Size: 516 KiB |
BIN
assets/images/hot.png
Normal file
|
After Width: | Height: | Size: 1015 B |
BIN
assets/images/industrial-robots.png
Normal file
|
After Width: | Height: | Size: 264 KiB |
BIN
assets/images/info_1 (1).png
Normal file
|
After Width: | Height: | Size: 2.1 KiB |
BIN
assets/images/info_1 (2).png
Normal file
|
After Width: | Height: | Size: 1004 B |
BIN
assets/images/info_1 (3).png
Normal file
|
After Width: | Height: | Size: 2.4 KiB |
BIN
assets/images/info_1 (4).png
Normal file
|
After Width: | Height: | Size: 1.3 KiB |
BIN
assets/images/info_1 (5).png
Normal file
|
After Width: | Height: | Size: 2.3 KiB |
BIN
assets/images/info_1 (6).png
Normal file
|
After Width: | Height: | Size: 1.3 KiB |
BIN
assets/images/laptop-workspace.png
Normal file
|
After Width: | Height: | Size: 156 KiB |
BIN
assets/images/login-illustration.png
Normal file
|
After Width: | Height: | Size: 77 KiB |
BIN
assets/images/logo.jpg
Normal file
|
After Width: | Height: | Size: 25 KiB |
BIN
assets/images/logo2.png
Normal file
|
After Width: | Height: | Size: 5.5 KiB |
BIN
assets/images/logo3.png
Normal file
|
After Width: | Height: | Size: 3.2 KiB |
BIN
assets/images/logo4.jpg
Normal file
|
After Width: | Height: | Size: 2.6 KiB |
BIN
assets/images/logo5.png
Normal file
|
After Width: | Height: | Size: 5.6 KiB |
BIN
assets/images/look.png
Normal file
|
After Width: | Height: | Size: 1.5 KiB |
BIN
assets/images/main.png
Normal file
|
After Width: | Height: | Size: 420 KiB |
BIN
assets/images/message.png
Normal file
|
After Width: | Height: | Size: 620 B |
BIN
assets/images/name_bg.png
Normal file
|
After Width: | Height: | Size: 3.8 KiB |
BIN
assets/images/no1.png
Normal file
|
After Width: | Height: | Size: 4.7 KiB |
BIN
assets/images/no2.png
Normal file
|
After Width: | Height: | Size: 4.7 KiB |
BIN
assets/images/no3.png
Normal file
|
After Width: | Height: | Size: 5.1 KiB |
BIN
assets/images/password.png
Normal file
|
After Width: | Height: | Size: 830 B |
BIN
assets/images/pay.png
Normal file
|
After Width: | Height: | Size: 998 B |
BIN
assets/images/phone-v2.png
Normal file
|
After Width: | Height: | Size: 1.0 KiB |
BIN
assets/images/phone.png
Normal file
|
After Width: | Height: | Size: 2.4 KiB |
BIN
assets/images/preview.png
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
assets/images/qq-v2.png
Normal file
|
After Width: | Height: | Size: 1.0 KiB |
BIN
assets/images/qq.png
Normal file
|
After Width: | Height: | Size: 1.2 KiB |
BIN
assets/images/sign.png
Normal file
|
After Width: | Height: | Size: 31 KiB |
BIN
assets/images/tip.png
Normal file
|
After Width: | Height: | Size: 1.8 KiB |
BIN
assets/images/user.png
Normal file
|
After Width: | Height: | Size: 1.1 KiB |