Skip to content

Commit

Permalink
chore: 调整查询系统配置参数接口地址
Browse files Browse the repository at this point in the history
  • Loading branch information
Charles7c committed Nov 14, 2024
1 parent cefb954 commit 0116432
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
7 changes: 3 additions & 4 deletions src/apis/common/common.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import type { TreeNodeData } from '@arco-design/web-vue'
import http from '@/utils/http'
import type { LabelValueState } from '@/types/global'
import type { OptionQuery } from '@/apis'

const BASE_URL = '/common'

Expand Down Expand Up @@ -30,9 +29,9 @@ export function listCommonDict(code: string) {
return http.get<LabelValueState[]>(`${BASE_URL}/dict/${code}`)
}

/** @desc 查询参数列表 */
export function listOptionDict(query: OptionQuery) {
return http.get<LabelValueState[]>(`${BASE_URL}/dict/option`, query)
/** @desc 查询系统配置参数 */
export function listSiteOptionDict() {
return http.get<LabelValueState[]>(`${BASE_URL}/dict/option/site`)
}

/** @desc 上传文件 */
Expand Down
6 changes: 2 additions & 4 deletions src/stores/modules/app.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { defineStore } from 'pinia'
import { computed, reactive, toRefs } from 'vue'
import { generate, getRgbStr } from '@arco-design/color'
import { type BasicConfig, listOptionDict } from '@/apis'
import { type BasicConfig, listSiteOptionDict } from '@/apis'
import defaultSettings from '@/config/setting.json'

const storeSetup = () => {
Expand Down Expand Up @@ -58,9 +58,7 @@ const storeSetup = () => {
const siteConfig = reactive({}) as BasicConfig
// 初始化系统配置
const initSiteConfig = () => {
listOptionDict({
category: 'SITE',
}).then((res) => {
listSiteOptionDict().then((res) => {
const resMap = new Map()
res.data.forEach((item) => {
resMap.set(item.label, item.value)
Expand Down

0 comments on commit 0116432

Please sign in to comment.