Pre Merge pull request !146 from yuanye/dev
This commit is contained in:
commit
fbd8377d93
@ -91,3 +91,11 @@ export function syncTenantPackage(tenantId: string | number, packageId: string |
|
|||||||
params: data
|
params: data
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 同步租户字典
|
||||||
|
export function syncTenantDict() {
|
||||||
|
return request({
|
||||||
|
url: '/system/tenant/syncTenantDict',
|
||||||
|
method: 'get',
|
||||||
|
});
|
||||||
|
}
|
||||||
|
@ -10,6 +10,7 @@ import FileSaver from 'file-saver';
|
|||||||
import { getLanguage } from '@/lang';
|
import { getLanguage } from '@/lang';
|
||||||
import { encryptBase64, encryptWithAes, generateAesKey, decryptWithAes, decryptBase64 } from '@/utils/crypto';
|
import { encryptBase64, encryptWithAes, generateAesKey, decryptWithAes, decryptBase64 } from '@/utils/crypto';
|
||||||
import { encrypt, decrypt } from '@/utils/jsencrypt';
|
import { encrypt, decrypt } from '@/utils/jsencrypt';
|
||||||
|
import router from "@/router";
|
||||||
|
|
||||||
const encryptHeader = 'encrypt-key';
|
const encryptHeader = 'encrypt-key';
|
||||||
let downloadLoadingInstance: LoadingInstance;
|
let downloadLoadingInstance: LoadingInstance;
|
||||||
@ -134,7 +135,12 @@ service.interceptors.response.use(
|
|||||||
}).then(() => {
|
}).then(() => {
|
||||||
isRelogin.show = false;
|
isRelogin.show = false;
|
||||||
useUserStore().logout().then(() => {
|
useUserStore().logout().then(() => {
|
||||||
location.href = import.meta.env.VITE_APP_CONTEXT_PATH + 'index';
|
router.replace({
|
||||||
|
path: '/login',
|
||||||
|
query: {
|
||||||
|
redirect: encodeURIComponent(router.currentRoute.value.fullPath || '/')
|
||||||
|
}
|
||||||
|
})
|
||||||
});
|
});
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
isRelogin.show = false;
|
isRelogin.show = false;
|
||||||
|
@ -97,7 +97,7 @@ const tenantEnabled = ref(true);
|
|||||||
|
|
||||||
// 注册开关
|
// 注册开关
|
||||||
const register = ref(false);
|
const register = ref(false);
|
||||||
const redirect = ref(undefined);
|
const redirect = ref('/');
|
||||||
const loginRef = ref<ElFormInstance>();
|
const loginRef = ref<ElFormInstance>();
|
||||||
// 租户列表
|
// 租户列表
|
||||||
const tenantList = ref<TenantVO[]>([]);
|
const tenantList = ref<TenantVO[]>([]);
|
||||||
@ -105,7 +105,7 @@ const tenantList = ref<TenantVO[]>([]);
|
|||||||
watch(
|
watch(
|
||||||
() => router.currentRoute.value,
|
() => router.currentRoute.value,
|
||||||
(newRoute: any) => {
|
(newRoute: any) => {
|
||||||
redirect.value = newRoute.query && newRoute.query.redirect;
|
redirect.value = newRoute.query && decodeURIComponent(newRoute.query.redirect);
|
||||||
},
|
},
|
||||||
{ immediate: true }
|
{ immediate: true }
|
||||||
);
|
);
|
||||||
|
@ -49,6 +49,9 @@
|
|||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button v-hasPermi="['system:dict:remove']" type="danger" plain icon="Refresh" @click="handleRefreshCache">刷新缓存</el-button>
|
<el-button v-hasPermi="['system:dict:remove']" type="danger" plain icon="Refresh" @click="handleRefreshCache">刷新缓存</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button v-if="userId === 1" type="success" plain icon="Refresh" @click="handleSyncTenantDict">同步租户字典</el-button>
|
||||||
|
</el-col>
|
||||||
<right-toolbar v-model:showSearch="showSearch" @query-table="getList"></right-toolbar>
|
<right-toolbar v-model:showSearch="showSearch" @query-table="getList"></right-toolbar>
|
||||||
</el-row>
|
</el-row>
|
||||||
</template>
|
</template>
|
||||||
@ -109,11 +112,15 @@
|
|||||||
|
|
||||||
<script setup name="Dict" lang="ts">
|
<script setup name="Dict" lang="ts">
|
||||||
import useDictStore from '@/store/modules/dict';
|
import useDictStore from '@/store/modules/dict';
|
||||||
|
import useUserStore from "@/store/modules/user";
|
||||||
import { listType, getType, delType, addType, updateType, refreshCache } from '@/api/system/dict/type';
|
import { listType, getType, delType, addType, updateType, refreshCache } from '@/api/system/dict/type';
|
||||||
import { DictTypeForm, DictTypeQuery, DictTypeVO } from '@/api/system/dict/type/types';
|
import { DictTypeForm, DictTypeQuery, DictTypeVO } from '@/api/system/dict/type/types';
|
||||||
|
import { syncTenantDict } from "@/api/system/tenant";
|
||||||
|
|
||||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||||
|
|
||||||
|
const userStore = useUserStore();
|
||||||
|
const userId = ref(userStore.userId);
|
||||||
const typeList = ref<DictTypeVO[]>([]);
|
const typeList = ref<DictTypeVO[]>([]);
|
||||||
const loading = ref(true);
|
const loading = ref(true);
|
||||||
const showSearch = ref(true);
|
const showSearch = ref(true);
|
||||||
@ -239,6 +246,12 @@ const handleRefreshCache = async () => {
|
|||||||
proxy?.$modal.msgSuccess('刷新成功');
|
proxy?.$modal.msgSuccess('刷新成功');
|
||||||
useDictStore().cleanDict();
|
useDictStore().cleanDict();
|
||||||
};
|
};
|
||||||
|
/**同步租户字典*/
|
||||||
|
const handleSyncTenantDict = async () => {
|
||||||
|
await proxy?.$modal.confirm('确认要同步所有租户字典吗?');
|
||||||
|
let res = await syncTenantDict();
|
||||||
|
proxy?.$modal.msgSuccess(res.msg);
|
||||||
|
};
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
getList();
|
getList();
|
||||||
|
@ -321,7 +321,7 @@ const handleDelete = async (row?: TenantPkgVO) => {
|
|||||||
/** 导出按钮操作 */
|
/** 导出按钮操作 */
|
||||||
const handleExport = () => {
|
const handleExport = () => {
|
||||||
proxy?.download(
|
proxy?.download(
|
||||||
'system/package/export',
|
'system/tenant/package/export',
|
||||||
{
|
{
|
||||||
...queryParams.value
|
...queryParams.value
|
||||||
},
|
},
|
||||||
|
@ -274,7 +274,6 @@ const setSubTableColumns = (value: string) => {
|
|||||||
/** 查询菜单下拉树结构 */
|
/** 查询菜单下拉树结构 */
|
||||||
const getMenuTreeselect = async () => {
|
const getMenuTreeselect = async () => {
|
||||||
const res = await listMenu();
|
const res = await listMenu();
|
||||||
res.data.forEach((m) => (m.menuId = m.menuId.toString()));
|
|
||||||
const data = proxy?.handleTree<MenuOptionsType>(res.data, 'menuId');
|
const data = proxy?.handleTree<MenuOptionsType>(res.data, 'menuId');
|
||||||
|
|
||||||
if (data) {
|
if (data) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user