diff --git a/src/api/modules/system.ts b/src/api/modules/system.ts index 2305dfb..a358d0c 100644 --- a/src/api/modules/system.ts +++ b/src/api/modules/system.ts @@ -175,4 +175,16 @@ export const checkPassWord = data => { return http.request("post", "/adminapi/SysSet/check_second_pwd", { data }); +} +// 私密设置 +export const getLuckyCoinInfo = () => { + return http.request( + "get", + "/adminapi/Lottery/config_list" + ); +}; +export const saveLuckyCoinInfo = data => { + return http.request("post", "/adminapi/Lottery/config_set", { + data + }); } \ No newline at end of file diff --git a/src/utils/http/config.ts b/src/utils/http/config.ts index 5ce2bae..e797c68 100644 --- a/src/utils/http/config.ts +++ b/src/utils/http/config.ts @@ -1,8 +1,4 @@ -export const URL = "https://yushengapi.qxyushen.top"; -// export const URL = "https://test.vespa.qxyushen.top"; -// https://vespa.qxyushen.top 正式 -// http://1.13.101.98 -// https://test.vespa.qxyushen.top -// 新的羽声 https://yushengapi.qxyushen.top +// export const URL = "https://yushengapi.qxyushen.top"; +export const URL = "https://test.vespa.qxyushen.top"; // 声网appId 在这里换 export const appIdBySw = '02f7339ec98947deaeab173599891932'; \ No newline at end of file diff --git a/src/views/system/luckyCoin/hook.tsx b/src/views/system/luckyCoin/hook.tsx new file mode 100644 index 0000000..93b60c7 --- /dev/null +++ b/src/views/system/luckyCoin/hook.tsx @@ -0,0 +1,59 @@ +import { ref } from "vue"; +import { message } from "@/utils/message"; +import { + getLuckyCoinInfo, + saveLuckyCoinInfo +} from "@/api/modules/system"; +import { ElMessageBox } from "element-plus"; +export function useData() { + const formData = ref({}) + const loading = ref(true); + const activeId = ref(0) + const formLabel = ref([]) + const isShow = ref(false); + const onSearch = async () => { + loading.value = true; + const { data, code } = await getLuckyCoinInfo(); + if (code) { + // console.log(data) + formLabel.value = data + data.forEach(ele => { + formData.value[ele.key] = ele.value + }); + } + loading.value = false; + }; + const handleFileSuccess = (list, keyData) => { + formData.value[keyData.key] = list.join(',') + } + const saveConfig = async () => { + ElMessageBox.confirm( + `该操作将覆盖之前的数据,是否继续?`, + "提示", + { + type: "warning" + } + ) + .then(async () => { + const { code, msg } = await saveLuckyCoinInfo({ + ...formData.value + }) + if (code) { + message("操作成功", { type: "success" }); + onSearch() + } else { + message(msg, { type: "error" }); + } + }) + .catch(() => { }); + } + return { + onSearch, + isShow, + loading, + formLabel, + formData, + saveConfig, + handleFileSuccess + }; +} diff --git a/src/views/system/luckyCoin/index.vue b/src/views/system/luckyCoin/index.vue new file mode 100644 index 0000000..6e3d219 --- /dev/null +++ b/src/views/system/luckyCoin/index.vue @@ -0,0 +1,46 @@ + + + diff --git a/src/views/union/unionList/hook.tsx b/src/views/union/unionList/hook.tsx index edce64c..05b820d 100644 --- a/src/views/union/unionList/hook.tsx +++ b/src/views/union/unionList/hook.tsx @@ -77,10 +77,10 @@ export function useData() { label: "今日流水", prop: "today_money" }, - // { - // label: "是否显示", - // prop: "is_show" - // }, + { + label: "幸运币流水", + prop: "" + }, { label: "公会状态", prop: "status_str", diff --git a/vite.config.ts b/vite.config.ts index be1425d..e52c18a 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -37,8 +37,8 @@ export default ({ mode }: ConfigEnv): UserConfigExport => { proxyReq.method = 'OPTIONS'; // https://test.vespa.qxyushen.top // 'http://yushenggliht.qxyushen.top' - res.setHeader('Access-Control-Allow-Origin', 'http://yushenggliht.qxyushen.top'); - // res.setHeader('Access-Control-Allow-Origin', 'https://test.vespa.qxyushen.top'); + // res.setHeader('Access-Control-Allow-Origin', 'http://yushenggliht.qxyushen.top'); + res.setHeader('Access-Control-Allow-Origin', 'https://test.vespa.qxyushen.top'); res.setHeader('Access-Control-Allow-Methods', 'GET, POST, PUT, DELETE, OPTIONS'); res.setHeader('Access-Control-Allow-Headers', 'Content-Type, Authorization'); res.end();