ソースを参照

增加h5st签名配置

dodo hold 1 年間 前
コミット
d06f7adc2e

+ 12 - 0
src/api/aliyun.ts

@@ -33,3 +33,15 @@ export interface AliyunAccountRes extends ListRes {
 export function queryAccountList(data: AliyunAccountParams) {
     return axios.post<AliyunAccountRes>('/api/aliyun/account_list', data);
 }
+
+
+export interface UpdateAccountModel {
+    id: number;
+    name: string;
+    val: any;
+}
+
+export function UpdateAccount(data: UpdateAccountModel) {
+    return axios.post<FormRes>('/api/aliyun/update', data);
+}
+

+ 3 - 0
src/api/taobao.ts

@@ -26,6 +26,9 @@ export interface UpdateConfigModel {
     jd_limit_per_oaid_24h: number;
     jd_blacklist_regular: string;
 
+    jd_h5st_sign_url: string;
+    jd_h5st_sign_version: string;
+
     tk_limit_per_ip_24h: number;
     tk_limit_per_oaid_24h: number;
 

+ 43 - 27
src/views/jd/list.vue

@@ -232,7 +232,7 @@ import useLoading from '@/hooks/loading';
 import { queryJdPool, JdPoolRecord, JdPoolParams } from '@/api/jd';
 
 import { Pagination } from '@/types/global';
-import { Message } from '@arco-design/web-vue';
+import { Modal, Message } from '@arco-design/web-vue';
 import type { SelectOptionData } from '@arco-design/web-vue/es/select/interface';
 import type { TableColumnData } from '@arco-design/web-vue/es/table/interface';
 import cloneDeep from 'lodash/cloneDeep';
@@ -441,21 +441,29 @@ const changeStatus = async (id: number, val: any) => {
         val
     } as UpdateAccountModel;
 
-    setLoading(true);
-
-    try {
-        const { data } = await UpdateAccount(updatePath, args);
-        console.log(data, data.msg);
-        const msg = data.msg || '更新成功!';
-        if (data.success) {
-            Message.success(msg);
-            fetchData();
-        } else {
-            Message.error(data.msg);
+    Modal.confirm({
+        title: '确认提示',
+        content: '确定要更改状态吗?',
+        okText: '确认',
+        cancelText: '取消',
+        async onOk() {
+            setLoading(true);
+
+            try {
+                const { data } = await UpdateAccount(updatePath, args);
+                console.log(data, data.msg);
+                const msg = data.msg || '更新成功!';
+                if (data.success) {
+                    Message.success(msg);
+                    fetchData();
+                } else {
+                    Message.error(data.msg);
+                }
+
+            } catch (e) { console.log(e) }
+            setLoading(false);
         }
-
-    } catch (e) { console.log(e) }
-    setLoading(false);
+    });
 };
 
 
@@ -466,19 +474,27 @@ const changeAttr = async (id: number, name: string, val: any) => {
         val
     } as UpdateAccountModel;
 
-    setLoading(true);
-    try {
-        const { data } = await UpdateAccount(updatePath, args);
-        console.log(data, data.msg);
-        const msg = data.msg || '更新成功!';
-        if (data.success) {
-            Message.success(msg);
-            fetchData();
-        } else {
-            Message.error(data.msg);
+    Modal.confirm({
+        title: '确认提示',
+        content: '确定要更改状态吗?',
+        okText: '确认',
+        cancelText: '取消',
+        async onOk() {
+            setLoading(true);
+            try {
+                const { data } = await UpdateAccount(updatePath, args);
+                console.log(data, data.msg);
+                const msg = data.msg || '更新成功!';
+                if (data.success) {
+                    Message.success(msg);
+                    fetchData();
+                } else {
+                    Message.error(data.msg);
+                }
+            } catch (e) { console.log(e) }
+            setLoading(false);
         }
-    } catch (e) { console.log(e) }
-    setLoading(false);
+    });
 };
 
 

+ 54 - 35
src/views/pdd/list.vue

@@ -145,13 +145,18 @@
                 </template>
 
                 <template #cookie_status="{ record }">
-                    <a-tag v-if="record.cookie_status" bordered color="blue"
-                        @click="changeAttr(record.id, 'cookie_status', true)">
-                        正常
-                    </a-tag>
-                    <a-tag v-else bordered color="" @click="changeAttr(record.id, 'cookie_status', true)">
+                    <a-tag v-if="!record.status" bordered color="">
                         离线
                     </a-tag>
+                    <template v-else>
+                        <a-tag v-if="record.cookie_status" bordered color="blue"
+                            @click="changeAttr(record.id, 'cookie_status', true)">
+                            正常
+                        </a-tag>
+                        <a-tag v-else bordered color="" @click="changeAttr(record.id, 'cookie_status', true)">
+                            离线
+                        </a-tag>
+                    </template>
                 </template>
                 <template #actions="{ record }">
                     <a-tag v-if="record.enable_parse" size="small" bordered color="red"
@@ -241,7 +246,7 @@ import dayjs from 'dayjs';
 import useLoading from '@/hooks/loading';
 import { queryPddPool, PddPoolRecord, PddPoolParams, PddUpdateAccountModel, PddUpdateAccount } from '@/api/pdd';
 import { Pagination } from '@/types/global';
-import { Message } from '@arco-design/web-vue';
+import { Modal, Message } from '@arco-design/web-vue';
 import type { SelectOptionData } from '@arco-design/web-vue/es/select/interface';
 import type { TableColumnData } from '@arco-design/web-vue/es/table/interface';
 import cloneDeep from 'lodash/cloneDeep';
@@ -417,24 +422,32 @@ const changeStatus = async (id: number, val: any) => {
         val
     } as PddUpdateAccountModel;
 
-    setLoading(true);
 
-    try {
-        const { data } = await PddUpdateAccount(args);
-        console.log(data, data.msg);
-        const msg = data.msg || '更新成功!';
-        if (data.success) {
-            Message.success(msg);
-            fetchData();
-        } else {
-            Message.error(data.msg);
+    Modal.confirm({
+        title: '确认提示',
+        content: '确定要更改状态吗?',
+        okText: '确认',
+        cancelText: '取消',
+        async onOk() {
+            setLoading(true);
+
+            try {
+                const { data } = await PddUpdateAccount(args);
+                console.log(data, data.msg);
+                const msg = data.msg || '更新成功!';
+                if (data.success) {
+                    Message.success(msg);
+                    fetchData();
+                } else {
+                    Message.error(data.msg);
+                }
+
+            } catch (e) { console.log(e) }
+            setLoading(false);
         }
-
-    } catch (e) { console.log(e) }
-    setLoading(false);
+    });
 };
 
-
 const changeAttr = async (id: number, name: string, val: any) => {
     const args = {
         id,
@@ -442,26 +455,32 @@ const changeAttr = async (id: number, name: string, val: any) => {
         val
     } as PddUpdateAccountModel;
 
-    setLoading(true);
-    try {
-
-        const { data } = await PddUpdateAccount(args);
-        console.log(data, data.msg);
-        const msg = data.msg || '更新成功!';
-        if (data.success) {
-            Message.success(msg);
-            fetchData();
-        } else {
-            Message.error(data.msg);
+    Modal.confirm({
+        title: '确认提示',
+        content: '确定要更改状态吗?',
+        okText: '确认',
+        cancelText: '取消',
+        async onOk() {
+            setLoading(true);
+            try {
+
+                const { data } = await PddUpdateAccount(args);
+                console.log(data, data.msg);
+                const msg = data.msg || '更新成功!';
+                if (data.success) {
+                    Message.success(msg);
+                    fetchData();
+                } else {
+                    Message.error(data.msg);
+                }
+            } catch (e) { console.log(e) }
+            setLoading(false);
         }
-    } catch (e) { console.log(e) }
-    setLoading(false);
+    });
 };
 
 
 
-
-
 const search = () => {
     fetchData({
         ...basePagination,

+ 41 - 5
src/views/settings/aliyun.vue

@@ -129,15 +129,19 @@
                 </template>
 
                 <template #balance="{ record }">
-                    <a-tag color="red" v-if="record.balance <= record.balance_alert_threshold">{{ record.balance }}
+                    <a-tag color="red" v-if="record.balance <= record.balance_alert_threshold"
+                        @click="changeAttr(record.id, 'balance', true)">{{ record.balance }}
+                    </a-tag>
+                    <a-tag color="blue" v-else @click="changeAttr(record.id, 'balance', true)">{{ record.balance }}
                     </a-tag>
-                    <a-tag color="blue" v-else>{{ record.balance }} </a-tag>
                 </template>
 
                 <template #balance_alert_threshold="{ record }">
-                    <a-tag color="red" v-if="record.balance <= record.balance_alert_threshold">{{ record.balance_alert_threshold }}
+                    <a-tag color="red" v-if="record.balance <= record.balance_alert_threshold">{{
+                        record.balance_alert_threshold }}
                     </a-tag>
                     <a-tag color="blue" v-else>{{ record.balance_alert_threshold }} </a-tag>
+
                 </template>
 
                 <template #status="{ record }">
@@ -172,7 +176,7 @@ import { useI18n } from 'vue-i18n';
 import dayjs from 'dayjs';
 import useLoading from '@/hooks/loading';
 import { Pagination } from '@/types/global';
-import { Message } from '@arco-design/web-vue';
+import { Modal, Message } from '@arco-design/web-vue';
 import type { SelectOptionData } from '@arco-design/web-vue/es/select/interface';
 import type { TableColumnData } from '@arco-design/web-vue/es/table/interface';
 import cloneDeep from 'lodash/cloneDeep';
@@ -181,7 +185,7 @@ import { numberFormat, amountFormat } from '@/utils/util';
 import WorkHourModel from '@/components/WorkHourModel.vue';
 
 import {
-    AliyunAccountParams, AliyunAccountRecord, queryAccountList
+    AliyunAccountParams, AliyunAccountRecord, queryAccountList, UpdateAccountModel, UpdateAccount
 } from '@/api/aliyun';
 
 
@@ -315,6 +319,38 @@ const fetchData = async (
 };
 
 
+const changeAttr = async (id: number, name: string, val: any) => {
+    const args = {
+        id,
+        name,
+        val
+    } as UpdateAccountModel;
+
+    Modal.confirm({
+        title: '确认提示',
+        content: '确定更新操作吗?',
+        okText: '确认',
+        cancelText: '取消',
+        async onOk() {
+            setLoading(true);
+            try {
+
+                const { data } = await UpdateAccount(args);
+                console.log(data, data.msg);
+                const msg = data.msg || '更新成功!';
+                if (data.success) {
+                    Message.success(msg);
+                    fetchData();
+                } else {
+                    Message.error(data.msg);
+                }
+            } catch (e) { console.log(e) }
+            setLoading(false);
+        }
+    });
+};
+
+
 
 
 const search = () => {

+ 11 - 0
src/views/settings/config.vue

@@ -147,6 +147,17 @@
                                             </a-button>
                                         </template>
                                     </a-form-item>
+                                    
+                                    
+                                    <a-form-item field="jd_h5st_sign_url" label="h5st签名地址">
+                                        <a-input v-model="formData.jd_h5st_sign_url" />
+                                    </a-form-item>
+
+                                    
+                                    <a-form-item field="jd_h5st_sign_version" label="h5st版本">
+                                        <a-input v-model="formData.jd_h5st_sign_version" />
+                                    </a-form-item>
+
 
                                 </a-tab-pane>
                                 <a-tab-pane key="pdd" title="拼多多">

+ 49 - 31
src/views/taobao/list.vue

@@ -278,7 +278,7 @@ import dayjs from 'dayjs';
 import useLoading from '@/hooks/loading';
 import { queryTkPool, TkPoolRecord, TkPoolParams, TkUpdateAccountModel, TkUpdateAccount } from '@/api/taobao';
 import { Pagination } from '@/types/global';
-import { Message } from '@arco-design/web-vue';
+import { Modal, Message } from '@arco-design/web-vue';
 import type { SelectOptionData } from '@arco-design/web-vue/es/select/interface';
 import type { TableColumnData } from '@arco-design/web-vue/es/table/interface';
 import cloneDeep from 'lodash/cloneDeep';
@@ -473,8 +473,9 @@ const billView = async (data: TkPoolRecord) => {
     router.push({ name: 'taobao_bill_dailys', query: { name: data.company } });
 };
 
-const changeStatus = async (data: TkPoolRecord, val: any) => {
 
+
+const changeStatus = async (data: TkPoolRecord, val: any) => {
     if (data.is_banned && val) {
         Message.error('被封账号,不能上线!');
         return;
@@ -486,26 +487,33 @@ const changeStatus = async (data: TkPoolRecord, val: any) => {
     } as TkUpdateAccountModel;
 
 
-
-
-    setLoading(true);
-
-    try {
-        const { data } = await TkUpdateAccount(args);
-        console.log(data, data.msg);
-        const msg = data.msg || '更新成功!';
-        if (data.success) {
-            Message.success(msg);
-            fetchData();
-        } else {
-            Message.error(data.msg);
+    Modal.confirm({
+        title: '确认提示',
+        content: '确定要更改状态吗?',
+        okText: '确认',
+        cancelText: '取消',
+        async onOk() {
+            setLoading(true);
+
+            try {
+                const { data } = await TkUpdateAccount(args);
+                console.log(data, data.msg);
+                const msg = data.msg || '更新成功!';
+                if (data.success) {
+                    Message.success(msg);
+                    fetchData();
+                } else {
+                    Message.error(data.msg);
+                }
+
+            } catch (e) {
+                console.log(e);
+            }
+            setLoading(false);
         }
-
-    } catch (e) { console.log(e) }
-    setLoading(false);
+    });
 };
 
-
 const changeAttr = async (id: number, name: string, val: any) => {
     const args = {
         id,
@@ -513,20 +521,30 @@ const changeAttr = async (id: number, name: string, val: any) => {
         val
     } as TkUpdateAccountModel;
 
-    setLoading(true);
-    try {
 
-        const { data } = await TkUpdateAccount(args);
-        console.log(data, data.msg);
-        const msg = data.msg || '更新成功!';
-        if (data.success) {
-            Message.success(msg);
-            fetchData();
-        } else {
-            Message.error(data.msg);
+    Modal.confirm({
+        title: '确认提示',
+        content: '确定要更改状态吗?',
+        okText: '确认',
+        cancelText: '取消',
+        async onOk() {
+            setLoading(true);
+            try {
+
+                const { data } = await TkUpdateAccount(args);
+                console.log(data, data.msg);
+                const msg = data.msg || '更新成功!';
+                if (data.success) {
+                    Message.success(msg);
+                    fetchData();
+                } else {
+                    Message.error(data.msg);
+                }
+            } catch (e) { console.log(e) }
+            setLoading(false);
         }
-    } catch (e) { console.log(e) }
-    setLoading(false);
+    });
+
 };