diff --git a/src/api/sys/user.ts b/src/api/sys/user.ts index 253c4a2..cc9aec4 100644 --- a/src/api/sys/user.ts +++ b/src/api/sys/user.ts @@ -8,6 +8,7 @@ import { setAuthCache } from '/@/utils/auth'; import { TOKEN_KEY } from '/@/enums/cacheEnum'; import { router } from '/@/router'; import { PageEnum } from '/@/enums/pageEnum'; +import { SysConfigInfo } from '/#/store'; const { createErrorModal } = useMessage(); enum Api { @@ -15,6 +16,7 @@ enum Api { phoneLogin = '/sys/phoneLogin', Logout = '/sys/logout', GetUserInfo = '/sys/user/getUserInfo', + GetSysConfigInfo = '/kcSysConfig/kcSysConfig/queryById', // 获取系统权限 // 1、查询用户拥有的按钮/表单访问权限 // 2、所有权限 @@ -91,6 +93,24 @@ export function getUserInfo() { }); } +/** + * @description: + */ +export function getSysConfigInfo() { + return defHttp.get({ url: Api.GetSysConfigInfo, params: { id: '1' } }, { }).catch((e) => { + // update-begin--author:zyf---date:20220425---for:【VUEN-76】捕获接口超时异常,跳转到登录界面 + if (e && (e.message.includes('timeout') || e.message.includes('401'))) { + //接口不通时跳转到登录界面 + const userStore = useUserStoreWithOut(); + userStore.setToken(''); + setAuthCache(TOKEN_KEY, null); + router.push(PageEnum.BASE_LOGIN); + } + // update-end--author:zyf---date:20220425---for:【VUEN-76】捕获接口超时异常,跳转到登录界面 + }); +} + + export function getPermCode() { return defHttp.get({ url: Api.GetPermCode }); } diff --git a/src/enums/cacheEnum.ts b/src/enums/cacheEnum.ts index c3bb4ae..d40557c 100644 --- a/src/enums/cacheEnum.ts +++ b/src/enums/cacheEnum.ts @@ -32,6 +32,9 @@ export const TENANT_ID = 'TENANT_ID'; // login info key export const LOGIN_INFO_KEY = 'LOGIN__INFO__'; +// login info key +export const SYS_CONFIG_INFO_KEY = 'SYS__CONFIG__INFO__'; + // 聊天UID key export const JEECG_CHAT_UID = 'JEECG_CHAT_UID'; diff --git a/src/router/guard/permissionGuard.ts b/src/router/guard/permissionGuard.ts index ec272ac..e0a881f 100644 --- a/src/router/guard/permissionGuard.ts +++ b/src/router/guard/permissionGuard.ts @@ -117,6 +117,7 @@ export function createPermissionGuard(router: Router) { if (userStore.getLastUpdateTime === 0) { try { await userStore.getUserInfoAction(); + await userStore.getSysConfigInfoAction(); } catch (err) { console.info(err); next(); diff --git a/src/store/modules/user.ts b/src/store/modules/user.ts index 7fadc89..d692099 100644 --- a/src/store/modules/user.ts +++ b/src/store/modules/user.ts @@ -1,13 +1,13 @@ -import type { UserInfo, LoginInfo } from '/#/store'; +import type { UserInfo, LoginInfo, SysConfigInfo } from '/#/store'; import type { ErrorMessageMode } from '/#/axios'; import { defineStore } from 'pinia'; import { store } from '/@/store'; import { RoleEnum } from '/@/enums/roleEnum'; import { PageEnum } from '/@/enums/pageEnum'; -import { ROLES_KEY, TOKEN_KEY, USER_INFO_KEY, LOGIN_INFO_KEY, DB_DICT_DATA_KEY, TENANT_ID } from '/@/enums/cacheEnum'; +import { ROLES_KEY, TOKEN_KEY, USER_INFO_KEY, LOGIN_INFO_KEY, SYS_CONFIG_INFO_KEY, DB_DICT_DATA_KEY, TENANT_ID } from '/@/enums/cacheEnum'; import { getAuthCache, setAuthCache, removeAuthCache } from '/@/utils/auth'; import { GetUserInfoModel, LoginParams, ThirdLoginParams } from '/@/api/sys/model/userModel'; -import { doLogout, getUserInfo, loginApi, phoneLoginApi, thirdLogin } from '/@/api/sys/user'; +import { doLogout, getUserInfo, getSysConfigInfo, loginApi, phoneLoginApi, thirdLogin } from '/@/api/sys/user'; import { useI18n } from '/@/hooks/web/useI18n'; import { useMessage } from '/@/hooks/web/useMessage'; import { router } from '/@/router'; @@ -27,6 +27,7 @@ interface UserState { lastUpdateTime: number; tenantid?: string | number; loginInfo?: Nullable; + sysConfigInfo?: Nullable; } export const useUserStore = defineStore({ @@ -48,6 +49,8 @@ export const useUserStore = defineStore({ tenantid: '', //登录返回信息 loginInfo: null, + //系统配置信息 + sysConfigInfo: null, }), getters: { getUserInfo(): UserInfo { @@ -56,6 +59,9 @@ export const useUserStore = defineStore({ getLoginInfo(): LoginInfo { return this.loginInfo || getAuthCache(LOGIN_INFO_KEY) || {}; }, + getSysConfigInfo(): SysConfigInfo { + return this.sysConfigInfo || getAuthCache(SYS_CONFIG_INFO_KEY) || {}; + }, getToken(): string { return this.token || getAuthCache(TOKEN_KEY); }, @@ -93,6 +99,10 @@ export const useUserStore = defineStore({ this.loginInfo = info; setAuthCache(LOGIN_INFO_KEY, info); }, + setSysConfigInfo(info: SysConfigInfo | null) { + this.sysConfigInfo = info; + setAuthCache(SYS_CONFIG_INFO_KEY, info); + }, setAllDictItems(dictItems) { this.dictItems = dictItems; setAuthCache(DB_DICT_DATA_KEY, dictItems); @@ -106,6 +116,7 @@ export const useUserStore = defineStore({ }, resetState() { this.userInfo = null; + this.sysConfigInfo = null; this.dictItems = []; this.token = ''; this.roleList = []; @@ -152,6 +163,7 @@ export const useUserStore = defineStore({ if (!this.getToken) return null; //获取用户信息 const userInfo = await this.getUserInfoAction(); + await this.getSysConfigInfoAction(); const sessionTimeout = this.sessionTimeout; if (sessionTimeout) { this.setSessionTimeout(false); @@ -201,7 +213,7 @@ export const useUserStore = defineStore({ if (!this.getToken) { return null; } - const { userInfo, sysAllDictItems } = await getUserInfo(); + const { userInfo, sysAllDictItems } = await getUserInfo(); if (userInfo) { const { roles = [] } = userInfo; if (isArray(roles)) { @@ -223,6 +235,16 @@ export const useUserStore = defineStore({ } return userInfo; }, + async getSysConfigInfoAction(): Promise { + const sysConfigInfo = await getSysConfigInfo(); + if(sysConfigInfo){ + await this.setSysConfigInfo(sysConfigInfo); + } else { + await this.setSysConfigInfo({}); + } + return sysConfigInfo; + }, + /** * 退出登录 */ diff --git a/src/utils/cache/memory.ts b/src/utils/cache/memory.ts index 20622d5..ae8409d 100644 --- a/src/utils/cache/memory.ts +++ b/src/utils/cache/memory.ts @@ -1,4 +1,4 @@ -import { TOKEN_KEY, ROLES_KEY, USER_INFO_KEY, DB_DICT_DATA_KEY, TENANT_ID, LOGIN_INFO_KEY, PROJ_CFG_KEY } from '/@/enums/cacheEnum'; +import { TOKEN_KEY, ROLES_KEY, USER_INFO_KEY, DB_DICT_DATA_KEY, TENANT_ID, LOGIN_INFO_KEY, SYS_CONFIG_INFO_KEY, PROJ_CFG_KEY } from '/@/enums/cacheEnum'; import { omit } from 'lodash-es'; export interface Cache { @@ -103,7 +103,7 @@ export class Memory { }); //update-begin---author:liusq Date:20220108 for:不删除登录用户的租户id,其他缓存信息都清除---- this.cache = { - ...omit(this.cache, [TOKEN_KEY, USER_INFO_KEY, ROLES_KEY, DB_DICT_DATA_KEY, TENANT_ID, LOGIN_INFO_KEY, PROJ_CFG_KEY]), + ...omit(this.cache, [TOKEN_KEY, USER_INFO_KEY, ROLES_KEY, DB_DICT_DATA_KEY, TENANT_ID, LOGIN_INFO_KEY, SYS_CONFIG_INFO_KEY, PROJ_CFG_KEY]), }; //update-end---author:liusq Date:20220108 for:不删除登录用户的租户id,其他缓存信息都清除---- } diff --git a/src/utils/cache/persistent.ts b/src/utils/cache/persistent.ts index ac29fa0..78071d9 100644 --- a/src/utils/cache/persistent.ts +++ b/src/utils/cache/persistent.ts @@ -1,4 +1,4 @@ -import type { LockInfo, UserInfo, LoginInfo } from '/#/store'; +import type { LockInfo, UserInfo, LoginInfo, SysConfigInfo } from '/#/store'; import type { ProjectConfig } from '/#/config'; import type { RouteLocationNormalized } from 'vue-router'; @@ -16,6 +16,7 @@ import { DB_DICT_DATA_KEY, TENANT_ID, LOGIN_INFO_KEY, + SYS_CONFIG_INFO_KEY, } from '/@/enums/cacheEnum'; import { DEFAULT_CACHE_TIME } from '/@/settings/encryptionSetting'; import { toRaw } from 'vue'; @@ -31,6 +32,7 @@ interface BasicStore { [DB_DICT_DATA_KEY]: string; [TENANT_ID]: string; [LOGIN_INFO_KEY]: LoginInfo; + [SYS_CONFIG_INFO_KEY]: SysConfigInfo; } type LocalStore = BasicStore; diff --git a/src/views/kc/kcErrorreport/JscjErrorList.vue b/src/views/kc/kcErrorreport/JscjErrorList.vue index 57175f8..fce5eb4 100644 --- a/src/views/kc/kcErrorreport/JscjErrorList.vue +++ b/src/views/kc/kcErrorreport/JscjErrorList.vue @@ -1,7 +1,7 @@ + + @@ -21,6 +23,7 @@ import { Modal } from 'ant-design-vue'; import { ExclamationCircleOutlined,CheckOutlined } from '@ant-design/icons-vue'; + import KcKechengbiaoListPage from '/@/views/kc/ktgl/KcKechengbiaoList.vue'; const queryParam = ref({}); //注册table数据 @@ -32,6 +35,13 @@ canResize:false, useSearchForm: false, immediate: false, + clickToRowSelect: true, + rowSelection: { + type: 'radio' + }, + pagination: { + pageSize: 5 + }, actionColumn: { width: 120, fixed: 'right', @@ -42,7 +52,7 @@ }, }, }); - const [registerTable, { reload}, { rowSelection, selectedRowKeys }] = tableContext; + const [registerTable, { reload}, { rowSelection, selectedRowKeys, selectedRows }] = tableContext; const labelCol = reactive({ xs: { span: 24 }, sm: { span: 7 }, @@ -67,7 +77,7 @@ function handleSuccess() { (selectedRowKeys.value = []) && reload(); } - + /** * 操作栏 */ @@ -79,7 +89,7 @@ }, ]; } - + function handleEdit(record: Recordable) { Modal.confirm({ icon: createVNode({}), @@ -114,7 +124,7 @@ function searchQuery() { reload(); } - + /** * 重置 */ @@ -124,7 +134,7 @@ //刷新数据 reload(); } - + defineExpose({ zbLoadData diff --git a/src/views/kc/kcErrorreport/KcErrorreportList.vue b/src/views/kc/kcErrorreport/KcErrorreportList.vue index d851e3c..8335489 100644 --- a/src/views/kc/kcErrorreport/KcErrorreportList.vue +++ b/src/views/kc/kcErrorreport/KcErrorreportList.vue @@ -105,7 +105,7 @@ registerModal.value.disableSubmit = false; registerModal.value.add(); } - + /** * 编辑事件 */ @@ -113,7 +113,7 @@ registerModal.value.disableSubmit = false; registerModal.value.edit(record); } - + /** * 详情 */ @@ -121,28 +121,28 @@ registerModal.value.disableSubmit = true; registerModal.value.edit(record); } - + /** * 删除事件 */ async function handleDelete(record) { await deleteOne({ id: record.id }, handleSuccess); } - + /** * 批量删除事件 */ async function batchHandleDelete() { await batchDelete({ ids: selectedRowKeys.value }, handleSuccess); } - + /** * 成功回调 */ function handleSuccess() { (selectedRowKeys.value = []) && reload(); } - + /** * 操作栏 */ @@ -154,7 +154,7 @@ }, ]; } - + /** * 下拉操作栏 */ @@ -179,7 +179,7 @@ function searchQuery() { reload(); } - + /** * 重置 */ @@ -189,7 +189,7 @@ //刷新数据 reload(); } - + diff --git a/src/views/kc/kcErrorreport/KcxxErrorList.vue b/src/views/kc/kcErrorreport/KcxxErrorList.vue index 0859f38..7afb844 100644 --- a/src/views/kc/kcErrorreport/KcxxErrorList.vue +++ b/src/views/kc/kcErrorreport/KcxxErrorList.vue @@ -1,7 +1,7 @@ + + @@ -21,6 +23,7 @@ import { Modal } from 'ant-design-vue'; import { ExclamationCircleOutlined,CheckOutlined } from '@ant-design/icons-vue'; + import KcKechengbiaoListPage from '/@/views/kc/ktgl/KcKechengbiaoList.vue'; const queryParam = ref({}); //注册table数据 @@ -32,6 +35,13 @@ canResize:false, useSearchForm: false, immediate: false, + clickToRowSelect: true, + rowSelection: { + type: 'radio' + }, + pagination: { + pageSize: 5 + }, actionColumn: { width: 120, fixed: 'right', @@ -42,7 +52,7 @@ }, }, }); - const [registerTable, { reload}, { rowSelection, selectedRowKeys }] = tableContext; + const [registerTable, { reload}, { rowSelection, selectedRowKeys, selectedRows }] = tableContext; const labelCol = reactive({ xs: { span: 24 }, sm: { span: 7 }, @@ -67,7 +77,7 @@ function handleSuccess() { (selectedRowKeys.value = []) && reload(); } - + /** * 操作栏 */ @@ -79,7 +89,7 @@ }, ]; } - + function handleEdit(record: Recordable) { Modal.confirm({ icon: createVNode({}), @@ -114,7 +124,7 @@ function searchQuery() { reload(); } - + /** * 重置 */ @@ -124,7 +134,7 @@ //刷新数据 reload(); } - + defineExpose({ zbLoadData diff --git a/src/views/kc/kcErrorreport/ZbptErrorList.vue b/src/views/kc/kcErrorreport/ZbptErrorList.vue index db646ab..451dcdf 100644 --- a/src/views/kc/kcErrorreport/ZbptErrorList.vue +++ b/src/views/kc/kcErrorreport/ZbptErrorList.vue @@ -1,7 +1,7 @@ + + @@ -21,6 +23,8 @@ import { Modal } from 'ant-design-vue'; import { ExclamationCircleOutlined,CheckOutlined } from '@ant-design/icons-vue'; + import KcKechengbiaoListPage from '/@/views/kc/ktgl/KcKechengbiaoList.vue'; + const queryParam = ref({}); //注册table数据 @@ -32,6 +36,13 @@ canResize:false, immediate: false, useSearchForm: false, + clickToRowSelect: true, + rowSelection: { + type: 'radio' + }, + pagination: { + pageSize: 5 + }, actionColumn: { width: 120, fixed: 'right', @@ -42,7 +53,7 @@ }, }, }); - const [registerTable, { reload}, { rowSelection, selectedRowKeys }] = tableContext; + const [registerTable, { reload }, { rowSelection, selectedRowKeys, selectedRows }] = tableContext; const labelCol = reactive({ xs: { span: 24 }, sm: { span: 7 }, @@ -67,7 +78,7 @@ function handleSuccess() { (selectedRowKeys.value = []) && reload(); } - + /** * 操作栏 */ @@ -79,7 +90,7 @@ }, ]; } - + function handleEdit(record: Recordable) { Modal.confirm({ icon: createVNode({}), @@ -114,7 +125,7 @@ function searchQuery() { reload(); } - + /** * 重置 */ @@ -124,7 +135,7 @@ //刷新数据 reload(); } - + defineExpose({ zbLoadData diff --git a/src/views/kc/ktgl/KcKechengbiao.data.ts b/src/views/kc/ktgl/KcKechengbiao.data.ts index e6a2c03..323c4f5 100644 --- a/src/views/kc/ktgl/KcKechengbiao.data.ts +++ b/src/views/kc/ktgl/KcKechengbiao.data.ts @@ -1,128 +1,220 @@ import {BasicColumn} from '/@/components/Table'; import {FormSchema} from '/@/components/Table'; import { rules} from '/@/utils/helper/validator'; -import { render } from '/@/utils/common/renderUtils'; +// import { render } from '/@/utils/common/renderUtils'; +import { JVxeColumn, JVxeTypes } from '/@/components/jeecg/JVxeTable/types'; //列表数据 -export const columns: BasicColumn[] = [ + +export const columns = ([ { - title: 'id', - align: "center", - width: '0', - dataIndex: 'id', - // ifShow: false, - }, - { - title: '课程号', - align: "center", + title: '课程编号', + align: "left", width: '300px', - dataIndex: 'kcbh' + key: 'kcbh', }, { title: '课程名称', - align: "center", - dataIndex: 'kcmc' + align: "left", + key: 'kcmc' }, { title: '授课教师', - align: "center", - dataIndex: 'skjs' + align: "left", + key: 'skjs' }, { title: '学科人数', - align: "center", + align: "left", width: '80px', - dataIndex: 'xkrs' + key: 'xkrs' }, { title: '开课单位', - align: "center", + align: "left", width: '100px', - dataIndex: 'kkdw_dictText' + key: 'kkdw_dictText' }, { title: '课程性质', - align: "center", + align: "left", width: '105px', - dataIndex: 'kcxz_dictText' + key: 'kcxz_dictText' }, { title: '上课地点', - align: "center", + align: "left", width: '100px', - dataIndex: 'skdd' + key: 'skdd' }, { title: '上课周次', - align: "center", + align: "left", width: '100px', - dataIndex: 'jkzc_dictText' + key: 'jkzc_dictText' }, { title: '节次', - align: "center", + align: "left", width: '70px', - dataIndex: 'hh_dictText' + key: 'hh_dictText' }, { title: '星期', - align: "center", + align: "left", width: '70px', - dataIndex: 'week_dictText' + key: 'week_dictText' }, { title: '学分', - align: "center", + align: "left", width: '50px', - dataIndex: 'xf' + key: 'xf' }, + { title: '是否出镜', - align: "center", - dataIndex: 'sfcj', - edit: true, - editComponent: 'Select', - // editComponentProps: { - // // //选中 - // checkedChildren: "是-", - // // checkedValue: 0, - // // //未选中 - // unCheckedChildren:'否-', - // // unCheckedValue: 1, - // // onClick: (checked: boolean | string | number, event: Event) => { - // // event.stopPropagation(); - // // console.log('选择后回调',checked,event); - - // // } - // }, - // editValueMap: (value) => value == '0'?'是':'否', - // editValueMap: (value) => value?'0':'1', - // format: (text) => ,C - editComponentProps: { - options: [ - { label: '是', value: 0, }, - { label: '否', value: 1, }, - ], - }, - // customRender: (r) => r.text == 0?'是':'否' + key: 'sfcj', + type: JVxeTypes.selectSearch, + width: 100, + options: [ + { label: '是', value: 0, }, + { label: '否', value: 1, }, + ], }, - - { title: '上课形式', - align: "center", - dataIndex: 'skxs', - edit: true, - editComponent: 'Select', - editComponentProps: { - options: [ - { label: '线上', value: 0, }, - { label: '线下', value: 1, }, - { label: '线上线下混合', value: 2, }, - ], - }, - // customRender: (r) => r.text == 0?'线上':r.text == 1?'线下':'线上线下混合' + key: 'skxs', + type: JVxeTypes.selectSearch, + width: 100, + options: [ + { label: '线上', value: 0, }, + { label: '线下', value: 1, }, + { label: '线上线下混合', value: 2, }, + ], }, -]; +]); + + +// export const columns: BasicColumn[] = [ +// { +// title: 'id', +// align: "center", +// width: '0', +// dataIndex: 'id', +// // ifShow: false, +// }, +// { +// title: '课程号', +// align: "center", +// width: '300px', +// dataIndex: 'kcbh' +// }, +// { +// title: '课程名称', +// align: "center", +// dataIndex: 'kcmc' +// }, +// { +// title: '授课教师', +// align: "center", +// dataIndex: 'skjs' +// }, +// { +// title: '学科人数', +// align: "center", +// width: '80px', +// dataIndex: 'xkrs' +// }, +// { +// title: '开课单位', +// align: "center", +// width: '100px', +// dataIndex: 'kkdw_dictText' +// }, +// { +// title: '课程性质', +// align: "center", +// width: '105px', +// dataIndex: 'kcxz_dictText' +// }, +// { +// title: '上课地点', +// align: "center", +// width: '100px', +// dataIndex: 'skdd' +// }, +// { +// title: '上课周次', +// align: "center", +// width: '100px', +// dataIndex: 'jkzc_dictText' +// }, +// { +// title: '节次', +// align: "center", +// width: '70px', +// dataIndex: 'hh_dictText' +// }, +// { +// title: '星期', +// align: "center", +// width: '70px', +// dataIndex: 'week_dictText' +// }, +// { +// title: '学分', +// align: "center", +// width: '50px', +// dataIndex: 'xf' +// }, +// { +// title: '是否出镜', +// align: "center", +// dataIndex: 'sfcj', +// edit: true, +// editComponent: 'Select', +// // editComponentProps: { +// // // //选中 +// // checkedChildren: "是-", +// // // checkedValue: 0, +// // // //未选中 +// // unCheckedChildren:'否-', +// // // unCheckedValue: 1, +// // // onClick: (checked: boolean | string | number, event: Event) => { +// // // event.stopPropagation(); +// // // console.log('选择后回调',checked,event); + +// // // } +// // }, +// // editValueMap: (value) => value == '0'?'是':'否', +// // editValueMap: (value) => value?'0':'1', +// // format: (text) => ,C +// editComponentProps: { +// options: [ +// { label: '是', value: 0, }, +// { label: '否', value: 1, }, +// ], +// }, +// // customRender: (r) => r.text == 0?'是':'否' +// }, + + +// { +// title: '上课形式', +// align: "center", +// dataIndex: 'skxs', +// edit: true, +// editComponent: 'Select', +// editComponentProps: { +// options: [ +// { label: '线上', value: 0, }, +// { label: '线下', value: 1, }, +// { label: '线上线下混合', value: 2, }, +// ], +// }, +// // customRender: (r) => r.text == 0?'线上':r.text == 1?'线下':'线上线下混合' +// }, +// ]; //查询数据 export const searchFormSchema: FormSchema[] = [ diff --git a/src/views/kc/ktgl/KcKechengbiaoList.vue b/src/views/kc/ktgl/KcKechengbiaoList.vue index fd3364c..7547bbe 100644 --- a/src/views/kc/ktgl/KcKechengbiaoList.vue +++ b/src/views/kc/ktgl/KcKechengbiaoList.vue @@ -1,7 +1,7 @@ diff --git a/src/views/kc/ktgl/KcKetangbiaoList.vue b/src/views/kc/ktgl/KcKetangbiaoList.vue index 3fdb9b2..5bb4977 100644 --- a/src/views/kc/ktgl/KcKetangbiaoList.vue +++ b/src/views/kc/ktgl/KcKetangbiaoList.vue @@ -114,6 +114,7 @@ canResize:false, useSearchForm: false, showActionColumn: false, + clickToRowSelect: true, rowSelection: { type: 'radio' }, diff --git a/src/views/site/utils/index.ts b/src/views/site/utils/index.ts index 741697c..74f382a 100644 --- a/src/views/site/utils/index.ts +++ b/src/views/site/utils/index.ts @@ -1,14 +1,41 @@ import { defHttp } from '/@/utils/http/axios'; +import { useUserStore } from '/@/store/modules/user'; + + +/** + * 项目名称 + */ +export const projectName = import.meta.env.VITE_GLOB_APP_TITLE; + +/** + * 是否开启单点登录 + */ +export const isOpenSSO = import.meta.env.VITE_GLOB_APP_OPEN_SSO; export const getUserId = () => { - return '2022010920'; + if(isOpenSSO){ + const { userInfo } = useUserStore(); + //正常取用户 + return userInfo?.username; + }else{ + //固定某值 + return '2016900057'; + } } +//S:学生 T:教师 export const getUserSf = () => { - return 'S'; + const { userInfo } = useUserStore(); + if(userInfo?.userIdentity == 1){ + return 'S'; + }else if(userInfo?.userIdentity == 2){ + return 'T'; + } } // export const getSysConfig = () => defHttp.get({ url: '/kcSysConfig/kcSysConfig/queryById', params:{id:'1'} }) -export const getSysConfig = () => ({bxqkssj:'2023-02-19',bxqjssj:'2023-07-19'}) - \ No newline at end of file +export const getSysConfig = () => { + const { sysConfigInfo } = useUserStore(); + return sysConfigInfo; +} diff --git a/types/store.d.ts b/types/store.d.ts index 7b9349a..dbd2c40 100644 --- a/types/store.d.ts +++ b/types/store.d.ts @@ -57,3 +57,32 @@ export interface BeforeMiniState { menuMode?: MenuModeEnum; menuType?: MenuTypeEnum; } + +export interface SysConfigInfo { + /**主键*/ + id?: string; + /**创建人*/ + createBy: string; + /**创建日期*/ + createTime?: string; + /**更新人*/ + updateBy: string; + /**更新日期*/ + updateTime?: string; + /**所属部门*/ + sysOrgCode?: string; + /**本学期课程开始时间*/ + bxqkssj?: string; + /**本学期课程结束时间*/ + bxqjssj?: string; + /**预留字段1*/ + flag1?: string; + /**预留字段2*/ + flag2?: string; + /**预留字段3*/ + flag3?: string; + /**预留字段4*/ + flag4?: string; + /**预留字段5*/ + flag5?: string; +}