分离common-api端

This commit is contained in:
2024-09-29 17:27:36 +08:00
parent 7a180ee5a7
commit 4f0e83e9cd
18 changed files with 116 additions and 79 deletions
+1 -1
View File
@@ -5,7 +5,7 @@ VITE_THINK_URL=https://gxtyzx-api.websoft.top/api
VITE_API_URL=https://modules.gxwebsoft.com/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_API_URL=http://127.0.0.1:9001/api
#VITE_THINK_URL=http://127.0.0.1:9099/api #VITE_THINK_URL=http://127.0.0.1:9099/api
#/booking/bookingItem #/booking/bookingItem
+1 -1
View File
@@ -1,5 +1,5 @@
VITE_APP_NAME=后台管理系统 VITE_APP_NAME=后台管理系统
VITE_SOCKET_URL=wss://server.gxwebsoft.com 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_THINK_URL=https://gxtyzx-api.websoft.top/api
VITE_API_URL=https://modules.gxwebsoft.com/api VITE_API_URL=https://modules.gxwebsoft.com/api
+6
View File
@@ -28,6 +28,12 @@ export interface CmsArticle {
virtualViews?: number; virtualViews?: number;
// 实际阅读量 // 实际阅读量
actualViews?: number; actualViews?: number;
// 浏览权限(0公开 1会员 2密码)
permission?: number;
// 访问密码
password?: string;
// 确认密码
password2?: string;
// 发布来源客户端 (APP、H5、小程序等) // 发布来源客户端 (APP、H5、小程序等)
platform?: string; platform?: string;
// 文章附件 // 文章附件
+3 -3
View File
@@ -5,7 +5,7 @@ import type {
WebsiteField, WebsiteField,
WebsiteFieldParam WebsiteFieldParam
} from '@/api/cms/website/field/model'; } 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) { export async function configWebsiteField(params?: WebsiteFieldParam) {
const res = await request.get<ApiResult<Config>>( const res = await request.get<ApiResult<Config>>(
MODULES_API_URL + '/cms/website-field/config', SERVER_API_URL + '/cms/website-field/config',
{ {
params params
} }
@@ -150,7 +150,7 @@ export async function configWebsiteField(params?: WebsiteFieldParam) {
*/ */
export async function undeleteWebsiteField(id?: number) { export async function undeleteWebsiteField(id?: number) {
const res = await request.delete<ApiResult<unknown>>( const res = await request.delete<ApiResult<unknown>>(
MODULES_API_URL + '/cms/website-field/undelete/' + id SERVER_API_URL + '/cms/website-field/undelete/' + id
); );
if (res.data.code === 0) { if (res.data.code === 0) {
return res.data.message; return res.data.message;
+18 -13
View File
@@ -310,19 +310,24 @@
} }
// 获取网站域名 // 获取网站域名
if (!localStorage.getItem('Domain')) { if (!localStorage.getItem('Domain')) {
if (loginUser.value.tenantId == 5) { listCmsWebsite({ status: 1 }).then((res) => {
listCmsWebsite({ status: 1 }).then((res) => { if (res.length > 0) {
if (res.length > 0) { localStorage.setItem('Domain', `websoft.top`);
localStorage.setItem('Domain', `websoft.top`); }
} });
}); // if (loginUser.value.tenantId == 5) {
} else { // listCmsWebsite({ status: 1 }).then((res) => {
listWebsite({}).then((res) => { // if (res.length > 0) {
if (res.length > 0) { // localStorage.setItem('Domain', `websoft.top`);
localStorage.setItem('Domain', `${res[0].websiteCode}.wsdns.cn`); // }
} // });
}); // } else {
} // listWebsite({}).then((res) => {
// if (res.length > 0) {
// localStorage.setItem('Domain', `${res[0].websiteCode}.wsdns.cn`);
// }
// });
// }
} }
// 更新商户ID和名称 // 更新商户ID和名称
+1 -1
View File
@@ -119,7 +119,7 @@
setHomeComponents setHomeComponents
} from '@/utils/page-tab-util'; } from '@/utils/page-tab-util';
import type { TabCtxMenuOption } from 'ele-admin-pro/es/ele-pro-layout/types'; 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 { push } = useRouter();
const { t, locale } = useI18n(); const { t, locale } = useI18n();
+1 -1
View File
@@ -433,6 +433,6 @@ export const getIdBySpm = (index: number) => {
export const getTokenBySpm = () => { export const getTokenBySpm = () => {
const token = router.currentRoute.value.query.token; const token = router.currentRoute.value.query.token;
if (token) { if (token) {
return JSON.parse(`${token}`); return `${token}`;
} }
}; };
@@ -124,6 +124,24 @@
v-model:value="form.virtualViews" v-model:value="form.virtualViews"
/> />
</a-form-item> </a-form-item>
<a-form-item label="访问权限" name="permission">
<a-radio-group v-model:value="form.permission">
<a-radio :value="0">所有人可见</a-radio>
<a-radio :value="1">登录可见</a-radio>
<a-radio :value="2">密码可见</a-radio>
</a-radio-group>
</a-form-item>
<a-form-item
label="访问密码"
name="password"
v-if="form.permission == 2"
>
<a-input-password
allow-clear
placeholder="请输入查看密码"
v-model:value="password"
/>
</a-form-item>
</a-tab-pane> </a-tab-pane>
</a-tabs> </a-tabs>
</a-form> </a-form>
@@ -191,6 +209,7 @@
const files = ref<ItemType[]>([]); const files = ref<ItemType[]>([]);
const category = ref<string[]>([]); const category = ref<string[]>([]);
const takeaway = ref<CmsArticleCategory[]>([]); const takeaway = ref<CmsArticleCategory[]>([]);
const password = ref();
// 用户信息 // 用户信息
const form = reactive<CmsArticle>({ const form = reactive<CmsArticle>({
@@ -214,6 +233,9 @@
virtualViews: 0, virtualViews: 0,
// 实际阅读量 // 实际阅读量
actualViews: 0, actualViews: 0,
permission: 0,
password: undefined,
password2: undefined,
// 用户ID // 用户ID
userId: undefined, userId: undefined,
files: '', files: '',
@@ -433,6 +455,9 @@
.validate() .validate()
.then(() => { .then(() => {
loading.value = true; loading.value = true;
if(password.value){
form.password = password.value
}
const formData = { const formData = {
...form, ...form,
content: content.value content: content.value
@@ -142,7 +142,11 @@
name="password" name="password"
v-if="form.permission == 2" v-if="form.permission == 2"
> >
<a-tag>{{ form.password }}</a-tag> <a-input-password
allow-clear
placeholder="请输入查看密码"
v-model:value="password"
/>
</a-form-item> </a-form-item>
</a-col> </a-col>
</a-row> </a-row>
@@ -196,6 +200,7 @@
const loading = ref(false); const loading = ref(false);
// 已上传数据 // 已上传数据
const images = ref<ItemType[]>([]); const images = ref<ItemType[]>([]);
const password = ref();
// 表单数据 // 表单数据
const { form, resetFields, assignFields } = useFormData<CmsNavigation>({ const { form, resetFields, assignFields } = useFormData<CmsNavigation>({
@@ -370,6 +375,9 @@
formRef.value formRef.value
.validate() .validate()
.then(() => { .then(() => {
if (password.value) {
form.password = password.value;
}
const navigationForm = { const navigationForm = {
...form, ...form,
parentId: form.parentId || 0 parentId: form.parentId || 0
@@ -120,8 +120,9 @@
</a-form-item> </a-form-item>
<a-form-item label="状态" name="status"> <a-form-item label="状态" name="status">
<a-radio-group v-model:value="form.status"> <a-radio-group v-model:value="form.status">
<a-radio :value="0">显示</a-radio> <a-radio :value="0">已上架</a-radio>
<a-radio :value="1">隐藏</a-radio> <a-radio :value="1">待审核</a-radio>
<a-radio :value="2">已下架</a-radio>
</a-radio-group> </a-radio-group>
</a-form-item> </a-form-item>
<a-form-item label="排序号" name="sortNumber"> <a-form-item label="排序号" name="sortNumber">
+3 -9
View File
@@ -33,8 +33,8 @@
> >
</template> </template>
<template v-if="column.key === 'status'"> <template v-if="column.key === 'status'">
<a-tag v-if="record.status === 0" color="green">显示</a-tag> <a-tag v-if="record.status === 0" color="green">上架</a-tag>
<a-tag v-if="record.status === 1" color="red">隐藏</a-tag> <a-tag v-if="record.status === 1" color="red">下架</a-tag>
</template> </template>
<template v-if="column.key === 'action'"> <template v-if="column.key === 'action'">
<a-space> <a-space>
@@ -143,7 +143,7 @@
align: 'center' align: 'center'
}, },
{ {
title: '单位名称 (个)', title: '单位',
dataIndex: 'unitName', dataIndex: 'unitName',
key: 'unitName', key: 'unitName',
align: 'center' align: 'center'
@@ -166,12 +166,6 @@
key: 'sales', key: 'sales',
align: 'center' align: 'center'
}, },
{
title: '库存',
dataIndex: 'stock',
key: 'stock',
align: 'center'
},
{ {
title: '推荐', title: '推荐',
dataIndex: 'recommend', dataIndex: 'recommend',
+19 -15
View File
@@ -62,7 +62,11 @@
} from 'ele-admin-pro/es/ele-pro-table/types'; } from 'ele-admin-pro/es/ele-pro-table/types';
import Search from './components/search.vue'; import Search from './components/search.vue';
import GoodsSkuEdit from './components/goodsSkuEdit.vue'; import GoodsSkuEdit from './components/goodsSkuEdit.vue';
import { pageGoodsSku, removeGoodsSku, removeBatchGoodsSku } from '@/api/shop/goodsSku'; import {
pageGoodsSku,
removeGoodsSku,
removeBatchGoodsSku
} from '@/api/shop/goodsSku';
import type { GoodsSku, GoodsSkuParam } from '@/api/shop/goodsSku/model'; import type { GoodsSku, GoodsSkuParam } from '@/api/shop/goodsSku/model';
// 表格实例 // 表格实例
@@ -105,85 +109,85 @@
dataIndex: 'id', dataIndex: 'id',
key: 'id', key: 'id',
align: 'center', align: 'center',
width: 90, width: 90
}, },
{ {
title: '商品ID', title: '商品ID',
dataIndex: 'goodsId', dataIndex: 'goodsId',
key: 'goodsId', key: 'goodsId',
align: 'center', align: 'center'
}, },
{ {
title: '商品属性索引值 (attr_value|attr_value[|....])', title: '商品属性索引值 (attr_value|attr_value[|....])',
dataIndex: 'sku', dataIndex: 'sku',
key: 'sku', key: 'sku',
align: 'center', align: 'center'
}, },
{ {
title: '商品图片', title: '商品图片',
dataIndex: 'image', dataIndex: 'image',
key: 'image', key: 'image',
align: 'center', align: 'center'
}, },
{ {
title: '商品价格', title: '商品价格',
dataIndex: 'price', dataIndex: 'price',
key: 'price', key: 'price',
align: 'center', align: 'center'
}, },
{ {
title: '市场价格', title: '市场价格',
dataIndex: 'salePrice', dataIndex: 'salePrice',
key: 'salePrice', key: 'salePrice',
align: 'center', align: 'center'
}, },
{ {
title: '成本价', title: '成本价',
dataIndex: 'cost', dataIndex: 'cost',
key: 'cost', key: 'cost',
align: 'center', align: 'center'
}, },
{ {
title: '库存', title: '库存',
dataIndex: 'stock', dataIndex: 'stock',
key: 'stock', key: 'stock',
align: 'center', align: 'center'
}, },
{ {
title: 'sku编码', title: 'sku编码',
dataIndex: 'skuNo', dataIndex: 'skuNo',
key: 'skuNo', key: 'skuNo',
align: 'center', align: 'center'
}, },
{ {
title: '唯一值', title: '唯一值',
dataIndex: 'unique', dataIndex: 'unique',
key: 'unique', key: 'unique',
align: 'center', align: 'center'
}, },
{ {
title: '重量', title: '重量',
dataIndex: 'weight', dataIndex: 'weight',
key: 'weight', key: 'weight',
align: 'center', align: 'center'
}, },
{ {
title: '体积', title: '体积',
dataIndex: 'volume', dataIndex: 'volume',
key: 'volume', key: 'volume',
align: 'center', align: 'center'
}, },
{ {
title: '状态, 0正常, 1异常', title: '状态, 0正常, 1异常',
dataIndex: 'status', dataIndex: 'status',
key: 'status', key: 'status',
align: 'center', align: 'center'
}, },
{ {
title: '备注', title: '备注',
dataIndex: 'comments', dataIndex: 'comments',
key: 'comments', key: 'comments',
align: 'center', align: 'center'
}, },
{ {
title: '创建时间', title: '创建时间',
@@ -19,29 +19,12 @@
styleResponsive ? { md: 19, sm: 19, xs: 24 } : { flex: '1' } styleResponsive ? { md: 19, sm: 19, xs: 24 } : { flex: '1' }
" "
> >
<a-form-item label="商品多规格名称" name="goodsSpecName"> <a-form-item label="商品多规格名称" name="specValue">
<a-input <a-input
allow-clear allow-clear
:maxlength="100" :maxlength="100"
placeholder="请输入商品多规格" placeholder="请输入商品多规格"
v-model:value="form.goodsSpecName" v-model:value="form.specValue"
/>
</a-form-item>
<a-form-item label="描述" name="comments">
<a-textarea
:rows="4"
:maxlength="200"
placeholder="请输入描述"
v-model:value="form.comments"
/>
</a-form-item>
<a-form-item label="排序号" name="sortNumber">
<a-input-number
:min="0"
:max="9999"
class="ele-fluid"
placeholder="请输入排序号"
v-model:value="form.sortNumber"
/> />
</a-form-item> </a-form-item>
<a-form-item label="状态" name="status"> <a-form-item label="状态" name="status">
@@ -92,11 +75,10 @@
// 用户信息 // 用户信息
const form = reactive<GoodsSpec>({ const form = reactive<GoodsSpec>({
goodsSpecId: undefined, id: undefined,
goodsSpecName: '', specName: '',
status: 0, specId: undefined,
comments: '', specValue: ''
sortNumber: 100
}); });
/* 更新visible */ /* 更新visible */
@@ -92,7 +92,7 @@
// 用户信息 // 用户信息
const form = reactive<GoodsSpecRel>({ const form = reactive<GoodsSpecRel>({
goodsSpecRelId: undefined, id: undefined,
goodsSpecRelName: '', goodsSpecRelName: '',
status: 0, status: 0,
comments: '', comments: '',
@@ -130,7 +130,9 @@
const formData = { const formData = {
...form ...form
}; };
const saveOrUpdate = isUpdate.value ? updateGoodsSpecRel : addGoodsSpecRel; const saveOrUpdate = isUpdate.value
? updateGoodsSpecRel
: addGoodsSpecRel;
saveOrUpdate(formData) saveOrUpdate(formData)
.then((msg) => { .then((msg) => {
loading.value = false; loading.value = false;
+14 -3
View File
@@ -42,7 +42,11 @@
</a-card> </a-card>
<!-- 编辑弹窗 --> <!-- 编辑弹窗 -->
<GoodsSpecRelEdit v-model:visible="showEdit" :data="current" @done="reload" /> <GoodsSpecRelEdit
v-model:visible="showEdit"
:data="current"
@done="reload"
/>
</div> </div>
</div> </div>
</template> </template>
@@ -58,8 +62,15 @@
} from 'ele-admin-pro/es/ele-pro-table/types'; } from 'ele-admin-pro/es/ele-pro-table/types';
import Search from './components/search.vue'; import Search from './components/search.vue';
import GoodsSpecRelEdit from './components/goodsSpecRelEdit.vue'; import GoodsSpecRelEdit from './components/goodsSpecRelEdit.vue';
import { pageGoodsSpecRel, removeGoodsSpecRel, removeBatchGoodsSpecRel } from '@/api/shop/goodsSpecRel'; import {
import type { GoodsSpecRel, GoodsSpecRelParam } from '@/api/shop/goodsSpecRel/model'; pageGoodsSpecRel,
removeGoodsSpecRel,
removeBatchGoodsSpecRel
} from '@/api/shop/goodsSpecRel';
import type {
GoodsSpecRel,
GoodsSpecRelParam
} from '@/api/shop/goodsSpecRel/model';
// 表格实例 // 表格实例
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null); const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
+1 -1
View File
@@ -69,7 +69,7 @@
removeBatchMerchant removeBatchMerchant
} from '@/api/shop/merchant'; } from '@/api/shop/merchant';
import type { Merchant, MerchantParam } from '@/api/shop/merchant/model'; import type { Merchant, MerchantParam } from '@/api/shop/merchant/model';
import { getMerchantId, openUrl } from "@/utils/common"; import { getMerchantId } from '@/utils/common';
import router from '@/router'; import router from '@/router';
// 表格实例 // 表格实例
+1 -1
View File
@@ -81,7 +81,7 @@
import SpecEdit from './components/specEdit.vue'; import SpecEdit from './components/specEdit.vue';
import { pageSpec, removeSpec, removeBatchSpec } from '@/api/shop/spec'; import { pageSpec, removeSpec, removeBatchSpec } from '@/api/shop/spec';
import type { Spec, SpecParam } from '@/api/shop/spec/model'; import type { Spec, SpecParam } from '@/api/shop/spec/model';
import { getMerchantId } from "@/utils/merchant"; import { getMerchantId } from '@/utils/merchant';
// 表格实例 // 表格实例
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null); const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
-1
View File
@@ -77,7 +77,6 @@
} from '@/api/shop/specValue'; } from '@/api/shop/specValue';
import type { SpecValue, SpecValueParam } from '@/api/shop/specValue/model'; import type { SpecValue, SpecValueParam } from '@/api/shop/specValue/model';
import { Spec } from '@/api/shop/spec/model'; import { Spec } from '@/api/shop/spec/model';
import { FormInstance } from 'ant-design-vue/es/form';
const props = defineProps<{ const props = defineProps<{
// 弹窗是否打开 // 弹窗是否打开