Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
D
dataease
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
zhu
dataease
Commits
469aa684
提交
469aa684
authored
5月 12, 2021
作者:
fit2cloud-chenyw
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat: xpack功能初版
上级
53b1e6a6
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
32 个修改的文件
包含
1106 行增加
和
29 行删除
+1106
-29
License.java
backend/src/main/java/io/dataease/base/domain/License.java
+126
-0
LicenseExample.java
...src/main/java/io/dataease/base/domain/LicenseExample.java
+0
-0
LicenseMapper.java
.../src/main/java/io/dataease/base/mapper/LicenseMapper.java
+97
-0
LicenseMapper.xml
...d/src/main/java/io/dataease/base/mapper/LicenseMapper.xml
+257
-0
DefaultLicenseService.java
...va/io/dataease/commons/license/DefaultLicenseService.java
+130
-0
F2CLicense.java
...src/main/java/io/dataease/commons/license/F2CLicense.java
+71
-0
F2CLicenseResponse.java
.../java/io/dataease/commons/license/F2CLicenseResponse.java
+46
-0
InnerLicenseService.java
...java/io/dataease/commons/license/InnerLicenseService.java
+40
-0
LicenseController.java
...c/main/java/io/dataease/controller/LicenseController.java
+46
-0
SystemParameterController.java
...ava/io/dataease/controller/SystemParameterController.java
+17
-1
SystemParameterService.java
...va/io/dataease/service/system/SystemParameterService.java
+1
-0
V8__system.sql
backend/src/main/resources/db/migration/V8__system.sql
+17
-0
lic.js
frontend/src/api/system/lic.js
+8
-0
user.js
frontend/src/api/user.js
+14
-0
en.js
frontend/src/lang/en.js
+1
-1
tw.js
frontend/src/lang/tw.js
+1
-1
zh.js
frontend/src/lang/zh.js
+8
-1
Licbar.vue
frontend/src/layout/components/Licbar.vue
+56
-0
Topbar.vue
frontend/src/layout/components/Topbar.vue
+14
-2
index.js
frontend/src/layout/components/index.js
+1
-0
index.vue
frontend/src/layout/index.vue
+4
-2
permission.js
frontend/src/permission.js
+20
-2
getters.js
frontend/src/store/getters.js
+3
-1
index.js
frontend/src/store/index.js
+3
-2
lic.js
frontend/src/store/modules/lic.js
+37
-0
user.js
frontend/src/store/modules/user.js
+23
-3
auth.js
frontend/src/utils/auth.js
+9
-0
formatUi.js
frontend/src/utils/formatUi.js
+7
-0
get-page-title.js
frontend/src/utils/get-page-title.js
+6
-1
index.vue
frontend/src/views/login/index.vue
+34
-5
UiSetting.vue
frontend/src/views/system/systemParamSettings/UiSetting.vue
+3
-1
vue.config.js
frontend/vue.config.js
+6
-6
没有找到文件。
backend/src/main/java/io/dataease/base/domain/License.java
0 → 100644
浏览文件 @
469aa684
package
io
.
dataease
.
base
.
domain
;
import
java.io.Serializable
;
import
java.util.Date
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
public
class
License
implements
Serializable
{
@ApiModelProperty
(
""
)
private
String
id
;
@ApiModelProperty
(
"更新时间"
)
private
Date
updateTime
;
@ApiModelProperty
(
"license"
)
private
String
license
;
@ApiModelProperty
(
"F2C License"
)
private
String
f2cLicense
;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table license
*
* @mbg.generated
*/
private
static
final
long
serialVersionUID
=
1L
;
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column license.id
*
* @return the value of license.id
*
* @mbg.generated
*/
public
String
getId
()
{
return
id
;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column license.id
*
* @param id the value for license.id
*
* @mbg.generated
*/
public
void
setId
(
String
id
)
{
this
.
id
=
id
==
null
?
null
:
id
.
trim
();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column license.update_time
*
* @return the value of license.update_time
*
* @mbg.generated
*/
public
Date
getUpdateTime
()
{
return
updateTime
;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column license.update_time
*
* @param updateTime the value for license.update_time
*
* @mbg.generated
*/
public
void
setUpdateTime
(
Date
updateTime
)
{
this
.
updateTime
=
updateTime
;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column license.license
*
* @return the value of license.license
*
* @mbg.generated
*/
public
String
getLicense
()
{
return
license
;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column license.license
*
* @param license the value for license.license
*
* @mbg.generated
*/
public
void
setLicense
(
String
license
)
{
this
.
license
=
license
==
null
?
null
:
license
.
trim
();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column license.f2c_license
*
* @return the value of license.f2c_license
*
* @mbg.generated
*/
public
String
getF2cLicense
()
{
return
f2cLicense
;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column license.f2c_license
*
* @param f2cLicense the value for license.f2c_license
*
* @mbg.generated
*/
public
void
setF2cLicense
(
String
f2cLicense
)
{
this
.
f2cLicense
=
f2cLicense
==
null
?
null
:
f2cLicense
.
trim
();
}
}
\ No newline at end of file
backend/src/main/java/io/dataease/base/domain/LicenseExample.java
0 → 100644
浏览文件 @
469aa684
差异被折叠。
点击展开。
backend/src/main/java/io/dataease/base/mapper/LicenseMapper.java
0 → 100644
浏览文件 @
469aa684
package
io
.
dataease
.
base
.
mapper
;
import
io.dataease.base.domain.License
;
import
io.dataease.base.domain.LicenseExample
;
import
java.util.List
;
import
org.apache.ibatis.annotations.Param
;
public
interface
LicenseMapper
{
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table license
*
* @mbg.generated
*/
long
countByExample
(
LicenseExample
example
);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table license
*
* @mbg.generated
*/
int
deleteByExample
(
LicenseExample
example
);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table license
*
* @mbg.generated
*/
int
deleteByPrimaryKey
(
String
id
);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table license
*
* @mbg.generated
*/
int
insert
(
License
record
);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table license
*
* @mbg.generated
*/
int
insertSelective
(
License
record
);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table license
*
* @mbg.generated
*/
List
<
License
>
selectByExample
(
LicenseExample
example
);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table license
*
* @mbg.generated
*/
License
selectByPrimaryKey
(
String
id
);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table license
*
* @mbg.generated
*/
int
updateByExampleSelective
(
@Param
(
"record"
)
License
record
,
@Param
(
"example"
)
LicenseExample
example
);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table license
*
* @mbg.generated
*/
int
updateByExample
(
@Param
(
"record"
)
License
record
,
@Param
(
"example"
)
LicenseExample
example
);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table license
*
* @mbg.generated
*/
int
updateByPrimaryKeySelective
(
License
record
);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table license
*
* @mbg.generated
*/
int
updateByPrimaryKey
(
License
record
);
}
\ No newline at end of file
backend/src/main/java/io/dataease/base/mapper/LicenseMapper.xml
0 → 100644
浏览文件 @
469aa684
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"io.dataease.base.mapper.LicenseMapper"
>
<resultMap
id=
"BaseResultMap"
type=
"io.dataease.base.domain.License"
>
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
<id
column=
"id"
jdbcType=
"VARCHAR"
property=
"id"
/>
<result
column=
"update_time"
jdbcType=
"TIMESTAMP"
property=
"updateTime"
/>
<result
column=
"license"
jdbcType=
"VARCHAR"
property=
"license"
/>
<result
column=
"f2c_license"
jdbcType=
"VARCHAR"
property=
"f2cLicense"
/>
</resultMap>
<sql
id=
"Example_Where_Clause"
>
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
<where>
<foreach
collection=
"oredCriteria"
item=
"criteria"
separator=
"or"
>
<if
test=
"criteria.valid"
>
<trim
prefix=
"("
prefixOverrides=
"and"
suffix=
")"
>
<foreach
collection=
"criteria.criteria"
item=
"criterion"
>
<choose>
<when
test=
"criterion.noValue"
>
and ${criterion.condition}
</when>
<when
test=
"criterion.singleValue"
>
and ${criterion.condition} #{criterion.value}
</when>
<when
test=
"criterion.betweenValue"
>
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when
test=
"criterion.listValue"
>
and ${criterion.condition}
<foreach
close=
")"
collection=
"criterion.value"
item=
"listItem"
open=
"("
separator=
","
>
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql
id=
"Update_By_Example_Where_Clause"
>
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
<where>
<foreach
collection=
"example.oredCriteria"
item=
"criteria"
separator=
"or"
>
<if
test=
"criteria.valid"
>
<trim
prefix=
"("
prefixOverrides=
"and"
suffix=
")"
>
<foreach
collection=
"criteria.criteria"
item=
"criterion"
>
<choose>
<when
test=
"criterion.noValue"
>
and ${criterion.condition}
</when>
<when
test=
"criterion.singleValue"
>
and ${criterion.condition} #{criterion.value}
</when>
<when
test=
"criterion.betweenValue"
>
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when
test=
"criterion.listValue"
>
and ${criterion.condition}
<foreach
close=
")"
collection=
"criterion.value"
item=
"listItem"
open=
"("
separator=
","
>
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql
id=
"Base_Column_List"
>
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
id, update_time, license, f2c_license
</sql>
<select
id=
"selectByExample"
parameterType=
"io.dataease.base.domain.LicenseExample"
resultMap=
"BaseResultMap"
>
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
select
<if
test=
"distinct"
>
distinct
</if>
<include
refid=
"Base_Column_List"
/>
from license
<if
test=
"_parameter != null"
>
<include
refid=
"Example_Where_Clause"
/>
</if>
<if
test=
"orderByClause != null"
>
order by ${orderByClause}
</if>
</select>
<select
id=
"selectByPrimaryKey"
parameterType=
"java.lang.String"
resultMap=
"BaseResultMap"
>
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
select
<include
refid=
"Base_Column_List"
/>
from license
where id = #{id,jdbcType=VARCHAR}
</select>
<delete
id=
"deleteByPrimaryKey"
parameterType=
"java.lang.String"
>
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
delete from license
where id = #{id,jdbcType=VARCHAR}
</delete>
<delete
id=
"deleteByExample"
parameterType=
"io.dataease.base.domain.LicenseExample"
>
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
delete from license
<if
test=
"_parameter != null"
>
<include
refid=
"Example_Where_Clause"
/>
</if>
</delete>
<insert
id=
"insert"
parameterType=
"io.dataease.base.domain.License"
>
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
insert into license (id, update_time, license,
f2c_license)
values (#{id,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP}, #{license,jdbcType=VARCHAR},
#{f2cLicense,jdbcType=VARCHAR})
</insert>
<insert
id=
"insertSelective"
parameterType=
"io.dataease.base.domain.License"
>
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
insert into license
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"id != null"
>
id,
</if>
<if
test=
"updateTime != null"
>
update_time,
</if>
<if
test=
"license != null"
>
license,
</if>
<if
test=
"f2cLicense != null"
>
f2c_license,
</if>
</trim>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"id != null"
>
#{id,jdbcType=VARCHAR},
</if>
<if
test=
"updateTime != null"
>
#{updateTime,jdbcType=TIMESTAMP},
</if>
<if
test=
"license != null"
>
#{license,jdbcType=VARCHAR},
</if>
<if
test=
"f2cLicense != null"
>
#{f2cLicense,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<select
id=
"countByExample"
parameterType=
"io.dataease.base.domain.LicenseExample"
resultType=
"java.lang.Long"
>
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
select count(*) from license
<if
test=
"_parameter != null"
>
<include
refid=
"Example_Where_Clause"
/>
</if>
</select>
<update
id=
"updateByExampleSelective"
parameterType=
"map"
>
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
update license
<set>
<if
test=
"record.id != null"
>
id = #{record.id,jdbcType=VARCHAR},
</if>
<if
test=
"record.updateTime != null"
>
update_time = #{record.updateTime,jdbcType=TIMESTAMP},
</if>
<if
test=
"record.license != null"
>
license = #{record.license,jdbcType=VARCHAR},
</if>
<if
test=
"record.f2cLicense != null"
>
f2c_license = #{record.f2cLicense,jdbcType=VARCHAR},
</if>
</set>
<if
test=
"_parameter != null"
>
<include
refid=
"Update_By_Example_Where_Clause"
/>
</if>
</update>
<update
id=
"updateByExample"
parameterType=
"map"
>
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
update license
set id = #{record.id,jdbcType=VARCHAR},
update_time = #{record.updateTime,jdbcType=TIMESTAMP},
license = #{record.license,jdbcType=VARCHAR},
f2c_license = #{record.f2cLicense,jdbcType=VARCHAR}
<if
test=
"_parameter != null"
>
<include
refid=
"Update_By_Example_Where_Clause"
/>
</if>
</update>
<update
id=
"updateByPrimaryKeySelective"
parameterType=
"io.dataease.base.domain.License"
>
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
update license
<set>
<if
test=
"updateTime != null"
>
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
<if
test=
"license != null"
>
license = #{license,jdbcType=VARCHAR},
</if>
<if
test=
"f2cLicense != null"
>
f2c_license = #{f2cLicense,jdbcType=VARCHAR},
</if>
</set>
where id = #{id,jdbcType=VARCHAR}
</update>
<update
id=
"updateByPrimaryKey"
parameterType=
"io.dataease.base.domain.License"
>
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
update license
set update_time = #{updateTime,jdbcType=TIMESTAMP},
license = #{license,jdbcType=VARCHAR},
f2c_license = #{f2cLicense,jdbcType=VARCHAR}
where id = #{id,jdbcType=VARCHAR}
</update>
</mapper>
\ No newline at end of file
backend/src/main/java/io/dataease/commons/license/DefaultLicenseService.java
0 → 100644
浏览文件 @
469aa684
package
io
.
dataease
.
commons
.
license
;
import
com.google.gson.Gson
;
import
io.dataease.base.domain.License
;
import
io.dataease.commons.exception.DEException
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Service
;
import
javax.annotation.Resource
;
import
java.io.BufferedReader
;
import
java.io.InputStreamReader
;
import
java.util.ArrayList
;
import
java.util.List
;
@Service
public
class
DefaultLicenseService
{
@Resource
private
InnerLicenseService
innerLicenseService
;
@Value
(
"${spring.application.name:null}"
)
private
String
moduleId
;
private
static
final
String
LICENSE_ID
=
"fit2cloud_license"
;
private
static
final
String
validatorUtil
=
"/usr/bin/validator"
;
private
static
final
String
product
=
"cmp"
;
private
static
final
String
[]
NO_PLU_LIMIT_MODULES
=
new
String
[]{
"dashboard"
,
"gateway"
};
public
F2CLicenseResponse
validateLicense
(
String
product
,
String
licenseKey
){
List
<
String
>
command
=
new
ArrayList
<
String
>();
StringBuilder
result
=
new
StringBuilder
();
command
.
add
(
validatorUtil
);
command
.
add
(
licenseKey
);
try
{
execCommand
(
result
,
command
);
F2CLicenseResponse
f2CLicenseResponse
=
new
Gson
().
fromJson
(
result
.
toString
(),
F2CLicenseResponse
.
class
);
if
(
f2CLicenseResponse
.
getStatus
()
!=
F2CLicenseResponse
.
Status
.
valid
){
return
f2CLicenseResponse
;
}
if
(!
StringUtils
.
equals
(
f2CLicenseResponse
.
getLicense
().
getProduct
(),
product
)){
f2CLicenseResponse
.
setStatus
(
F2CLicenseResponse
.
Status
.
invalid
);
f2CLicenseResponse
.
setLicense
(
null
);
f2CLicenseResponse
.
setMessage
(
"The license is unavailable for this product."
);
return
f2CLicenseResponse
;
}
// 检查每个模块的PLU限制
// if(!Arrays.asList(NO_PLU_LIMIT_MODULES).contains(moduleId)){
// AuthorizationUnit authorizationUnit= CommonBeanFactory.getBean(AuthorizationUnit.class);
// try{
// authorizationUnit.calculateAssets(f2CLicenseResponse.getLicense().getCount());
// return f2CLicenseResponse;
// }catch (Exception e){
// f2CLicenseResponse.setStatus(F2CLicenseResponse.Status.invalid);
// f2CLicenseResponse.setMessage(e.getMessage());
// }
// }
return
f2CLicenseResponse
;
}
catch
(
Exception
e
){
return
F2CLicenseResponse
.
invalid
(
e
.
getMessage
());
}
}
private
static
int
execCommand
(
StringBuilder
result
,
List
<
String
>
command
)
throws
Exception
{
ProcessBuilder
builder
=
new
ProcessBuilder
();
builder
.
command
(
command
);
Process
process
=
builder
.
start
();
BufferedReader
bufferedReader
=
new
BufferedReader
(
new
InputStreamReader
(
process
.
getInputStream
()));
String
line
=
null
;
while
((
line
=
bufferedReader
.
readLine
())
!=
null
){
result
.
append
(
line
).
append
(
"\n"
);
}
int
exitCode
=
process
.
waitFor
();
command
.
clear
();
return
exitCode
;
}
public
F2CLicenseResponse
validateLicense
()
{
try
{
License
license
=
readLicense
();
return
validateLicense
(
product
,
license
.
getLicense
());
}
catch
(
Exception
e
)
{
return
F2CLicenseResponse
.
invalid
(
e
.
getMessage
());
}
}
public
void
validateF2cLicense
(){
License
license
=
readLicense
();
F2CLicenseResponse
f2CLicenseResponse
=
validateLicense
(
product
,
license
.
getLicense
());
writeLicense
(
license
.
getLicense
(),
f2CLicenseResponse
);
}
public
F2CLicenseResponse
updateLicense
(
String
product
,
String
licenseKey
)
{
// 验证license
F2CLicenseResponse
response
=
validateLicense
(
product
,
licenseKey
);
if
(
response
.
getStatus
()
!=
F2CLicenseResponse
.
Status
.
valid
)
{
return
response
;
}
// 覆盖原license
writeLicense
(
licenseKey
,
response
);
return
response
;
}
// 从数据库读取License
public
License
readLicense
()
{
License
license
=
innerLicenseService
.
getLicense
(
LICENSE_ID
);
if
(
license
==
null
)
{
/*DEException.throwException(Translator.get("i18n_no_license_record"));*/
DEException
.
throwException
(
"i18n_no_license_record"
);
}
if
(
StringUtils
.
isBlank
(
license
.
getLicense
()))
{
DEException
.
throwException
(
"i18n_license_is_empty"
);
//F2CException.throwException(Translator.get("i18n_license_is_empty"));
}
return
license
;
}
// 创建或更新License
private
void
writeLicense
(
String
licenseKey
,
F2CLicenseResponse
response
)
{
if
(
StringUtils
.
isBlank
(
licenseKey
))
{
DEException
.
throwException
(
"i18n_license_is_empty"
);
}
License
license
=
new
License
();
license
.
setId
(
LICENSE_ID
);
license
.
setLicense
(
licenseKey
);
license
.
setF2cLicense
(
new
Gson
().
toJson
(
response
));
innerLicenseService
.
saveLicense
(
license
);
}
}
backend/src/main/java/io/dataease/commons/license/F2CLicense.java
0 → 100644
浏览文件 @
469aa684
package
io
.
dataease
.
commons
.
license
;
public
class
F2CLicense
{
private
String
corporation
;
private
String
expired
;
private
String
licenseVersion
;
private
String
product
;
private
Long
generateTime
;
private
String
edition
;
private
Long
count
;
public
String
getCorporation
()
{
return
corporation
;
}
public
void
setCorporation
(
String
corporation
)
{
this
.
corporation
=
corporation
;
}
public
String
getExpired
()
{
return
expired
;
}
public
void
setExpired
(
String
expired
)
{
this
.
expired
=
expired
;
}
public
String
getLicenseVersion
()
{
return
licenseVersion
;
}
public
void
setLicenseVersion
(
String
licenseVersion
)
{
this
.
licenseVersion
=
licenseVersion
;
}
public
String
getProduct
()
{
return
product
;
}
public
void
setProduct
(
String
product
)
{
this
.
product
=
product
;
}
public
Long
getGenerateTime
()
{
return
generateTime
;
}
public
void
setGenerateTime
(
Long
generateTime
)
{
this
.
generateTime
=
generateTime
;
}
public
String
getEdition
()
{
return
edition
;
}
public
void
setEdition
(
String
edition
)
{
this
.
edition
=
edition
;
}
public
Long
getCount
()
{
return
count
;
}
public
void
setCount
(
Long
count
)
{
this
.
count
=
count
;
}
}
\ No newline at end of file
backend/src/main/java/io/dataease/commons/license/F2CLicenseResponse.java
0 → 100644
浏览文件 @
469aa684
package
io
.
dataease
.
commons
.
license
;
public
class
F2CLicenseResponse
{
private
Status
status
;
private
F2CLicense
license
;
private
String
message
;
public
Status
getStatus
()
{
return
status
;
}
public
void
setStatus
(
Status
status
)
{
this
.
status
=
status
;
}
public
F2CLicense
getLicense
()
{
return
license
;
}
public
void
setLicense
(
F2CLicense
license
)
{
this
.
license
=
license
;
}
public
String
getMessage
()
{
return
message
;
}
public
void
setMessage
(
String
message
)
{
this
.
message
=
message
;
}
public
static
enum
Status
{
valid
,
invalid
,
expired
;
}
public
static
F2CLicenseResponse
invalid
(
String
a
)
{
F2CLicenseResponse
f2CLicenseResponse
=
new
F2CLicenseResponse
();
f2CLicenseResponse
.
setStatus
(
Status
.
invalid
);
f2CLicenseResponse
.
setLicense
(
null
);
f2CLicenseResponse
.
setMessage
(
a
);
return
f2CLicenseResponse
;
}
}
backend/src/main/java/io/dataease/commons/license/InnerLicenseService.java
0 → 100644
浏览文件 @
469aa684
package
io
.
dataease
.
commons
.
license
;
import
io.dataease.base.domain.License
;
import
io.dataease.base.mapper.LicenseMapper
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
javax.annotation.Resource
;
import
java.util.Date
;
@Service
@Transactional
(
rollbackFor
=
Exception
.
class
)
class
InnerLicenseService
{
@Resource
private
LicenseMapper
licenseMapper
;
boolean
existLicense
(
String
key
)
{
License
license
=
licenseMapper
.
selectByPrimaryKey
(
key
);
return
license
!=
null
;
}
License
getLicense
(
String
key
)
{
License
license
=
licenseMapper
.
selectByPrimaryKey
(
key
);
if
(
license
==
null
)
return
null
;
return
license
;
}
void
saveLicense
(
License
license
)
{
license
.
setUpdateTime
(
new
Date
());
if
(
existLicense
(
license
.
getId
()))
{
licenseMapper
.
updateByPrimaryKey
(
license
);
}
else
{
licenseMapper
.
insert
(
license
);
}
}
}
\ No newline at end of file
backend/src/main/java/io/dataease/controller/LicenseController.java
0 → 100644
浏览文件 @
469aa684
package
io
.
dataease
.
controller
;
import
io.dataease.commons.license.DefaultLicenseService
;
import
io.dataease.commons.license.F2CLicenseResponse
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
javax.annotation.Resource
;
@RestController
@RequestMapping
(
headers
=
"Accept=application/json"
)
public
class
LicenseController
{
@Value
(
"${dataease.need_validate_lic:true}"
)
private
Boolean
need_validate_lic
;
@Resource
private
DefaultLicenseService
defaultLicenseService
;
@GetMapping
(
value
=
"anonymous/license/validate"
)
public
ResultHolder
validateLicense
()
throws
Exception
{
if
(!
need_validate_lic
)
{
return
ResultHolder
.
success
(
null
);
}
/* License license = defaultLicenseService.readLicense();
if(StringUtils.isEmpty(license.getF2cLicense())){
throw new Exception("Invalid License.");
}
F2CLicenseResponse f2CLicenseResponse = new Gson().fromJson(license.getF2cLicense(), F2CLicenseResponse.class);*/
F2CLicenseResponse
f2CLicenseResponse
=
defaultLicenseService
.
validateLicense
();
switch
(
f2CLicenseResponse
.
getStatus
())
{
case
valid:
return
ResultHolder
.
success
(
null
);
case
expired:
String
expired
=
f2CLicenseResponse
.
getLicense
().
getExpired
();
throw
new
Exception
(
"License has expired since "
+
expired
+
", please update license."
);
case
invalid:
throw
new
Exception
(
f2CLicenseResponse
.
getMessage
());
default
:
throw
new
Exception
(
"Invalid License."
);
}
}
}
backend/src/main/java/io/dataease/controller/SystemParameterController.java
浏览文件 @
469aa684
...
...
@@ -6,8 +6,13 @@ import io.dataease.commons.constants.RoleConstants;
import
io.dataease.dto.BaseSystemConfigDTO
;
import
io.dataease.dto.SystemParameterDTO
;
import
io.dataease.notice.domain.MailInfo
;
import
io.dataease.service.FileService
;
import
io.dataease.service.system.SystemParameterService
;
import
org.apache.shiro.authz.annotation.RequiresRoles
;
import
org.springframework.http.HttpHeaders
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.http.MediaType
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.multipart.MultipartFile
;
...
...
@@ -23,6 +28,9 @@ public class SystemParameterController {
@Resource
private
SystemParameterService
systemParameterService
;
@Resource
private
FileService
fileService
;
@PostMapping
(
"/edit/email"
)
public
void
editMail
(
@RequestBody
List
<
SystemParameter
>
systemParameter
)
{
systemParameterService
.
editMail
(
systemParameter
);
...
...
@@ -54,8 +62,16 @@ public class SystemParameterController {
return
systemParameterService
.
getSystemParameterInfo
(
ParamConstants
.
Classify
.
UI
.
getValue
());
}
@GetMapping
(
value
=
"/ui/image/{imageId}"
,
produces
=
{
MediaType
.
IMAGE_JPEG_VALUE
,
MediaType
.
IMAGE_PNG_VALUE
})
public
ResponseEntity
<
byte
[]>
image
(
@PathVariable
(
"imageId"
)
String
imageId
)
{
byte
[]
bytes
=
fileService
.
loadFileAsBytes
(
imageId
);
final
HttpHeaders
headers
=
new
HttpHeaders
();
headers
.
setContentType
(
MediaType
.
IMAGE_PNG
);
return
new
ResponseEntity
<>(
bytes
,
headers
,
HttpStatus
.
OK
);
}
@PostMapping
(
value
=
"/save/ui"
,
consumes
=
{
"multipart/form-data"
})
public
void
saveUIInfo
(
@RequestPart
(
"request"
)
Map
<
String
,
List
<
SystemParameterDTO
>>
systemParameterMap
,
@RequestPart
(
value
=
"files"
)
List
<
MultipartFile
>
bodyFiles
)
throws
IOException
{
public
void
saveUIInfo
(
@RequestPart
(
"request"
)
Map
<
String
,
List
<
SystemParameterDTO
>>
systemParameterMap
,
@RequestPart
(
value
=
"files"
,
required
=
false
)
List
<
MultipartFile
>
bodyFiles
)
throws
IOException
{
systemParameterService
.
saveUIInfo
(
systemParameterMap
,
bodyFiles
);
}
...
...
backend/src/main/java/io/dataease/service/system/SystemParameterService.java
浏览文件 @
469aa684
...
...
@@ -220,6 +220,7 @@ public class SystemParameterService {
public
void
saveUIInfo
(
Map
<
String
,
List
<
SystemParameterDTO
>>
request
,
List
<
MultipartFile
>
bodyFiles
)
throws
IOException
{
List
<
SystemParameterDTO
>
parameters
=
request
.
get
(
"systemParams"
);
if
(
null
!=
bodyFiles
)
for
(
MultipartFile
multipartFile
:
bodyFiles
)
{
if
(!
multipartFile
.
isEmpty
())
{
//防止添加非图片文件
...
...
backend/src/main/resources/db/migration/V8__system.sql
浏览文件 @
469aa684
...
...
@@ -271,3 +271,20 @@ BEGIN;
COMMIT
;
SET
FOREIGN_KEY_CHECKS
=
1
;
SET
NAMES
utf8mb4
;
SET
FOREIGN_KEY_CHECKS
=
0
;
-- ----------------------------
-- Table structure for license
-- ----------------------------
DROP
TABLE
IF
EXISTS
`license`
;
CREATE
TABLE
`license`
(
`id`
varchar
(
50
)
NOT
NULL
,
`update_time`
datetime
DEFAULT
NULL
COMMENT
'更新时间'
,
`license`
longtext
COMMENT
'license'
,
`f2c_license`
longtext
COMMENT
'F2C License'
,
PRIMARY
KEY
(
`id`
)
)
ENGINE
=
InnoDB
DEFAULT
CHARSET
=
utf8mb4
;
SET
FOREIGN_KEY_CHECKS
=
1
;
frontend/src/api/system/lic.js
0 → 100644
浏览文件 @
469aa684
import
request
from
'@/utils/request'
export
function
validateLic
()
{
return
request
({
url
:
'/anonymous/license/validate'
,
method
:
'get'
})
}
frontend/src/api/user.js
浏览文件 @
469aa684
...
...
@@ -29,3 +29,17 @@ export function validateUserName(data) {
data
})
}
export
function
getUIinfo
()
{
return
request
({
url
:
'/system/ui/info'
,
method
:
'get'
})
}
export
function
uiImage
(
imageId
)
{
return
request
({
url
:
'/display/file/'
+
imageId
,
method
:
'get'
})
}
frontend/src/lang/en.js
浏览文件 @
469aa684
...
...
@@ -74,7 +74,7 @@ export default {
},
login
:
{
title
:
'Login Form'
,
welcome
:
'welcome To
DataEase
'
,
welcome
:
'welcome To '
,
logIn
:
'Login'
,
username
:
'Username'
,
password
:
'Password'
,
...
...
frontend/src/lang/tw.js
浏览文件 @
469aa684
...
...
@@ -74,7 +74,7 @@ export default {
},
login
:
{
title
:
'系统登录'
,
welcome
:
'歡迎使用
DATAEASE
'
,
welcome
:
'歡迎使用'
,
logIn
:
'登錄'
,
username
:
'账号'
,
password
:
'密码'
,
...
...
frontend/src/lang/zh.js
浏览文件 @
469aa684
...
...
@@ -74,7 +74,7 @@ export default {
},
login
:
{
title
:
'系统登录'
,
welcome
:
'欢迎使用
DataEase
'
,
welcome
:
'欢迎使用'
,
logIn
:
'登录'
,
username
:
'账号'
,
password
:
'密码'
,
...
...
@@ -905,5 +905,12 @@ export default {
un_install
:
'卸载'
,
uninstall_confirm
:
'确定卸载该插件'
,
uninstall_cancel
:
'取消卸载插件'
},
display
:
{
logo
:
'头部系统logo'
,
loginLogo
:
'登录页面头部logo'
,
loginImage
:
'登录页面右侧图片'
,
loginTitle
:
'登录页面标题'
,
title
:
'系统名称'
}
}
frontend/src/layout/components/Licbar.vue
0 → 100644
浏览文件 @
469aa684
<
template
>
<div
v-if=
"!licstatus"
class=
"lic"
>
<strong>
{{
msg
}}
</strong>
</div>
</
template
>
<
script
>
export
default
{
name
:
'Licbar'
,
components
:
{
},
data
()
{
return
{
lic
:
true
,
msg
:
'Cannot run program "/usr/local/bin/validator_darwin_amd64": error=2, No such file or directory'
}
},
computed
:
{
theme
()
{
return
this
.
$store
.
state
.
settings
.
theme
},
licstatus
()
{
return
this
.
$store
.
state
.
lic
.
validate
}
},
mounted
()
{
// this.validate()
},
methods
:
{
// validate() {
// validateLic().then(res => {
// this.lic = true
// this.$store.dispatch('lic/setValidate', true)
// }).catch((e) => {
// this.msg = e.response.data.message
// this.lic = false
// this.$store.dispatch('lic/setValidate', false)
// })
// }
}
}
</
script
>
<
style
lang=
"scss"
scoped
>
.lic
{
height
:
24px
;
background-color
:
#c92100
;
color
:
#fff
;
text-align
:
center
;
padding
:
6px
11px
;
}
</
style
>
frontend/src/layout/components/Topbar.vue
浏览文件 @
469aa684
<
template
>
<div
class=
"top-nav"
:style=
"
{'background-color': theme}">
<div
class=
"log"
>
<img
src=
"@/assets/DataEase-white.png"
width=
"160"
alt=
""
style=
"padding-top: 8px;"
>
<img
v-if=
"!logoUrl"
src=
"@/assets/DataEase-white.png"
width=
"160"
alt=
""
style=
"padding-top: 8px;"
>
<img
v-else
:src=
"logoUrl"
width=
"160"
alt=
""
style=
"padding-top: 8px;"
>
</div>
<el-menu
:active-text-color=
"variables.topMenuActiveText"
...
...
@@ -68,6 +69,7 @@ import Doc from '@/components/Doc'
import
Screenfull
from
'@/components/Screenfull'
// import SizeSelect from '@/components/SizeSelect'
import
LangSelect
from
'@/components/LangSelect'
import
{
getSysUI
}
from
'@/utils/auth'
export
default
{
name
:
'Topbar'
,
components
:
{
...
...
@@ -79,9 +81,11 @@ export default {
},
data
()
{
return
{
uiInfo
:
null
,
logoUrl
:
null
}
},
computed
:
{
theme
()
{
return
this
.
$store
.
state
.
settings
.
theme
...
...
@@ -116,6 +120,14 @@ export default {
mounted
()
{
this
.
initCurrentRoutes
()
},
created
()
{
this
.
$store
.
dispatch
(
'user/getUI'
).
then
(()
=>
{
this
.
uiInfo
=
getSysUI
()
if
(
this
.
uiInfo
[
'ui.logo'
]
&&
this
.
uiInfo
[
'ui.logo'
].
paramValue
)
{
this
.
logoUrl
=
'/system/ui/image/'
+
this
.
uiInfo
[
'ui.logo'
].
paramValue
}
})
},
methods
:
{
// 通过当前路径找到二级菜单对应项,存到store,用来渲染左侧菜单
initCurrentRoutes
()
{
...
...
frontend/src/layout/components/index.js
浏览文件 @
469aa684
...
...
@@ -3,3 +3,4 @@ export { default as Sidebar } from './Sidebar'
export
{
default
as
Settings
}
from
'./Settings'
export
{
default
as
AppMain
}
from
'./AppMain'
export
{
default
as
Topbar
}
from
'./Topbar'
export
{
default
as
Licbar
}
from
'./Licbar'
frontend/src/layout/index.vue
浏览文件 @
469aa684
<
template
>
<div
:class=
"classObj"
class=
"app-wrapper"
>
<licbar
/>
<topbar
/>
<div
v-if=
"device==='mobile'&&sidebar.opened"
class=
"drawer-bg"
@
click=
"handleClickOutside"
/>
<sidebar
v-if=
"!sidebar.hide"
class=
"sidebar-container"
/>
...
...
@@ -17,7 +18,7 @@
<
script
>
import
RightPanel
from
'@/components/RightPanel'
import
{
Sidebar
,
Settings
,
AppMain
,
Topbar
}
from
'./components'
import
{
Sidebar
,
Settings
,
AppMain
,
Topbar
,
Licbar
}
from
'./components'
import
ResizeMixin
from
'./mixin/ResizeHandler'
export
default
{
...
...
@@ -27,7 +28,8 @@ export default {
Sidebar
,
Settings
,
AppMain
,
Topbar
Topbar
,
Licbar
},
mixins
:
[
ResizeMixin
],
computed
:
{
...
...
frontend/src/permission.js
浏览文件 @
469aa684
...
...
@@ -36,7 +36,11 @@ router.beforeEach(async(to, from, next) => {
if
(
store
.
getters
.
roles
.
length
===
0
)
{
// 判断当前用户是否已拉取完user_info信息
// get user info
store
.
dispatch
(
'user/getInfo'
).
then
(()
=>
{
loadMenus
(
next
,
to
)
store
.
dispatch
(
'lic/getLicInfo'
).
then
(()
=>
{
loadMenus
(
next
,
to
)
}).
catch
(()
=>
{
loadMenus
(
next
,
to
)
})
}).
catch
(()
=>
{
store
.
dispatch
(
'user/logout'
).
then
(()
=>
{
location
.
reload
()
// 为了重新实例化vue-router对象 避免bug
...
...
@@ -45,7 +49,11 @@ router.beforeEach(async(to, from, next) => {
}
else
if
(
store
.
getters
.
loadMenus
)
{
// 修改成false,防止死循环
store
.
dispatch
(
'user/updateLoadMenus'
)
loadMenus
(
next
,
to
)
store
.
dispatch
(
'lic/getLicInfo'
).
then
(()
=>
{
loadMenus
(
next
,
to
)
}).
catch
(()
=>
{
loadMenus
(
next
,
to
)
})
}
else
{
next
()
}
...
...
@@ -96,6 +104,9 @@ const hasPermission = (router, user_permissions) => {
if
(
router
.
permission
&&
!
user_permissions
.
includes
(
router
.
permission
))
{
return
false
}
if
(
!
filterLic
(
router
))
{
return
false
}
// 如果有字菜单 则 判断是否满足 ‘任意一个子菜单有权限’
if
(
router
.
children
&&
router
.
children
.
length
)
{
const
permissionChilds
=
router
.
children
.
filter
(
item
=>
hasPermission
(
item
,
user_permissions
))
...
...
@@ -104,6 +115,13 @@ const hasPermission = (router, user_permissions) => {
}
return
true
}
const
xpackMenuNames
=
[
'参数管理'
,
'插件管理'
]
const
filterLic
=
(
router
)
=>
{
if
(
xpackMenuNames
.
some
(
name
=>
name
===
router
.
name
)
&&
!
store
.
getters
.
validate
)
{
return
false
}
return
true
}
router
.
afterEach
(()
=>
{
// finish progress bar
NProgress
.
done
()
...
...
frontend/src/store/getters.js
浏览文件 @
469aa684
...
...
@@ -21,6 +21,8 @@ const getters = {
beanMap
:
state
=>
state
.
application
.
beanMap
,
leftWidgetMap
:
state
=>
state
.
application
.
leftWidgetMap
,
dialogWidgetMap
:
state
=>
state
.
application
.
dialogWidgetMap
,
drawWidgetMap
:
state
=>
state
.
application
.
drawWidgetMap
drawWidgetMap
:
state
=>
state
.
application
.
drawWidgetMap
,
validate
:
state
=>
state
.
lic
.
validate
,
uiInfo
:
state
=>
state
.
user
.
uiInfo
}
export
default
getters
frontend/src/store/index.js
浏览文件 @
469aa684
...
...
@@ -10,7 +10,7 @@ import chart from './modules/chart'
import
request
from
'./modules/request'
import
panel
from
'./modules/panel'
import
application
from
'./modules/application'
import
lic
from
'./modules/lic'
import
animation
from
'@/components/canvas/store/animation'
import
compose
from
'@/components/canvas/store/compose'
import
contextmenu
from
'@/components/canvas/store/contextmenu'
...
...
@@ -134,7 +134,8 @@ const data = {
chart
,
request
,
panel
,
application
application
,
lic
},
getters
}
...
...
frontend/src/store/modules/lic.js
0 → 100644
浏览文件 @
469aa684
import
{
validateLic
}
from
'@/api/system/lic'
const
state
=
{
validate
:
true
}
const
mutations
=
{
SET_VALIDATE
:
(
state
,
data
)
=>
{
state
.
validate
=
data
}
}
const
actions
=
{
setValidate
({
commit
},
data
)
{
commit
(
'SET_VALIDATE'
,
data
)
},
getLicInfo
({
commit
,
state
})
{
return
new
Promise
((
resolve
,
reject
)
=>
{
validateLic
().
then
(
response
=>
{
const
{
data
}
=
response
commit
(
'SET_VALIDATE'
,
true
)
resolve
(
data
)
}).
catch
(
error
=>
{
commit
(
'SET_VALIDATE'
,
false
)
reject
(
error
)
})
})
}
}
export
default
{
namespaced
:
true
,
state
,
mutations
,
actions
}
frontend/src/store/modules/user.js
浏览文件 @
469aa684
import
{
login
,
logout
,
getInfo
}
from
'@/api/user'
import
{
getToken
,
setToken
,
removeToken
}
from
'@/utils/auth'
import
{
login
,
logout
,
getInfo
,
getUIinfo
}
from
'@/api/user'
import
{
getToken
,
setToken
,
removeToken
,
setSysUI
}
from
'@/utils/auth'
import
{
resetRouter
}
from
'@/router'
import
{
format
}
from
'@/utils/formatUi'
const
getDefaultState
=
()
=>
{
return
{
...
...
@@ -12,7 +13,9 @@ const getDefaultState = () => {
// 第一次加载菜单时用到
loadMenus
:
false
,
// 当前用户拥有哪些资源权限
permissions
:
[]
permissions
:
[],
uiInfo
:
null
}
}
...
...
@@ -45,6 +48,9 @@ const mutations = {
},
SET_LOGIN_MSG
:
(
state
,
msg
)
=>
{
state
.
loginMsg
=
msg
},
SET_UI_INFO
:
(
state
,
info
)
=>
{
state
.
uiInfo
=
info
}
}
...
...
@@ -95,6 +101,20 @@ const actions = {
})
},
getUI
({
commit
,
state
})
{
return
new
Promise
((
resolve
,
reject
)
=>
{
getUIinfo
().
then
(
response
=>
{
const
{
data
}
=
response
const
uiInfo
=
format
(
data
)
commit
(
'SET_UI_INFO'
,
uiInfo
)
setSysUI
(
uiInfo
)
resolve
(
uiInfo
)
}).
catch
(
error
=>
{
reject
(
error
)
})
})
},
// user logout
logout
({
commit
,
state
})
{
return
new
Promise
((
resolve
,
reject
)
=>
{
...
...
frontend/src/utils/auth.js
浏览文件 @
469aa684
...
...
@@ -29,3 +29,12 @@ export function removeLinkToken() {
return
Cookies
.
remove
(
linkTokenKey
)
}
export
function
setSysUI
(
uiInfo
)
{
return
Cookies
.
set
(
'sysUiInfo'
,
uiInfo
?
JSON
.
stringify
(
uiInfo
)
:
null
)
}
export
function
getSysUI
()
{
const
json
=
Cookies
.
get
(
'sysUiInfo'
)
return
json
?
JSON
.
parse
(
json
)
:
null
}
frontend/src/utils/formatUi.js
0 → 100644
浏览文件 @
469aa684
export
function
format
(
uiLists
)
{
const
result
=
{}
uiLists
.
forEach
(
element
=>
{
result
[
element
[
'paramKey'
]]
=
element
})
return
result
}
frontend/src/utils/get-page-title.js
浏览文件 @
469aa684
import
defaultSettings
from
'@/settings'
import
{
getSysUI
}
from
'@/utils/auth'
cons
t
title
=
defaultSettings
.
title
||
'Vue Admin Template'
le
t
title
=
defaultSettings
.
title
||
'Vue Admin Template'
export
default
function
getPageTitle
(
pageTitle
)
{
const
uiInfo
=
getSysUI
()
if
(
uiInfo
[
'ui.title'
]
&&
uiInfo
[
'ui.title'
].
paramValue
)
{
title
=
uiInfo
[
'ui.title'
].
paramValue
}
if
(
pageTitle
)
{
return
`
${
pageTitle
}
-
${
title
}
`
}
...
...
frontend/src/views/login/index.vue
浏览文件 @
469aa684
...
...
@@ -5,14 +5,15 @@
<el-col
:span=
"12"
>
<el-form
ref=
"loginForm"
:model=
"loginForm"
:rules=
"loginRules"
size=
"default"
>
<div
class=
"login-logo"
>
<img
src=
"@/assets/DataEase-black.png"
alt=
""
>
<img
v-if=
"!loginLogoUrl"
src=
"@/assets/DataEase-black.png"
alt=
""
>
<img
v-else
:src=
"loginLogoUrl"
alt=
""
>
</div>
<div
class=
"login-title"
>
{{
$t
(
'login.title'
)
}}
{{
uiInfo
&&
uiInfo
[
'ui.loginTitle'
]
&&
uiInfo
[
'ui.loginTitle'
].
paramValue
||
$t
(
'login.title'
)
}}
</div>
<div
class=
"login-border"
/>
<div
class=
"login-welcome"
>
{{
$t
(
'login.welcome'
)
}}
{{
$t
(
'login.welcome'
)
+
(
uiInfo
&&
uiInfo
[
'ui.title'
]
&&
uiInfo
[
'ui.title'
].
paramValue
||
'DATAEASE'
)
}}
</div>
<div
class=
"login-form"
>
<el-form-item
prop=
"username"
>
...
...
@@ -41,7 +42,8 @@
</el-form>
</el-col>
<el-col
:span=
"12"
>
<div
class=
"login-image"
/>
<div
v-if=
"!loginImageUrl"
class=
"login-image"
/>
<div
v-else
class=
"login-image-de"
:style=
"
{background:'url(' + loginImageUrl + ') no-repeat', 'backgroundSize':'cover'}" />
</el-col>
</el-row>
</div>
...
...
@@ -52,6 +54,7 @@
import
{
encrypt
}
from
'@/utils/rsaEncrypt'
import
{
validateUserName
}
from
'@/api/user'
import
{
getSysUI
}
from
'@/utils/auth'
export
default
{
name
:
'Login'
,
data
()
{
...
...
@@ -90,7 +93,10 @@ export default {
},
loading
:
false
,
passwordType
:
'password'
,
redirect
:
undefined
redirect
:
undefined
,
uiInfo
:
null
,
loginImageUrl
:
null
,
loginLogoUrl
:
null
}
},
computed
:
{
...
...
@@ -106,6 +112,21 @@ export default {
immediate
:
true
}
},
created
()
{
this
.
$store
.
dispatch
(
'user/getUI'
).
then
(()
=>
{
// const uiLists = this.$store.state.user.uiInfo
// this.uiInfo = format(uiLists)
this
.
uiInfo
=
getSysUI
()
if
(
this
.
uiInfo
[
'ui.loginImage'
]
&&
this
.
uiInfo
[
'ui.loginImage'
].
paramValue
)
{
this
.
loginImageUrl
=
'/system/ui/image/'
+
this
.
uiInfo
[
'ui.loginImage'
].
paramValue
}
if
(
this
.
uiInfo
[
'ui.loginLogo'
]
&&
this
.
uiInfo
[
'ui.loginLogo'
].
paramValue
)
{
this
.
loginLogoUrl
=
'/system/ui/image/'
+
this
.
uiInfo
[
'ui.loginLogo'
].
paramValue
}
}).
catch
(
err
=>
{
console
.
error
(
err
)
})
},
methods
:
{
handleLogin
()
{
this
.
$refs
.
loginForm
.
validate
(
valid
=>
{
...
...
@@ -245,5 +266,13 @@ export default {
height
:
380px
;
}
}
.login-image-de
{
background-size
:
cover
;
width
:
100%
;
height
:
520px
;
@media
only
screen
and
(
max-width
:
1280px
)
{
height
:
380px
;
}
}
}
</
style
>
frontend/src/views/system/systemParamSettings/UiSetting.vue
浏览文件 @
469aa684
...
...
@@ -122,6 +122,7 @@
</el-form-item>
<!--favicon upload-->
<el-form-item
v-show=
"showfavicon"
v-if=
"param.paramKey==='ui.favicon'"
:label=
"$t('display.favicon')"
>
...
...
@@ -211,7 +212,8 @@ export default {
trigger
:
[
'change'
,
'blur'
]
}
]
}
},
showfavicon
:
false
}
},
created
()
{
...
...
frontend/vue.config.js
浏览文件 @
469aa684
...
...
@@ -14,12 +14,12 @@ module.exports = {
// 使用mock-server
devServer
:
{
port
:
port
,
//
proxy: {
//
'^(?!/login)': {
//
target: 'http://localhost:8081/',
//
ws: false
//
}
//
},
proxy
:
{
'^(?!/login)'
:
{
target
:
'http://localhost:8081/'
,
ws
:
false
}
},
open
:
true
,
overlay
:
{
warnings
:
false
,
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论