|
@@ -37,8 +37,13 @@
|
|
|
|
|
|
|
|
<a-form-item field="webook_forward_zlong" label="Zlong 转发渠道">
|
|
<a-form-item field="webook_forward_zlong" label="Zlong 转发渠道">
|
|
|
<a-checkbox-group v-model="forwardChannelsModel">
|
|
<a-checkbox-group v-model="forwardChannelsModel">
|
|
|
- <a-checkbox value="xhs">小红书</a-checkbox>
|
|
|
|
|
- <a-checkbox value="ks">快手</a-checkbox>
|
|
|
|
|
|
|
+ <a-checkbox
|
|
|
|
|
+ v-for="channel in zlongForwardChannelOptions"
|
|
|
|
|
+ :key="channel.value"
|
|
|
|
|
+ :value="channel.value"
|
|
|
|
|
+ >
|
|
|
|
|
+ {{ channel.label }}
|
|
|
|
|
+ </a-checkbox>
|
|
|
</a-checkbox-group>
|
|
</a-checkbox-group>
|
|
|
<template #extra>
|
|
<template #extra>
|
|
|
实际保存值:{{ formData.webook_forward_zlong || '未启用' }}
|
|
实际保存值:{{ formData.webook_forward_zlong || '未启用' }}
|
|
@@ -296,10 +301,17 @@ import {
|
|
|
getConfig
|
|
getConfig
|
|
|
} from '@/api/taobao';
|
|
} from '@/api/taobao';
|
|
|
import RegularTester from './components/regular-tester.vue';
|
|
import RegularTester from './components/regular-tester.vue';
|
|
|
|
|
+import {
|
|
|
|
|
+ buildZlongForwardChannelValue,
|
|
|
|
|
+ normalizeZlongForwardChannels,
|
|
|
|
|
+ zlongForwardChannelDefaultValue,
|
|
|
|
|
+ zlongForwardChannelOptions,
|
|
|
|
|
+} from './zlongForwardChannels';
|
|
|
|
|
|
|
|
const { loading, setLoading } = useLoading(true);
|
|
const { loading, setLoading } = useLoading(true);
|
|
|
|
|
|
|
|
const formRef = ref<FormInstance>();
|
|
const formRef = ref<FormInstance>();
|
|
|
|
|
+
|
|
|
const formData = ref<UpdateConfigModel>({
|
|
const formData = ref<UpdateConfigModel>({
|
|
|
cookie: '',
|
|
cookie: '',
|
|
|
blacklist_oaid: '',
|
|
blacklist_oaid: '',
|
|
@@ -348,31 +360,15 @@ const formData = ref<UpdateConfigModel>({
|
|
|
ks_blacklist_regular: '',
|
|
ks_blacklist_regular: '',
|
|
|
ksTestToken: '',
|
|
ksTestToken: '',
|
|
|
ks_limit_per_oaid_24h: 0,
|
|
ks_limit_per_oaid_24h: 0,
|
|
|
- webook_forward_zlong: 'xhs,ks'
|
|
|
|
|
|
|
+ webook_forward_zlong: zlongForwardChannelDefaultValue
|
|
|
|
|
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
-const defaultForwardChannels = ['xhs', 'ks'];
|
|
|
|
|
const normalizeForwardChannels = (value?: string | string[]) => {
|
|
const normalizeForwardChannels = (value?: string | string[]) => {
|
|
|
- const list = Array.isArray(value)
|
|
|
|
|
- ? value
|
|
|
|
|
- : String(value || '')
|
|
|
|
|
- .split(',')
|
|
|
|
|
- .map((item) => item.trim())
|
|
|
|
|
- .filter(Boolean);
|
|
|
|
|
-
|
|
|
|
|
- const normalized = Array.from(
|
|
|
|
|
- new Set(
|
|
|
|
|
- list
|
|
|
|
|
- .map((item) => item.toLowerCase())
|
|
|
|
|
- .filter((item) => defaultForwardChannels.includes(item))
|
|
|
|
|
- )
|
|
|
|
|
- );
|
|
|
|
|
-
|
|
|
|
|
- return normalized;
|
|
|
|
|
|
|
+ return normalizeZlongForwardChannels(value);
|
|
|
};
|
|
};
|
|
|
const buildForwardChannelValue = (value?: string | string[]) => {
|
|
const buildForwardChannelValue = (value?: string | string[]) => {
|
|
|
- return normalizeForwardChannels(value).join(',');
|
|
|
|
|
|
|
+ return buildZlongForwardChannelValue(value);
|
|
|
};
|
|
};
|
|
|
const forwardChannelsModel = computed<string[]>({
|
|
const forwardChannelsModel = computed<string[]>({
|
|
|
get() {
|
|
get() {
|
|
@@ -429,7 +425,7 @@ const reset = async () => {
|
|
|
config.tk_blacklist_regular = restoreJson(config.tk_blacklist_regular)
|
|
config.tk_blacklist_regular = restoreJson(config.tk_blacklist_regular)
|
|
|
config.multi_token_regular = restoreJson(config.multi_token_regular)
|
|
config.multi_token_regular = restoreJson(config.multi_token_regular)
|
|
|
config.webook_forward_zlong = buildForwardChannelValue(
|
|
config.webook_forward_zlong = buildForwardChannelValue(
|
|
|
- config.webook_forward_zlong || (config as any).webook_xhs_zlong || defaultForwardChannels
|
|
|
|
|
|
|
+ config.webook_forward_zlong || (config as any).webook_xhs_zlong || zlongForwardChannelDefaultValue
|
|
|
)
|
|
)
|
|
|
formData.value = config
|
|
formData.value = config
|
|
|
}
|
|
}
|