From e8b96a541ec9a2e64bb30bbc2b71286307c16efa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E5=BF=A0=E6=9E=97?= <170083662@qq.com> Date: Sun, 20 Oct 2024 13:46:54 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=B7=B2=E7=9F=A5=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/shop/shopMerchantApply/model/index.ts | 2 +- api/system/company/model/index.ts | 2 + api/system/companyComment/model/index.ts | 10 +- api/system/companyGit/index.ts | 106 +++++++++ api/system/companyGit/model/index.ts | 41 ++++ api/system/user/model/index.ts | 5 +- components/AppHeader.vue | 15 +- composables/configState.ts | 1 + pages/developer/index.vue | 17 +- pages/item/components/Comments.vue | 44 ++-- pages/item/components/PageBanner.vue | 2 +- pages/item/index.vue | 36 +-- pages/user/components/Auth.vue | 275 +++++++++++++++++----- 13 files changed, 432 insertions(+), 124 deletions(-) create mode 100644 api/system/companyGit/index.ts create mode 100644 api/system/companyGit/model/index.ts diff --git a/api/shop/shopMerchantApply/model/index.ts b/api/shop/shopMerchantApply/model/index.ts index 87d01b2..bf78950 100644 --- a/api/shop/shopMerchantApply/model/index.ts +++ b/api/shop/shopMerchantApply/model/index.ts @@ -7,7 +7,7 @@ export interface ShopMerchantApply { // ID applyId?: number; // 认证类型 - type?: string; + type?: number; // 商户名称 merchantName?: string; // 社会信用代码 diff --git a/api/system/company/model/index.ts b/api/system/company/model/index.ts index e9dfb90..3a2b0a7 100644 --- a/api/system/company/model/index.ts +++ b/api/system/company/model/index.ts @@ -1,6 +1,7 @@ import type { PageParam } from '@/api'; import type {CompanyParameter} from "~/api/system/companyParameter/model"; import type {CompanyUrl} from "~/api/system/companyUrl/model"; +import type {CompanyGit} from "~/api/system/companyGit/model"; /** * 企业信息 @@ -90,6 +91,7 @@ export interface Company { installed?: boolean; parameters?: CompanyParameter[]; links?: CompanyUrl[]; + gits?: CompanyGit[]; } /** diff --git a/api/system/companyComment/model/index.ts b/api/system/companyComment/model/index.ts index ef8cae9..45d4b6c 100644 --- a/api/system/companyComment/model/index.ts +++ b/api/system/companyComment/model/index.ts @@ -13,7 +13,7 @@ export interface CompanyComment { // 企业ID companyId?: number; // 评分 - rate?: string; + rate?: number; // 排序(数字越小越靠前) sortNumber?: number; // 评论内容 @@ -22,8 +22,14 @@ export interface CompanyComment { status?: number; // 租户id tenantId?: number; + // 租户名称 + tenantName?: string; + // 企业 + logo?: string; // 创建时间 createTime?: string; + // 子列表 + children?: CompanyComment[]; } /** @@ -31,5 +37,7 @@ export interface CompanyComment { */ export interface CompanyCommentParam extends PageParam { id?: number; + userId?: number; + tenantId?: number; keywords?: string; } diff --git a/api/system/companyGit/index.ts b/api/system/companyGit/index.ts new file mode 100644 index 0000000..8e0694b --- /dev/null +++ b/api/system/companyGit/index.ts @@ -0,0 +1,106 @@ +import request from '@/utils/request'; +import type { ApiResult, PageResult } from '@/api'; +import type { CompanyGit, CompanyGitParam } from './model'; +import { SERVER_API_URL } from '@/config/index'; + +/** + * 分页查询代码仓库 + */ +export async function pageCompanyGit(params: CompanyGitParam) { + const res = await request.get>>( + SERVER_API_URL + '/system/company-git/page', + { + params + } + ); + if (res.data.code === 0) { + return res.data.data; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 查询代码仓库列表 + */ +export async function listCompanyGit(params?: CompanyGitParam) { + const res = await request.get>( + SERVER_API_URL + '/system/company-git', + { + params + } + ); + if (res.data.code === 0 && res.data.data) { + return res.data.data; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 添加代码仓库 + */ +export async function addCompanyGit(data: CompanyGit) { + const res = await request.post>( + SERVER_API_URL + '/system/company-git', + data + ); + if (res.data.code === 0) { + return res.data.message; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 修改代码仓库 + */ +export async function updateCompanyGit(data: CompanyGit) { + const res = await request.put>( + SERVER_API_URL + '/system/company-git', + data + ); + if (res.data.code === 0) { + return res.data.message; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 删除代码仓库 + */ +export async function removeCompanyGit(id?: number) { + const res = await request.delete>( + SERVER_API_URL + '/system/company-git/' + id + ); + if (res.data.code === 0) { + return res.data.message; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 批量删除代码仓库 + */ +export async function removeBatchCompanyGit(data: (number | undefined)[]) { + const res = await request.delete>( + SERVER_API_URL + '/system/company-git/batch', + { + data + } + ); + if (res.data.code === 0) { + return res.data.message; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 根据id查询代码仓库 + */ +export async function getCompanyGit(id: number) { + const res = await request.get>( + SERVER_API_URL + '/system/company-git/' + id + ); + if (res.data.code === 0 && res.data.data) { + return res.data.data; + } + return Promise.reject(new Error(res.data.message)); +} diff --git a/api/system/companyGit/model/index.ts b/api/system/companyGit/model/index.ts new file mode 100644 index 0000000..901a7cd --- /dev/null +++ b/api/system/companyGit/model/index.ts @@ -0,0 +1,41 @@ +import type { PageParam } from '@/api'; + +/** + * 代码仓库 + */ +export interface CompanyGit { + // 自增ID + id?: number; + // 仓库名称 + title?: string; + // 厂商 0私有仓库 1github 2gitee 3其他 + brand?: string; + // 语言 + language?: string; + // 企业ID + companyId?: number; + // 仓库地址 + domain?: string; + // 账号 + account?: string; + // 密码 + password?: string; + // 仓库描述 + comments?: string; + // 排序(数字越小越靠前) + sortNumber?: number; + // 状态, 0正常, 1待确认 + status?: number; + // 创建时间 + createTime?: string; + // 租户id + tenantId?: number; +} + +/** + * 代码仓库搜索条件 + */ +export interface CompanyGitParam extends PageParam { + id?: number; + keywords?: string; +} diff --git a/api/system/user/model/index.ts b/api/system/user/model/index.ts index 0796716..83b9513 100644 --- a/api/system/user/model/index.ts +++ b/api/system/user/model/index.ts @@ -120,8 +120,11 @@ export interface User { platform?: string; // 排序 sortNumber?: number; - deleted?: number; + // 实名认证状态 + certification?: boolean; + // 实名认证类型 + certificationType?: number; } /** diff --git a/components/AppHeader.vue b/components/AppHeader.vue index feae1af..23bfdcc 100644 --- a/components/AppHeader.vue +++ b/components/AppHeader.vue @@ -45,11 +45,16 @@

{{ item.title }}

- - - - - + + +

开发者中心

+
+
+ + +

开发者中心

+
+
diff --git a/composables/configState.ts b/composables/configState.ts index 5ffc3fd..08b8068 100644 --- a/composables/configState.ts +++ b/composables/configState.ts @@ -56,6 +56,7 @@ export const useUser = () => nickname: '', gradeId: 0, gradeName: '', + certification: false, tenantId: 0, tenantName: '', }; diff --git a/pages/developer/index.vue b/pages/developer/index.vue index 86d6f76..e45f4b7 100644 --- a/pages/developer/index.vue +++ b/pages/developer/index.vue @@ -82,6 +82,7 @@ import {useWebsite} from "~/composables/configState"; import type {Navigation} from "~/api/cms/navigation/model"; import type {CompanyParam} from "~/api/system/company/model"; import type {Article} from "~/api/cms/article/model"; +import type {ShopMerchant} from "~/api/shop/shopMerchant/model"; const route = useRoute(); // 页面信息 @@ -129,16 +130,12 @@ const reload = async (path: string) => { } } -// const { data: nav } = await useServerRequest>('/cms/cms-navigation/getNavigationByPath',{query: {path: route.path}}) -// console.log(nav.value?.data) -// if(nav.value?.data){ -// form.value = nav.value?.data; -// console.log(form.value,'form...') -// } -// // 页面布局 -// if(form.value?.layout){ -// layout.value = JSON.parse(form.value?.layout) -// } +const {data: response} = await useServerRequest>('/shop/shop-merchant-apply/getByUserId') +if (response.value?.data) { + if (response.value.data.status == 2) { + loginDeveloperCenterByToken(); + } +} useHead({ title: `开发者中心 - ${website.value?.websiteName}`, diff --git a/pages/item/components/Comments.vue b/pages/item/components/Comments.vue index 883dcbc..44d4027 100644 --- a/pages/item/components/Comments.vue +++ b/pages/item/components/Comments.vue @@ -26,19 +26,19 @@ style="border-bottom:1px solid #f3f3f3">