shuisheng hai 1 ano
pai
achega
627d7fd1b4
Modificáronse 3 ficheiros con 25 adicións e 0 borrados
  1. 8 0
      src/App.vue
  2. 6 0
      src/api/settings.ts
  3. 11 0
      src/interface.ts

+ 8 - 0
src/App.vue

@@ -26,6 +26,8 @@ import { getHostnameUrl } from '@/utils';
 import { getLastBuildDate, setLastBuildDate } from '@/utils/localStorage/app';
 import { getToken } from '@/utils/localStorage/user';
 
+import { fetchSettingsList } from './api/settings';
+
 const { checkUpdate } = useCheckUpdate();
 const cacheStore = usePiniaCacheStore();
 const userStore = useUserStore();
@@ -38,6 +40,7 @@ const themeOverrides: GlobalThemeOverrides = {
 };
 
 onMounted(() => {
+  initSettings();
   checkUpdate({
     htmlUrl: getHostnameUrl(),
   });
@@ -66,6 +69,11 @@ onMounted(() => {
   }
 });
 
+async function initSettings() {
+  const res = await fetchSettingsList({});
+  console.log(res);
+}
+
 function handleUpdate() {
   const old = getLastBuildDate();
   if (appBuildInfo.lastBuildDate !== old) {

+ 6 - 0
src/api/settings.ts

@@ -0,0 +1,6 @@
+import { IList, IPaging, ISettings } from '@/interface';
+import request from '@/utils/request';
+
+export function fetchSettingsList(params: IList<ISettings>) {
+  return request.get<IPaging<ISettings>>('/settings/list', { params });
+}

+ 11 - 0
src/interface.ts

@@ -386,6 +386,17 @@ export enum GoodsTypeEnum {
   recharge = 'recharge',
 }
 
+export interface ISettings {
+  id?: number;
+  key?: string;
+  value?: string;
+  desc?: string;
+  type?: string;
+  created_at?: string;
+  updated_at?: string;
+  deleted_at?: string;
+}
+
 export interface IGoods {
   id?: number;
   type?: GoodsTypeEnum;