Skip to content

Commit

Permalink
!151 发布 vue 版本 5.2.3 与 cloud 版本 2.2.2
Browse files Browse the repository at this point in the history
Merge pull request !151 from 疯狂的狮子Li/dev
  • Loading branch information
JavaLionLi authored and gitee-org committed Oct 25, 2024
2 parents 1606dbd + 28a81f2 commit 9a02598
Show file tree
Hide file tree
Showing 15 changed files with 55 additions and 20 deletions.
3 changes: 3 additions & 0 deletions .env.development
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,6 @@ VITE_APP_CLIENT_ID = 'e5cd7e4891bf95d1d19206ce24a7b32e'

# websocket 开关 默认使用sse推送
VITE_APP_WEBSOCKET = false

# sse 开关
VITE_APP_SSE = true
3 changes: 3 additions & 0 deletions .env.production
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,6 @@ VITE_APP_CLIENT_ID = 'e5cd7e4891bf95d1d19206ce24a7b32e'

# websocket 开关 默认使用sse推送
VITE_APP_WEBSOCKET = false

# sse 开关
VITE_APP_SSE = true
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ruoyi-vue-plus",
"version": "5.2.2",
"version": "5.2.3",
"description": "RuoYi-Vue-Plus多租户管理系统",
"author": "LionLi",
"license": "MIT",
Expand Down
8 changes: 8 additions & 0 deletions src/api/system/tenant/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,3 +91,11 @@ export function syncTenantPackage(tenantId: string | number, packageId: string |
params: data
});
}

// 同步租户字典
export function syncTenantDict() {
return request({
url: '/system/tenant/syncTenantDict',
method: 'get',
});
}
2 changes: 1 addition & 1 deletion src/layout/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ onMounted(() => {
});
onMounted(() => {
initSSE(import.meta.env.VITE_APP_BASE_API + '/resource/sse')
initSSE(import.meta.env.VITE_APP_BASE_API + '/resource/sse');
});
const handleClickOutside = () => {
Expand Down
1 change: 1 addition & 0 deletions src/types/env.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ interface ImportMetaEnv {
VITE_APP_RSA_PRIVATE_KEY: string;
VITE_APP_CLIENT_ID: string;
VITE_APP_WEBSOCKET: string;
VITE_APP_SSE: string;
}
interface ImportMeta {
readonly env: ImportMetaEnv;
Expand Down
10 changes: 8 additions & 2 deletions src/utils/request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import FileSaver from 'file-saver';
import { getLanguage } from '@/lang';
import { encryptBase64, encryptWithAes, generateAesKey, decryptWithAes, decryptBase64 } from '@/utils/crypto';
import { encrypt, decrypt } from '@/utils/jsencrypt';
import router from "@/router";

const encryptHeader = 'encrypt-key';
let downloadLoadingInstance: LoadingInstance;
Expand Down Expand Up @@ -134,8 +135,13 @@ service.interceptors.response.use(
}).then(() => {
isRelogin.show = false;
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(() => {
isRelogin.show = false;
});
Expand Down
14 changes: 7 additions & 7 deletions src/utils/sse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@ import { getToken } from '@/utils/auth';
import { ElNotification } from 'element-plus';
import useNoticeStore from '@/store/modules/notice';

let message = '';

// 初始化
export const initSSE = (url: any) => {
if (import.meta.env.VITE_APP_SSE === 'false') {
return;
}

url = url + '?Authorization=Bearer ' + getToken() + '&clientid=' + import.meta.env.VITE_APP_CLIENT_ID
const {
data,
Expand All @@ -15,13 +17,13 @@ export const initSSE = (url: any) => {
retries: 10,
delay: 3000,
onFailed() {
console.log('Failed to connect after 10 retries')
},
console.log('Failed to connect after 10 retries');
}
}
});

watch(error, () => {
console.log('SSE connection error:', error.value)
console.log('SSE connection error:', error.value);
error.value = null;
});

Expand All @@ -41,5 +43,3 @@ export const initSSE = (url: any) => {
data.value = null;
});
};


4 changes: 2 additions & 2 deletions src/views/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
* 部署方式 Docker 容器编排 一键部署业务集群<br />
* 国际化 SpringMessage Spring标准国际化方案<br />
</p>
<p><b>当前版本:</b> <span>v5.2.2</span></p>
<p><b>当前版本:</b> <span>v5.2.3</span></p>
<p>
<el-tag type="danger">&yen;免费开源</el-tag>
</p>
Expand Down Expand Up @@ -77,7 +77,7 @@
* 分布式监控 Prometheus、Grafana 全方位性能监控<br />
* 其余与 Vue 版本一致<br />
</p>
<p><b>当前版本:</b> <span>v2.2.1</span></p>
<p><b>当前版本:</b> <span>v2.2.2</span></p>
<p>
<el-tag type="danger">&yen;免费开源</el-tag>
</p>
Expand Down
4 changes: 2 additions & 2 deletions src/views/login.vue
Original file line number Diff line number Diff line change
Expand Up @@ -97,15 +97,15 @@ const tenantEnabled = ref(true);
// 注册开关
const register = ref(false);
const redirect = ref(undefined);
const redirect = ref('/');
const loginRef = ref<ElFormInstance>();
// 租户列表
const tenantList = ref<TenantVO[]>([]);
watch(
() => router.currentRoute.value,
(newRoute: any) => {
redirect.value = newRoute.query && newRoute.query.redirect;
redirect.value = newRoute.query && decodeURIComponent(newRoute.query.redirect);
},
{ immediate: true }
);
Expand Down
2 changes: 1 addition & 1 deletion src/views/monitor/logininfor/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ const handleExport = () => {
{
...queryParams.value
},
`config_${new Date().getTime()}.xlsx`
`logininfor_${new Date().getTime()}.xlsx`
);
};
Expand Down
13 changes: 13 additions & 0 deletions src/views/system/dict/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@
<el-col :span="1.5">
<el-button v-hasPermi="['system:dict:remove']" type="danger" plain icon="Refresh" @click="handleRefreshCache">刷新缓存</el-button>
</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>
</el-row>
</template>
Expand Down Expand Up @@ -109,11 +112,15 @@

<script setup name="Dict" lang="ts">
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 { DictTypeForm, DictTypeQuery, DictTypeVO } from '@/api/system/dict/type/types';
import { syncTenantDict } from "@/api/system/tenant";
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
const userStore = useUserStore();
const userId = ref(userStore.userId);
const typeList = ref<DictTypeVO[]>([]);
const loading = ref(true);
const showSearch = ref(true);
Expand Down Expand Up @@ -239,6 +246,12 @@ const handleRefreshCache = async () => {
proxy?.$modal.msgSuccess('刷新成功');
useDictStore().cleanDict();
};
/**同步租户字典*/
const handleSyncTenantDict = async () => {
await proxy?.$modal.confirm('确认要同步所有租户字典吗?');
let res = await syncTenantDict();
proxy?.$modal.msgSuccess(res.msg);
};
onMounted(() => {
getList();
Expand Down
2 changes: 1 addition & 1 deletion src/views/system/tenantPackage/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ const handleDelete = async (row?: TenantPkgVO) => {
/** 导出按钮操作 */
const handleExport = () => {
proxy?.download(
'system/package/export',
'system/tenant/package/export',
{
...queryParams.value
},
Expand Down
1 change: 0 additions & 1 deletion src/views/tool/gen/genInfoForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,6 @@ const setSubTableColumns = (value: string) => {
/** 查询菜单下拉树结构 */
const getMenuTreeselect = async () => {
const res = await listMenu();
res.data.forEach((m) => (m.menuId = m.menuId.toString()));
const data = proxy?.handleTree<MenuOptionsType>(res.data, 'menuId');
if (data) {
Expand Down
6 changes: 4 additions & 2 deletions src/views/workflow/leave/leaveEdit.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,12 @@
<el-form-item label="请假时间">
<el-date-picker
v-model="leaveTime"
value-format="YYYY-MM-DD HH:mm:ss"
type="daterange"
range-separator="To"
start-placeholder="开始时间"
end-placeholder="结束时间"
:default-time="[new Date(2000, 1, 1, 0, 0, 0), new Date(2000, 1, 1, 23, 59, 59)]"
@change="changeLeaveTime()"
/>
</el-form-item>
Expand Down Expand Up @@ -190,8 +192,8 @@ const handleStartWorkFlow = async (data: LeaveVO) => {
taskVariables.value = {
entity: data,
leaveDays: data.leaveDays,
userList: [1, 3],
userList2: [1, 3]
userList: ["1", "3"],
userList2: ["1", "3"]
};
submitFormData.value.variables = taskVariables.value;
const resp = await startWorkFlow(submitFormData.value);
Expand Down

0 comments on commit 9a02598

Please sign in to comment.