mirror of
https://github.com/dromara/RuoYi-Vue-Plus.git
synced 2025-09-24 07:19:46 +08:00
update 调整oss预览开关 使用前端直接调用更改配置参数
This commit is contained in:
@ -43,6 +43,18 @@ export function updateConfig(data) {
|
||||
})
|
||||
}
|
||||
|
||||
// 修改参数配置
|
||||
export function updateConfigByKey(key, value) {
|
||||
return request({
|
||||
url: '/system/config/updateByKey',
|
||||
method: 'put',
|
||||
data: {
|
||||
configKey: key,
|
||||
configValue: value
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 删除参数配置
|
||||
export function delConfig(configId) {
|
||||
return request({
|
||||
|
@ -17,13 +17,3 @@ export function delOss(ossId) {
|
||||
})
|
||||
}
|
||||
|
||||
export function changePreviewListResource(previewListResource) {
|
||||
const data = {
|
||||
previewListResource
|
||||
}
|
||||
return request({
|
||||
url: '/system/oss/changePreviewListResource',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
@ -17,7 +17,7 @@ import { download } from '@/utils/request'
|
||||
import './assets/icons' // icon
|
||||
import './permission' // permission control
|
||||
import { getDicts } from "@/api/system/dict/data";
|
||||
import { getConfigKey } from "@/api/system/config";
|
||||
import { getConfigKey, updateConfigByKey } from "@/api/system/config";
|
||||
import { parseTime, resetForm, addDateRange, selectDictLabel, selectDictLabels, handleTree } from "@/utils/ruoyi";
|
||||
// 分页组件
|
||||
import Pagination from "@/components/Pagination";
|
||||
@ -41,6 +41,7 @@ import DictData from '@/components/DictData'
|
||||
// 全局方法挂载
|
||||
Vue.prototype.getDicts = getDicts
|
||||
Vue.prototype.getConfigKey = getConfigKey
|
||||
Vue.prototype.updateConfigByKey = updateConfigByKey
|
||||
Vue.prototype.parseTime = parseTime
|
||||
Vue.prototype.resetForm = resetForm
|
||||
Vue.prototype.addDateRange = addDateRange
|
||||
|
@ -187,7 +187,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listOss, delOss, changePreviewListResource } from "@/api/system/oss";
|
||||
import { listOss, delOss } from "@/api/system/oss";
|
||||
|
||||
export default {
|
||||
name: "Oss",
|
||||
@ -344,7 +344,7 @@ export default {
|
||||
handlePreviewListResource(previewListResource) {
|
||||
let text = previewListResource ? "启用" : "停用";
|
||||
this.$modal.confirm('确认要"' + text + '""预览列表图片"配置吗?').then(() => {
|
||||
return changePreviewListResource(previewListResource);
|
||||
return this.updateConfigByKey("sys.oss.previewListResource", previewListResource);
|
||||
}).then(() => {
|
||||
this.getList()
|
||||
this.$modal.msgSuccess(text + "成功");
|
||||
|
Reference in New Issue
Block a user