diff --git a/.env.development b/.env.development index 9c0c795..db70fbc 100644 --- a/.env.development +++ b/.env.development @@ -5,7 +5,7 @@ VITE_THINK_URL=https://gxtyzx-api.websoft.top/api VITE_API_URL=https://modules.gxwebsoft.com/api -VITE_SERVER_URL=http://127.0.0.1:9090/api +VITE_SERVER_URL=https://common-api.websoft.top/api #VITE_API_URL=http://127.0.0.1:9001/api #VITE_THINK_URL=http://127.0.0.1:9099/api #/booking/bookingItem diff --git a/.env.production b/.env.production index b356e41..8f9990d 100644 --- a/.env.production +++ b/.env.production @@ -1,5 +1,5 @@ VITE_APP_NAME=后台管理系统 VITE_SOCKET_URL=wss://server.gxwebsoft.com -VITE_SERVER_URL=https://server.gxwebsoft.com/api +VITE_SERVER_URL=https://common-api.websoft.top/api VITE_THINK_URL=https://gxtyzx-api.websoft.top/api VITE_API_URL=https://modules.gxwebsoft.com/api diff --git a/src/api/cms/cmsArticle/model/index.ts b/src/api/cms/cmsArticle/model/index.ts index 91885c0..3d81998 100644 --- a/src/api/cms/cmsArticle/model/index.ts +++ b/src/api/cms/cmsArticle/model/index.ts @@ -28,6 +28,12 @@ export interface CmsArticle { virtualViews?: number; // 实际阅读量 actualViews?: number; + // 浏览权限(0公开 1会员 2密码) + permission?: number; + // 访问密码 + password?: string; + // 确认密码 + password2?: string; // 发布来源客户端 (APP、H5、小程序等) platform?: string; // 文章附件 diff --git a/src/api/system/website/field/index.ts b/src/api/system/website/field/index.ts index 40113eb..962ece8 100644 --- a/src/api/system/website/field/index.ts +++ b/src/api/system/website/field/index.ts @@ -5,7 +5,7 @@ import type { WebsiteField, WebsiteFieldParam } from '@/api/cms/website/field/model'; -import { MODULES_API_URL, SERVER_API_URL } from '@/config/setting'; +import { SERVER_API_URL } from '@/config/setting'; /** * 分页查询项目参数 @@ -134,7 +134,7 @@ export async function checkExistence( */ export async function configWebsiteField(params?: WebsiteFieldParam) { const res = await request.get>( - MODULES_API_URL + '/cms/website-field/config', + SERVER_API_URL + '/cms/website-field/config', { params } @@ -150,7 +150,7 @@ export async function configWebsiteField(params?: WebsiteFieldParam) { */ export async function undeleteWebsiteField(id?: number) { const res = await request.delete>( - MODULES_API_URL + '/cms/website-field/undelete/' + id + SERVER_API_URL + '/cms/website-field/undelete/' + id ); if (res.data.code === 0) { return res.data.message; diff --git a/src/layout/components/header-tools.vue b/src/layout/components/header-tools.vue index 38cbbfa..405127d 100644 --- a/src/layout/components/header-tools.vue +++ b/src/layout/components/header-tools.vue @@ -310,19 +310,24 @@ } // 获取网站域名 if (!localStorage.getItem('Domain')) { - if (loginUser.value.tenantId == 5) { - listCmsWebsite({ status: 1 }).then((res) => { - if (res.length > 0) { - localStorage.setItem('Domain', `websoft.top`); - } - }); - } else { - listWebsite({}).then((res) => { - if (res.length > 0) { - localStorage.setItem('Domain', `${res[0].websiteCode}.wsdns.cn`); - } - }); - } + listCmsWebsite({ status: 1 }).then((res) => { + if (res.length > 0) { + localStorage.setItem('Domain', `websoft.top`); + } + }); + // if (loginUser.value.tenantId == 5) { + // listCmsWebsite({ status: 1 }).then((res) => { + // if (res.length > 0) { + // localStorage.setItem('Domain', `websoft.top`); + // } + // }); + // } else { + // listWebsite({}).then((res) => { + // if (res.length > 0) { + // localStorage.setItem('Domain', `${res[0].websiteCode}.wsdns.cn`); + // } + // }); + // } } // 更新商户ID和名称 diff --git a/src/layout/index.vue b/src/layout/index.vue index 009df17..510eb25 100644 --- a/src/layout/index.vue +++ b/src/layout/index.vue @@ -119,7 +119,7 @@ setHomeComponents } from '@/utils/page-tab-util'; import type { TabCtxMenuOption } from 'ele-admin-pro/es/ele-pro-layout/types'; - import { hasPermission } from "@/utils/permission"; + import { hasPermission } from '@/utils/permission'; const { push } = useRouter(); const { t, locale } = useI18n(); diff --git a/src/utils/common.ts b/src/utils/common.ts index e4525ff..dcd8a61 100644 --- a/src/utils/common.ts +++ b/src/utils/common.ts @@ -433,6 +433,6 @@ export const getIdBySpm = (index: number) => { export const getTokenBySpm = () => { const token = router.currentRoute.value.query.token; if (token) { - return JSON.parse(`${token}`); + return `${token}`; } }; diff --git a/src/views/cms/cmsArticle/components/articleEdit.vue b/src/views/cms/cmsArticle/components/articleEdit.vue index f6e3809..0518668 100644 --- a/src/views/cms/cmsArticle/components/articleEdit.vue +++ b/src/views/cms/cmsArticle/components/articleEdit.vue @@ -124,6 +124,24 @@ v-model:value="form.virtualViews" /> + + + 所有人可见 + 登录可见 + 密码可见 + + + + + @@ -191,6 +209,7 @@ const files = ref([]); const category = ref([]); const takeaway = ref([]); + const password = ref(); // 用户信息 const form = reactive({ @@ -214,6 +233,9 @@ virtualViews: 0, // 实际阅读量 actualViews: 0, + permission: 0, + password: undefined, + password2: undefined, // 用户ID userId: undefined, files: '', @@ -433,6 +455,9 @@ .validate() .then(() => { loading.value = true; + if(password.value){ + form.password = password.value + } const formData = { ...form, content: content.value diff --git a/src/views/cms/cmsNavigation/components/navigation-edit.vue b/src/views/cms/cmsNavigation/components/navigation-edit.vue index 535b037..8c0cf36 100644 --- a/src/views/cms/cmsNavigation/components/navigation-edit.vue +++ b/src/views/cms/cmsNavigation/components/navigation-edit.vue @@ -142,7 +142,11 @@ name="password" v-if="form.permission == 2" > - {{ form.password }} + @@ -196,6 +200,7 @@ const loading = ref(false); // 已上传数据 const images = ref([]); + const password = ref(); // 表单数据 const { form, resetFields, assignFields } = useFormData({ @@ -370,6 +375,9 @@ formRef.value .validate() .then(() => { + if (password.value) { + form.password = password.value; + } const navigationForm = { ...form, parentId: form.parentId || 0 diff --git a/src/views/cms/cmsProduct/components/cmsProductEdit.vue b/src/views/cms/cmsProduct/components/cmsProductEdit.vue index efda5b2..b93a76d 100644 --- a/src/views/cms/cmsProduct/components/cmsProductEdit.vue +++ b/src/views/cms/cmsProduct/components/cmsProductEdit.vue @@ -120,8 +120,9 @@ - 显示 - 隐藏 + 已上架 + 待审核 + 已下架 diff --git a/src/views/cms/cmsProduct/index.vue b/src/views/cms/cmsProduct/index.vue index 60870b6..1c61416 100644 --- a/src/views/cms/cmsProduct/index.vue +++ b/src/views/cms/cmsProduct/index.vue @@ -33,8 +33,8 @@ > @@ -58,8 +62,15 @@ } from 'ele-admin-pro/es/ele-pro-table/types'; import Search from './components/search.vue'; import GoodsSpecRelEdit from './components/goodsSpecRelEdit.vue'; - import { pageGoodsSpecRel, removeGoodsSpecRel, removeBatchGoodsSpecRel } from '@/api/shop/goodsSpecRel'; - import type { GoodsSpecRel, GoodsSpecRelParam } from '@/api/shop/goodsSpecRel/model'; + import { + pageGoodsSpecRel, + removeGoodsSpecRel, + removeBatchGoodsSpecRel + } from '@/api/shop/goodsSpecRel'; + import type { + GoodsSpecRel, + GoodsSpecRelParam + } from '@/api/shop/goodsSpecRel/model'; // 表格实例 const tableRef = ref | null>(null); diff --git a/src/views/shop/merchant/index.vue b/src/views/shop/merchant/index.vue index a3f850a..5bde7fd 100644 --- a/src/views/shop/merchant/index.vue +++ b/src/views/shop/merchant/index.vue @@ -69,7 +69,7 @@ removeBatchMerchant } from '@/api/shop/merchant'; import type { Merchant, MerchantParam } from '@/api/shop/merchant/model'; - import { getMerchantId, openUrl } from "@/utils/common"; + import { getMerchantId } from '@/utils/common'; import router from '@/router'; // 表格实例 diff --git a/src/views/shop/spec/index.vue b/src/views/shop/spec/index.vue index e72933f..fd8794c 100644 --- a/src/views/shop/spec/index.vue +++ b/src/views/shop/spec/index.vue @@ -81,7 +81,7 @@ import SpecEdit from './components/specEdit.vue'; import { pageSpec, removeSpec, removeBatchSpec } from '@/api/shop/spec'; import type { Spec, SpecParam } from '@/api/shop/spec/model'; - import { getMerchantId } from "@/utils/merchant"; + import { getMerchantId } from '@/utils/merchant'; // 表格实例 const tableRef = ref | null>(null); diff --git a/src/views/shop/specValue/index.vue b/src/views/shop/specValue/index.vue index 1f04498..8ed3fbe 100644 --- a/src/views/shop/specValue/index.vue +++ b/src/views/shop/specValue/index.vue @@ -77,7 +77,6 @@ } from '@/api/shop/specValue'; import type { SpecValue, SpecValueParam } from '@/api/shop/specValue/model'; import { Spec } from '@/api/shop/spec/model'; - import { FormInstance } from 'ant-design-vue/es/form'; const props = defineProps<{ // 弹窗是否打开