diff --git a/.env.development b/.env.development index 3cd8bf0..f31b978 100644 --- a/.env.development +++ b/.env.development @@ -9,8 +9,8 @@ # 只在开发模式中被载入 # 网站前缀 -# VITE_BASE_API_URL = http://192.168.2.217:8089/server/ -VITE_BASE_API_URL = http://43.137.2.78:8085/server/ +VITE_BASE_API_URL = http://192.168.2.33:8089/server/ +# VITE_BASE_API_URL = http://43.137.2.78:8085/server/ # base api VITE_BASE_API = '/server/' diff --git a/src/api/knowledgeBase/index.ts b/src/api/knowledgeBase/index.ts index 3f3bb90..3eef31b 100644 --- a/src/api/knowledgeBase/index.ts +++ b/src/api/knowledgeBase/index.ts @@ -76,6 +76,17 @@ export function findOneById(params: { id: string }) { }); } +/** + * @description 增加阅读次数 + */ +export function addReadCount(params: { id: string }) { + return request({ + url: `knowledge/readAdd`, + method: 'get', + params, + }); +} + /** * @description 删除单条 ?id=${data.id} */ diff --git a/src/api/login/model.d.ts b/src/api/login/model.d.ts index de59908..35079d7 100644 --- a/src/api/login/model.d.ts +++ b/src/api/login/model.d.ts @@ -36,6 +36,7 @@ declare namespace API { username: string; password: string; account: string; + sex?: number; }; /** 登录成功结果 */ diff --git a/src/views/client/knowledgeBase/index.vue b/src/views/client/knowledgeBase/index.vue index e20c5c9..0270a72 100644 --- a/src/views/client/knowledgeBase/index.vue +++ b/src/views/client/knowledgeBase/index.vue @@ -43,7 +43,9 @@
更新时间:{{ curRowDetail.createTime }} | - 阅读:123 + 阅读:{{ curRowDetail.readCount }}
@@ -83,7 +85,7 @@ ExportOutlined, LeftOutlined, } from '@ant-design/icons-vue'; - import { fetchKnowledgeBaseList, findOneById } from '@/api/knowledgeBase'; + import { fetchKnowledgeBaseList, findOneById, addReadCount } from '@/api/knowledgeBase'; import { useRoute, useRouter } from 'vue-router'; import { useUserStore } from '@/store/modules/user'; @@ -105,11 +107,13 @@ tags: string; solution: string; createTime: string; + readCount: any; }>({ title: '', tags: '', solution: '', createTime: '', + readCount: 0, }); const goBack = () => { @@ -122,6 +126,11 @@ try { const res = await findOneById({ id: newVal[0] }); curRowDetail.value = res; + const count = await addReadCount({ id: newVal[0] }); + console.log('count: ', count); + if (count) { + curRowDetail.value.readCount = count; + } } catch (error) { console.error(error); } finally { diff --git a/src/views/login/index.vue b/src/views/login/index.vue index cbab508..99e4864 100644 --- a/src/views/login/index.vue +++ b/src/views/login/index.vue @@ -145,6 +145,7 @@ await register({ ...state.formInline, account: state.formInline.username, + sex: 1, }); message.success('注册成功,请联系系统管理员通过审核'); setTimeout(() => { diff --git a/src/views/question/issue/detail.vue b/src/views/question/issue/detail.vue index cf2fd5b..5a51dd8 100644 --- a/src/views/question/issue/detail.vue +++ b/src/views/question/issue/detail.vue @@ -83,6 +83,7 @@ import { findOneById } from '@/api/issue'; import { SvgIcon } from '@/components/basic/svg-icon'; import { stateTypeList } from './data'; + import { fetchVersionPageList } from '@/api/prodVersion'; const props = defineProps({ id: { @@ -160,6 +161,27 @@ }); } + if (res?.productId) { + const { data } = await fetchVersionPageList({ + productId: res?.productId, + current: 1, + size: 999, + }); + if (data && Array.isArray(data) && data.length) { + formRef?.updateSchema({ + field: 'versionId', + componentProps: { + options: data.map((e) => { + return { + label: e.name, + value: e.id, + }; + }), + }, + }); + } + } + current.value = res?.state; formRef?.setFieldsValue(res); diff --git a/src/views/system/user/formSchemas.ts b/src/views/system/user/formSchemas.ts index c291082..e382b74 100644 --- a/src/views/system/user/formSchemas.ts +++ b/src/views/system/user/formSchemas.ts @@ -64,7 +64,7 @@ export const userSchemas: FormSchema[] = [ }, rules: [ { - required: true, + required: false, message: '请输入正确格式的电话号码', pattern: /^1(3[0-9]|4[01456879]|5[0-3,5-9]|6[2567]|7[0-8]|8[0-9]|9[0-3,5-9])\d{8}$/, },