更新
This commit is contained in:
@@ -175,4 +175,16 @@ export const checkPassWord = data => {
|
||||
return http.request<Result>("post", "/adminapi/SysSet/check_second_pwd", {
|
||||
data
|
||||
});
|
||||
}
|
||||
// 私密设置
|
||||
export const getLuckyCoinInfo = () => {
|
||||
return http.request<Result>(
|
||||
"get",
|
||||
"/adminapi/Lottery/config_list"
|
||||
);
|
||||
};
|
||||
export const saveLuckyCoinInfo = data => {
|
||||
return http.request<Result>("post", "/adminapi/Lottery/config_set", {
|
||||
data
|
||||
});
|
||||
}
|
||||
@@ -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';
|
||||
59
src/views/system/luckyCoin/hook.tsx
Normal file
59
src/views/system/luckyCoin/hook.tsx
Normal file
@@ -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
|
||||
};
|
||||
}
|
||||
46
src/views/system/luckyCoin/index.vue
Normal file
46
src/views/system/luckyCoin/index.vue
Normal file
@@ -0,0 +1,46 @@
|
||||
<script setup lang="ts">
|
||||
import { onMounted } from "vue";
|
||||
import { useData } from "./hook";
|
||||
import { deviceDetection } from "@pureadmin/utils";
|
||||
import uploadImage from '@/components/UploadImage/index.vue';
|
||||
const {
|
||||
onSearch,
|
||||
loading,
|
||||
saveConfig,
|
||||
formData,
|
||||
formLabel,
|
||||
handleFileSuccess
|
||||
} = useData();
|
||||
defineOptions({
|
||||
name: "luckyCoin"
|
||||
});
|
||||
onMounted(() => {
|
||||
onSearch();
|
||||
});
|
||||
</script>
|
||||
<template>
|
||||
<div class="main">
|
||||
<div style="margin-bottom: 20px;text-align: right;"> <el-button type="primary"
|
||||
@click="saveConfig">保存当前配置</el-button></div>
|
||||
<div ref="contentRef" v-if="!loading" :class="['flex', deviceDetection() ? 'flex-wrap' : '']">
|
||||
<el-card style="width: 100%;">
|
||||
<el-form ref="form" :model="formData" label-width="200px">
|
||||
<!-- {{ formLabel }} -->
|
||||
<el-form-item :label="ele.desc" v-for="ele in formLabel">
|
||||
<div style="width: 100%;display: inline-flex;">
|
||||
<div style="width: 20%;">
|
||||
<el-input v-if="![7, 8].includes(ele.id)" v-model="formData[ele.key]"></el-input>
|
||||
<div v-else>
|
||||
<uploadImage :acceptType="'.jpg,.png,.svg,.mp4'"
|
||||
@handleSuccess="(event) => handleFileSuccess(event, ele)" :limit="1" :echoUrl="formData[ele.key]" />
|
||||
</div>
|
||||
</div>
|
||||
<div style="width: 70%; margin-left: 20px;color: #666;">{{ ele.key_desc }}</div>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<style scoped lang="scss"></style>
|
||||
@@ -77,10 +77,10 @@ export function useData() {
|
||||
label: "今日流水",
|
||||
prop: "today_money"
|
||||
},
|
||||
// {
|
||||
// label: "是否显示",
|
||||
// prop: "is_show"
|
||||
// },
|
||||
{
|
||||
label: "幸运币流水",
|
||||
prop: ""
|
||||
},
|
||||
{
|
||||
label: "公会状态",
|
||||
prop: "status_str",
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user