提交 c5e8bf2a 编写于 作者: RedPig97's avatar RedPig97

add:新增系统预置应用功能

上级 4eeb5c06
...@@ -5,6 +5,8 @@ ...@@ -5,6 +5,8 @@
<#assign import_block> <#assign import_block>
import ${srfclassname('${ctrl.codeName}')}Model from '@/app-core/ctrl-model/app/${srffilepath2(ctrl.codeName)}-${ctrl.getControlType()?lower_case}-model'; import ${srfclassname('${ctrl.codeName}')}Model from '@/app-core/ctrl-model/app/${srffilepath2(ctrl.codeName)}-${ctrl.getControlType()?lower_case}-model';
import { Environment } from '@/environments/environment'; import { Environment } from '@/environments/environment';
import { Util } from '@/ibiz-core/utils';
import { alertController } from '@ionic/core';
</#assign> </#assign>
<#ibizinclude> <#ibizinclude>
../@MACRO/CONTROL/CONTROL_HEADER-BASE.vue.ftl ../@MACRO/CONTROL/CONTROL_HEADER-BASE.vue.ftl
......
...@@ -5,5 +5,52 @@ ...@@ -5,5 +5,52 @@
* @memberof ${srfclassname('${ctrl.codeName}')} * @memberof ${srfclassname('${ctrl.codeName}')}
*/ */
protected click${item.codeName}(item: any = {}){ protected click${item.codeName}(item: any = {}){
<#if item.getPSPDTAppFuncId()?? && item.getPSPDTAppFuncId() == "LOGOUT">
const title: any = this.$t("app.tabpage.sureclosetip.title");
const get: Promise<any> = this.$http.get("/v7/logout");
get.then((response: any) => {
if (response && response.status === 200) {
if (localStorage.getItem("user")) {
localStorage.removeItem("user");
}
if (localStorage.getItem("token")) {
localStorage.removeItem("token");
}
if (sessionStorage.getItem("currId")) {
sessionStorage.removeItem("currId")
}
// 清除cookie
Util.clearCookie('ibzuaa-token',true);
Util.clearCookie('ibzuaa-user',true);
Util.clearCookie('srforgid',true);
Util.clearCookie('srfsystemid',true);
localStorage.clear();
this.$store.commit('addAppData', null);
this.$router.push({ name: "login" });
}
})
.catch((error: any) => {
console.error(error);
});
<#elseif item.getPSPDTAppFuncId()?? && item.getPSPDTAppFuncId() == "CLEARCACHE">
const result: Promise<any> = this.$notice.confirm("清除缓存", "清除缓存可能会导致当前登录信息失效!!!");
result.then((response: any) => {
localStorage.clear();
});
<#elseif item.getPSPDTAppFuncId()?? && item.getPSPDTAppFuncId() == "ABOUT">
return new Promise(async () => {
const alert = await alertController.create({
header: Environment.AppTitle,
message: `当前系统版本<#noparse>${Environment.AppVersion}</#noparse>`,
buttons: [
{
text: "确认",
cssClass: "secondary",
},
],
});
await alert.present();
});
</#if>
} }
\ No newline at end of file
...@@ -8,6 +8,8 @@ export const Environment = { ...@@ -8,6 +8,8 @@ export const Environment = {
AppName: '${app.getPKGCodeName()}', AppName: '${app.getPKGCodeName()}',
// 应用 title // 应用 title
AppTitle: '${app.getName()}', AppTitle: '${app.getName()}',
// 系统版本
AppVersion: '${app.getAppVersion()}',
// 应用基础路径 // 应用基础路径
BaseUrl: '../', BaseUrl: '../',
// 系统名称 // 系统名称
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册