fix(*): 新增配置处理功能 20260302
This commit is contained in:
@ -76,5 +76,8 @@
|
||||
1. 修复部分服务器硬件不存在导致每次启动授权码均变化的异常
|
||||
2. 替换TOMCAT版本
|
||||
3. 补充部分日志输出,方便后续比对
|
||||
|
||||
|
||||
|
||||
2026-03-02
|
||||
|
||||
1. xinadmin界面新增配置文件读取/设置保存弹窗
|
||||
2. 新增相关工具函数,实现配置文件读取、加密及解密对象获取
|
||||
|
||||
BIN
xin-launcher.zip
BIN
xin-launcher.zip
Binary file not shown.
Binary file not shown.
@ -34,7 +34,6 @@
|
||||
|
||||
<div class="company">
|
||||
<div class="company-det">
|
||||
|
||||
<div class="company-lint">
|
||||
<div class="company-name">
|
||||
<div class="company-logo">
|
||||
@ -63,6 +62,11 @@
|
||||
</el-link>
|
||||
</span>
|
||||
</div>
|
||||
<div class="des">配置文件
|
||||
<el-link type="primary" :underline="false"
|
||||
style="font-size: 12px;margin-left: 8px;" @click="openConfigSet">设置
|
||||
</el-link>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -167,6 +171,21 @@
|
||||
</el-table>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog title="系统配置文件设置" :visible.sync="configSetVis" :close-on-click-modal="false">
|
||||
<el-row style="margin-top: -20px;margin-bottom: 10px;" :gutter="10">
|
||||
<el-col :span="8">
|
||||
<el-input v-model="configSetPath" placeholder="手动输入文件路径,例如:C:\test.txt"></el-input>
|
||||
</el-col>
|
||||
<el-col :span="16">
|
||||
<el-button @click="readFileInfo" :loading="readBtnLoad">读取配置</el-button>
|
||||
<el-button @click="keepFileInfo" :disabled="!apiReadFile" :loading="keepBtnLoad">保存配置</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-input type="textarea" :disabled="!apiReadFile" :autosize="{ minRows: 20, maxRows: 20}"
|
||||
v-model="configSetValue" v-loading="readBtnLoad"></el-input>
|
||||
</el-dialog>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
@ -265,7 +284,13 @@
|
||||
{validator: validatePass2, trigger: 'blur'}
|
||||
]
|
||||
},
|
||||
generalQrCode: false
|
||||
generalQrCode: false,
|
||||
configSetVis: false,
|
||||
configSetPath: 'C:\\Users\\tiany\\Desktop\\tets\\datasource.xml',
|
||||
apiReadFile: false,
|
||||
configSetValue: '',
|
||||
readBtnLoad: false,
|
||||
keepBtnLoad: false,
|
||||
}
|
||||
},
|
||||
created: function () {
|
||||
@ -441,6 +466,49 @@
|
||||
openUploadLicense() {
|
||||
this.dialogTableVisible = true;
|
||||
},
|
||||
openConfigSet() {
|
||||
const that = this;
|
||||
that.configSetVis = true;
|
||||
},
|
||||
closeConfigSet() {
|
||||
const that = this;
|
||||
that.configSetVis = false;
|
||||
},
|
||||
readFileInfo() {
|
||||
const that = this;
|
||||
that.configSetValue = '';
|
||||
that.apiReadFile = false;
|
||||
const params = {filePath: that.configSetPath}
|
||||
that.readBtnLoad = true;
|
||||
axios.post('/xinadmin/readConfigFile', params).then(function (res) {
|
||||
if (res.status === 200) {
|
||||
that.configSetValue = res.data.data;
|
||||
that.apiReadFile = true;
|
||||
} else {
|
||||
that.$message.error(res.data.mes);
|
||||
}
|
||||
}).finally(() => {
|
||||
that.readBtnLoad = false;
|
||||
})
|
||||
},
|
||||
keepFileInfo() {
|
||||
const that = this;
|
||||
const params = {
|
||||
filePath: that.configSetPath,
|
||||
fileContent: that.configSetValue
|
||||
}
|
||||
that.keepBtnLoad = true;
|
||||
axios.post('/xinadmin/keepConfigSetFile', params).then(function (res) {
|
||||
if (res.status === 200) {
|
||||
that.$message.success('保存成功!');
|
||||
that.closeConfigSet();
|
||||
} else {
|
||||
that.$message.error(res.data.mes);
|
||||
}
|
||||
}).finally(() => {
|
||||
that.keepBtnLoad = false;
|
||||
})
|
||||
},
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
Binary file not shown.
Reference in New Issue
Block a user