Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
iBiz-Vue-R7
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
22
议题
22
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
iBiz-R7前端标准模板
iBiz-Vue-R7
提交
cc0d3611
提交
cc0d3611
编写于
11月 09, 2022
作者:
RedPig97
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update: 更新
上级
551d4acd
变更
3
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
64 行增加
和
62 行删除
+64
-62
DATA_CANCELCHANGES.ftl
...ANEL/VIEW_LAYOUTPANEL_UIACTION/SYS/DATA_CANCELCHANGES.ftl
+10
-10
LOGIN.ftl
.../VIEW_LAYOUTPANEL/VIEW_LAYOUTPANEL_UIACTION/SYS/LOGIN.ftl
+51
-49
LOGOUT.ftl
...VIEW_LAYOUTPANEL/VIEW_LAYOUTPANEL_UIACTION/SYS/LOGOUT.ftl
+3
-3
未找到文件。
@VIEW/@MACRO/VIEW_LAYOUTPANEL/VIEW_LAYOUTPANEL_UIACTION/SYS/DATA_CANCELCHANGES.ftl
浏览文件 @
cc0d3611
...
@@ -12,23 +12,23 @@
...
@@ -12,23 +12,23 @@
* @param {*} [srfParentDeName] 父实体名称
* @param {*} [srfParentDeName] 父实体名称
*/
*/
public ${item.getFullCodeName()}(args: any[], contextJO?:any, params?: any, $event?: any, xData?: any, actionContext?:any, srfParentDeName?:string) {
public ${item.getFullCodeName()}(args: any[], contextJO?:any, params?: any, $event?: any, xData?: any, actionContext?:any, srfParentDeName?:string) {
if (
actionContext
.viewType === 'APPLOGINVIEW') {
if (
this
.viewType === 'APPLOGINVIEW') {
const length = Object.keys(
actionContext
.layoutData).length;
const length = Object.keys(
this
.layoutData).length;
for (let i = length - 1; i >= 0; i--) {
for (let i = length - 1; i >= 0; i--) {
const name = Object.keys(
actionContext
.layoutData)[i];
const name = Object.keys(
this
.layoutData)[i];
if (
actionContext.layoutData.hasOwnProperty(name) && !Object.is(actionContext
.layoutModelDetails[name].itemType, 'CONTAINER')) {
if (
this.layoutData.hasOwnProperty(name) && !Object.is(this
.layoutModelDetails[name].itemType, 'CONTAINER')) {
actionContext
.handleValueChange({ name, value: null });
this
.handleValueChange({ name, value: null });
}
}
}
}
actionContext
.$nextTick(() => {
this
.$nextTick(() => {
actionContext
.$forceUpdate();
this
.$forceUpdate();
})
})
} else {
} else {
const parentRef
= actionContext
.$parent;
const parentRef
: any = this
.$parent;
if (parentRef.closeView && (parentRef.closeView instanceof Function)) {
if (parentRef.closeView && (parentRef.closeView instanceof Function)) {
parentRef.closeView(args);
parentRef.closeView(args);
} else if (
actionContext.closeView && (actionContext
.closeView instanceof Function)) {
} else if (
this.closeView && (this
.closeView instanceof Function)) {
actionContext
.closeView(args);
this
.closeView(args);
}
}
}
}
}
}
...
...
@VIEW/@MACRO/VIEW_LAYOUTPANEL/VIEW_LAYOUTPANEL_UIACTION/SYS/LOGIN.ftl
浏览文件 @
cc0d3611
...
@@ -12,59 +12,61 @@
...
@@ -12,59 +12,61 @@
* @param {*} [srfParentDeName] 父实体名称
* @param {*} [srfParentDeName] 父实体名称
*/
*/
public ${item.getFullCodeName()}(args: any[], contextJO?:any, params?: any, $event?: any, xData?: any, actionContext?:any, srfParentDeName?:string) {
public ${item.getFullCodeName()}(args: any[], contextJO?:any, params?: any, $event?: any, xData?: any, actionContext?:any, srfParentDeName?:string) {
const layoutData = args.length > 0 ? args[0] : {};
if (this.viewType === 'APPLOGINVIEW') {
const layoutModelDetails: any = actionContext.layoutModelDetails || {};
const layoutData = args.length > 0 ? args[0] : {};
let userNameKey: string = Object.keys(layoutModelDetails).find((key: string) => Object.is(layoutModelDetails[key].predefinedType, 'AUTH_USERID')) || '';
const layoutModelDetails: any = this.layoutModelDetails || {};
let passwordKey: string = Object.keys(layoutModelDetails).find((key: string) => Object.is(layoutModelDetails[key].predefinedType, 'AUTH_PASSWORD')) || '';
let userNameKey: string = Object.keys(layoutModelDetails).find((key: string) => Object.is(layoutModelDetails[key].predefinedType, 'AUTH_USERID')) || '';
let messageKey: string = Object.keys(layoutModelDetails).find((key: string) => Object.is(layoutModelDetails[key].predefinedType, 'AUTH_LOGINMSG')) || '';
let passwordKey: string = Object.keys(layoutModelDetails).find((key: string) => Object.is(layoutModelDetails[key].predefinedType, 'AUTH_PASSWORD')) || '';
if (!userNameKey || !passwordKey) {
let messageKey: string = Object.keys(layoutModelDetails).find((key: string) => Object.is(layoutModelDetails[key].predefinedType, 'AUTH_LOGINMSG')) || '';
actionContext.$message({ message: '用户名或密码未配置!',type: 'warning'});
if (!userNameKey || !passwordKey) {
if (messageKey) {
actionContext.handleValueChange({ name: messageKey, value: '用户名或密码未配置!' });
}
}
const loginname: any = layoutData[userNameKey];
const password: any = layoutData[passwordKey];
if (!loginname || !password) {
actionContext.$message({ message: '请输入用户名与密码',type: 'warning'});
if (messageKey) {
actionContext.handleValueChange({ name: messageKey, value: '请输入用户名与密码' });
}
}
// 清除cookie
let leftTime = new Date();
leftTime.setTime(leftTime.getSeconds() - 1000);
document.cookie = "ibzuaa-token=;expires=" + leftTime.toUTCString();
const data = { loginname, password };
const post: Promise<any> = actionContext.$http.post('/v7/login', data, true);
post.then((response: any) => {
if (response && response.status === 200) {
const data = response.data;
if (data && data.token) {
localStorage.setItem('token', data.token);
Util.setCookie('ibzuaa-token',data.token,0);
}
if(data && data.user){
localStorage.setItem('user', JSON.stringify(data.user));
}
// 设置cookie,保存账号密码7天
Util.setCookie("loginname",loginname, 7);
// 跳转首页
const url: any = actionContext.$route.query.redirect ? actionContext.$route.query.redirect : '*';
actionContext.$router.push({path: url});
}
}).catch((error: any) => {
// 登录提示
const data = error.data;
if (data && data.message) {
if (messageKey) {
if (messageKey) {
actionContext.handleValueChange({ name: messageKey, value: data.message });
this.handleValueChange({ name: messageKey, value: '用户名或密码未配置!' });
} else {
this.$message({ message: '用户名或密码未配置!',type: 'warning'});
}
}
} else {
}
const loginname: any = layoutData[userNameKey];
const password: any = layoutData[passwordKey];
if (!loginname || !password) {
if (messageKey) {
if (messageKey) {
actionContext.handleValueChange({ name: messageKey, value: actionContext.$t('components.login.loginfailed') });
this.handleValueChange({ name: messageKey, value: '请输入用户名与密码' });
} else {
this.$message({ message: '请输入用户名与密码',type: 'warning'});
}
}
}
}
});
// 清除cookie
let leftTime = new Date();
leftTime.setTime(leftTime.getSeconds() - 1000);
document.cookie = "ibzuaa-token=;expires=" + leftTime.toUTCString();
const data = { loginname, password };
const post: Promise<any> = this.$http.post('/v7/login', data, true);
post.then((response: any) => {
if (response && response.status === 200) {
const data = response.data;
if (data && data.token) {
localStorage.setItem('token', data.token);
Util.setCookie('ibzuaa-token',data.token,0);
}
if(data && data.user){
localStorage.setItem('user', JSON.stringify(data.user));
}
// 设置cookie,保存账号密码7天
Util.setCookie("loginname",loginname, 7);
// 跳转首页
const url: any = this.$route.query.redirect ? this.$route.query.redirect : '*';
this.$router.push({path: url});
}
}).catch((error: any) => {
// 登录提示
const data = error.data;
if (data) {
if (messageKey) {
this.handleValueChange({ name: messageKey, value: data.message || this.$t('components.login.loginfailed') });
}
}
});
} else {
this.$router.push({ path: "/login", query: { redirect: window.location.hash.replace("#", '') } });
}
}
}
</#macro>
</#macro>
\ No newline at end of file
@VIEW/@MACRO/VIEW_LAYOUTPANEL/VIEW_LAYOUTPANEL_UIACTION/SYS/LOGOUT.ftl
浏览文件 @
cc0d3611
...
@@ -12,13 +12,13 @@
...
@@ -12,13 +12,13 @@
* @param {*} [srfParentDeName] 父实体名称
* @param {*} [srfParentDeName] 父实体名称
*/
*/
public ${item.getFullCodeName()}(args: any[], contextJO?:any, params?: any, $event?: any, xData?: any, actionContext?:any, srfParentDeName?:string) {
public ${item.getFullCodeName()}(args: any[], contextJO?:any, params?: any, $event?: any, xData?: any, actionContext?:any, srfParentDeName?:string) {
actionContext
.$Modal.confirm({
this
.$Modal.confirm({
title: '提示',
title: '提示',
content: '确认要退出登录?',
content: '确认要退出登录?',
okText: '确认',
okText: '确认',
cancelText: '取消',
cancelText: '取消',
onOk: () => {
onOk: () => {
actionContext
.$http
this
.$http
.get("/v7/logout")
.get("/v7/logout")
.then((response: any) => {
.then((response: any) => {
if (response && response.status === 200) {
if (response && response.status === 200) {
...
@@ -27,7 +27,7 @@
...
@@ -27,7 +27,7 @@
let leftTime = new Date();
let leftTime = new Date();
leftTime.setTime(leftTime.getSeconds() - 1);
leftTime.setTime(leftTime.getSeconds() - 1);
document.cookie = "ibzuaa-token=;expires=" + leftTime.toUTCString();
document.cookie = "ibzuaa-token=;expires=" + leftTime.toUTCString();
actionContext.$router.push({ name: "login"
});
this.$router.push({ path: "/login", query: { redirect: window.location.hash.replace("#", '') }
});
}
}
})
})
.catch((error: any) => {
.catch((error: any) => {
...
...
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录