更新二级密码的配置
This commit is contained in:
@@ -76,10 +76,15 @@ const handleFileSuccess = ({ data, code }, file, fileList) => {
|
||||
<template>
|
||||
<!-- {{ acceptType http://md.xscmmidi.site }} -->
|
||||
<el-upload v-model:file-list="fileList" drag multiple class="pure-upload" list-type="picture-card"
|
||||
:accept="acceptType ? acceptType : 'image/jpeg,image/png,image/gif'"
|
||||
:action="`${URL}/adminapi/UploadFile/file_upload`" :limit="limit" name="files"
|
||||
:headers="{ Authorization: getToken().accessToken }" :on-exceed="onExceed" :before-upload="onBefore"
|
||||
:on-success="handleFileSuccess">
|
||||
:accept="acceptType ? acceptType : 'image/jpeg,image/png,image/gif'" :action="`${URL}/adminapi/
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/file_upload`" :limit="limit" name="files" :headers="{ Authorization: getToken().accessToken }"
|
||||
:on-exceed="onExceed" :before-upload="onBefore" :on-success="handleFileSuccess">
|
||||
<IconifyIconOffline :icon="Add" class="m-auto mt-4" width="30" />
|
||||
<template #file="{ file }">
|
||||
<div v-if="file.status == 'ready' || file.status == 'uploading'" class="mt-[35%] m-auto">
|
||||
|
||||
@@ -19,7 +19,7 @@ export function useData() {
|
||||
loading.value = true;
|
||||
const { data, code } = await getConfigTypeList({});
|
||||
if (code) {
|
||||
tableList.value = data
|
||||
tableList.value = data.filter(ele => { return ele.id !== 11 })
|
||||
activeId.value = data[0].id
|
||||
getInfo(activeId.value)
|
||||
}
|
||||
|
||||
60
src/views/system/secondPassword/index.vue
Normal file
60
src/views/system/secondPassword/index.vue
Normal file
@@ -0,0 +1,60 @@
|
||||
<script setup lang="ts">
|
||||
import { onMounted, ref } from "vue";
|
||||
import { message } from "@/utils/message";
|
||||
import { ElMessageBox } from "element-plus";
|
||||
import {
|
||||
getConfigSetInfo,
|
||||
SetConfigData
|
||||
} from "@/api/modules/system";
|
||||
const Info = ref({
|
||||
key_desc: '',
|
||||
key_title: '',
|
||||
key_value: ''
|
||||
})
|
||||
const formData = ref({
|
||||
})
|
||||
const getInfo = async (id) => {
|
||||
const { data, code } = await getConfigSetInfo({ type: id })
|
||||
if (code) {
|
||||
// console.log(data)
|
||||
Info.value = data[0]
|
||||
formData.value[Info.value.key_title] = Info.value.key_value
|
||||
}
|
||||
}
|
||||
const save = async () => {
|
||||
ElMessageBox.confirm(
|
||||
`该操作将覆盖之前的数据,是否继续?`,
|
||||
"提示",
|
||||
{
|
||||
type: "warning"
|
||||
}
|
||||
)
|
||||
.then(async () => {
|
||||
const { code, msg } = await SetConfigData({
|
||||
...formData.value,
|
||||
type: 11
|
||||
})
|
||||
if (code) {
|
||||
message("操作成功", { type: "success" });
|
||||
getInfo(11)
|
||||
} else {
|
||||
message(msg, { type: "error" });
|
||||
}
|
||||
})
|
||||
.catch(() => { });
|
||||
}
|
||||
onMounted(() => {
|
||||
getInfo(11);
|
||||
});
|
||||
</script>
|
||||
<template>
|
||||
<el-form ref="form" :model="formData" label-width="100px">
|
||||
|
||||
<el-form-item :label="Info.key_desc" :prop="Info.key_title">
|
||||
<el-input v-model="formData[Info.key_title]" style="width: 280px;" :show-password="true"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="">
|
||||
<el-button @click="save">保存配置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</template>
|
||||
Reference in New Issue
Block a user