forked from github/dataease
Merge branch 'dev' of github.com:dataease/dataease into dev
This commit is contained in:
commit
ddde405508
@ -39,7 +39,8 @@ public class F2CLinkFilter extends AnonymousFilter {
|
||||
panelLink.setPwd("dataease");
|
||||
pwd = panelLink.getPwd();
|
||||
}else {
|
||||
pwd = RsaUtil.decryptByPrivateKey(RsaProperties.privateKey, panelLink.getPwd());
|
||||
/* pwd = RsaUtil.decryptByPrivateKey(RsaProperties.privateKey, panelLink.getPwd()); */
|
||||
pwd = panelLink.getPwd();
|
||||
}
|
||||
return JWTUtils.verifyLink(link_token, id, pwd);
|
||||
}catch (Exception e) {
|
||||
|
@ -63,6 +63,7 @@ public class ShiroServiceImpl implements ShiroService {
|
||||
// filterChainDefinitionMap.put("/axios.map", ANON);
|
||||
|
||||
filterChainDefinitionMap.put("/api/auth/login", ANON);
|
||||
filterChainDefinitionMap.put("/api/auth/isPluginLoaded", ANON);
|
||||
filterChainDefinitionMap.put("/system/requestTimeOut", ANON);
|
||||
filterChainDefinitionMap.put("/api/auth/validateName", ANON);
|
||||
filterChainDefinitionMap.put("/api/auth/isOpenLdap", ANON);
|
||||
|
@ -1,7 +1,6 @@
|
||||
package io.dataease.controller.panel.server;
|
||||
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import io.dataease.base.domain.PanelLink;
|
||||
import io.dataease.controller.ResultHolder;
|
||||
import io.dataease.controller.panel.api.LinkApi;
|
||||
@ -10,7 +9,6 @@ import io.dataease.controller.request.panel.link.EnablePwdRequest;
|
||||
import io.dataease.controller.request.panel.link.LinkRequest;
|
||||
import io.dataease.controller.request.panel.link.OverTimeRequest;
|
||||
import io.dataease.controller.request.panel.link.PasswordRequest;
|
||||
import io.dataease.controller.request.panel.link.ValidateRequest;
|
||||
import io.dataease.dto.panel.link.GenerateDto;
|
||||
import io.dataease.dto.panel.link.ValidateDto;
|
||||
import io.dataease.service.chart.ChartViewService;
|
||||
@ -69,11 +67,12 @@ public class LinkServer implements LinkApi {
|
||||
public ValidateDto validate(@RequestBody Map<String, String> param) throws Exception{
|
||||
String link = param.get("link");
|
||||
String json = panelLinkService.decryptParam(link);
|
||||
Gson gson = new Gson();
|
||||
/* Gson gson = new Gson();
|
||||
|
||||
ValidateRequest request = gson.fromJson(json, ValidateRequest.class);
|
||||
ValidateRequest request = gson.fromJson(json, ValidateRequest.class); */
|
||||
ValidateDto dto = new ValidateDto();
|
||||
String resourceId = request.getResourceId();
|
||||
String resourceId = json;
|
||||
/* String resourceId = request.getResourceId(); */
|
||||
PanelLink one = panelLinkService.findOne(resourceId);
|
||||
dto.setResourceId(resourceId);
|
||||
if (ObjectUtils.isEmpty(one)){
|
||||
|
@ -116,18 +116,19 @@ public class PanelLinkService {
|
||||
}
|
||||
|
||||
private String buildLinkParam(String resourceId){
|
||||
Map<String,Object> map = new HashMap<>();
|
||||
/* Map<String,Object> map = new HashMap<>();
|
||||
map.put("resourceId", resourceId);
|
||||
map.put("time", System.currentTimeMillis());
|
||||
map.put("salt", salt);
|
||||
Gson gson = new Gson();
|
||||
String encrypt = encrypt(gson.toJson(map));
|
||||
String s = null;
|
||||
String encrypt = encrypt(gson.toJson(map)); */
|
||||
String encrypt = encrypt(resourceId);
|
||||
/* String s = null;
|
||||
try {
|
||||
s = RsaUtil.decryptByPrivateKey(RsaProperties.privateKey, encrypt);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
} */
|
||||
return encrypt;
|
||||
}
|
||||
private GenerateDto convertDto(PanelLink linl){
|
||||
@ -154,7 +155,8 @@ public class PanelLinkService {
|
||||
return false;
|
||||
}
|
||||
if (StringUtils.isEmpty(panelLink.getPwd())) return false;
|
||||
boolean verify = JWTUtils.verifyLink(token, panelLink.getResourceId(), decryptParam(panelLink.getPwd()));
|
||||
boolean verify = JWTUtils.verifyLink(token, panelLink.getResourceId(), panelLink.getPwd());
|
||||
/* boolean verify = JWTUtils.verifyLink(token, panelLink.getResourceId(), decryptParam(panelLink.getPwd())); */
|
||||
return verify;
|
||||
}
|
||||
|
||||
@ -167,10 +169,12 @@ public class PanelLinkService {
|
||||
}
|
||||
|
||||
public boolean validatePwd(PasswordRequest request) throws Exception {
|
||||
String password = decryptParam(request.getPassword());
|
||||
String password = request.getPassword();
|
||||
/* String password = decryptParam(request.getPassword()); */
|
||||
String resourceId = request.getResourceId();
|
||||
PanelLink one = findOne(resourceId);
|
||||
String pwd = decryptParam(one.getPwd());
|
||||
String pwd = one.getPwd();
|
||||
/* String pwd = decryptParam(one.getPwd()); */
|
||||
boolean pass = StringUtils.equals(pwd, password);
|
||||
if (pass){
|
||||
String token = JWTUtils.signLink(resourceId, password);
|
||||
|
@ -61,6 +61,7 @@ export default {
|
||||
methods: {
|
||||
onSubmit() {
|
||||
this.curComponent.hyperlinks = deepCopy(this.linkInfo)
|
||||
this.$store.state.styleChangeTimes++
|
||||
this.popoverClose()
|
||||
},
|
||||
onClose() {
|
||||
|
@ -347,6 +347,11 @@ export default {
|
||||
this.innerOpacity = this.styleInfo['opacity'] * 100
|
||||
}
|
||||
this.mainWidthOffset = document.getElementById('main-attr').offsetWidth - 50
|
||||
if (this.curComponent.type === 'v-text') {
|
||||
this.mainWidthOffset = 600
|
||||
} else if (this.curComponent.type === 'de-show-date') {
|
||||
this.mainWidthOffset = 600
|
||||
}
|
||||
// console.log('mainWidthOffset:' + this.mainWidthOffset)
|
||||
},
|
||||
attrShow(attr) {
|
||||
|
@ -2,31 +2,22 @@ import JSEncrypt from 'jsencrypt/bin/jsencrypt'
|
||||
|
||||
// 密钥对生成 http://web.chacuo.net/netrsakeypair
|
||||
|
||||
const publicKey = 'MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBANL378k3RiZHWx5AfJqdH9xRNBmD9wGD\n' +
|
||||
/* const publicKey = 'MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBANL378k3RiZHWx5AfJqdH9xRNBmD9wGD\n' +
|
||||
'2iRe41HdTNF8RUhNnHit5NpMNtGL0NPTSSpPjjI1kJfVorRvaQerUgkCAwEAAQ=='
|
||||
|
||||
const privateKey = 'MIIBUwIBADANBgkqhkiG9w0BAQEFAASCAT0wggE5AgEAAkEA0vfvyTdGJkdbHkB8\n' +
|
||||
'mp0f3FE0GYP3AYPaJF7jUd1M0XxFSE2ceK3k2kw20YvQ09NJKk+OMjWQl9WitG9p\n' +
|
||||
'B6tSCQIDAQABAkA2SimBrWC2/wvauBuYqjCFwLvYiRYqZKThUS3MZlebXJiLB+Ue\n' +
|
||||
'/gUifAAKIg1avttUZsHBHrop4qfJCwAI0+YRAiEA+W3NK/RaXtnRqmoUUkb59zsZ\n' +
|
||||
'UBLpvZgQPfj1MhyHDz0CIQDYhsAhPJ3mgS64NbUZmGWuuNKp5coY2GIj/zYDMJp6\n' +
|
||||
'vQIgUueLFXv/eZ1ekgz2Oi67MNCk5jeTF2BurZqNLR3MSmUCIFT3Q6uHMtsB9Eha\n' +
|
||||
'4u7hS31tj1UWE+D+ADzp59MGnoftAiBeHT7gDMuqeJHPL4b+kC+gzV4FGTfhR9q3\n' +
|
||||
'tTbklZkD2A=='
|
||||
*/
|
||||
|
||||
// 加密
|
||||
export function encrypt(txt) {
|
||||
let publicKey = localStorage.getItem("publicKey");
|
||||
const publicKey = localStorage.getItem('publicKey')
|
||||
const encryptor = new JSEncrypt()
|
||||
encryptor.setPublicKey(publicKey) // 设置公钥
|
||||
return encryptor.encrypt(txt) // 对需要加密的数据进行加密
|
||||
}
|
||||
|
||||
// 解密
|
||||
export function decrypt(txt) {
|
||||
/* export function decrypt(txt) {
|
||||
const encryptor = new JSEncrypt()
|
||||
encryptor.setPrivateKey(privateKey)
|
||||
return encryptor.decrypt(txt)
|
||||
}
|
||||
|
||||
} */
|
||||
|
||||
|
@ -60,7 +60,6 @@
|
||||
<script>
|
||||
|
||||
import { loadGenerate, setPwd, switchValid, switchEnablePwd, shortUrl, setOverTime } from '@/api/link'
|
||||
import { encrypt, decrypt } from '@/utils/rsaEncrypt'
|
||||
export default {
|
||||
|
||||
name: 'LinkGenerate',
|
||||
@ -120,7 +119,8 @@ export default {
|
||||
this.form.enablePwd = enablePwd
|
||||
this.form.uri = uri ? (this.origin + uri) : uri
|
||||
// 返回的密码是共钥加密后的 所以展示需要私钥解密一波
|
||||
pwd && (this.form.pwd = decrypt(pwd))
|
||||
pwd && (this.form.pwd = pwd)
|
||||
/* pwd && (this.form.pwd = decrypt(pwd)) */
|
||||
/* overTime && (this.form.overTime = overTime) */
|
||||
overTime && (this.$set(this.form, 'overTime', overTime))
|
||||
this.requestShort()
|
||||
@ -143,7 +143,8 @@ export default {
|
||||
const newPwd = this.createPwd()
|
||||
const param = {
|
||||
resourceId: this.resourceId,
|
||||
password: encrypt(newPwd)
|
||||
password: newPwd
|
||||
/* password: encrypt(newPwd) */
|
||||
}
|
||||
setPwd(param).then(res => {
|
||||
this.form.pwd = newPwd
|
||||
|
@ -38,7 +38,6 @@
|
||||
|
||||
<script>
|
||||
import { validatePwd } from '@/api/link'
|
||||
import { encrypt } from '@/utils/rsaEncrypt'
|
||||
|
||||
export default {
|
||||
name: 'LinkPwd',
|
||||
@ -89,7 +88,8 @@ export default {
|
||||
this.$refs.pwdForm.validate(valid => {
|
||||
if (!valid) return false
|
||||
const param = {
|
||||
password: encrypt(this.form.password),
|
||||
/* password: encrypt(this.form.password), */
|
||||
password: this.form.password,
|
||||
resourceId: this.resourceId
|
||||
}
|
||||
validatePwd(param).then(res => {
|
||||
|
@ -9,7 +9,7 @@ import { loadResource } from '@/api/link'
|
||||
import { uuid } from 'vue-uuid'
|
||||
import Preview from '@/components/canvas/components/Editor/Preview'
|
||||
import { getPanelAllLinkageInfo } from '@/api/panel/linkage'
|
||||
import {queryPanelJumpInfo} from "@/api/panel/linkJump";
|
||||
import { queryPanelJumpInfo } from '@/api/panel/linkJump'
|
||||
|
||||
export default {
|
||||
name: 'LinkView',
|
||||
|
@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<div class="login-background" :v-show="themeLoaded">
|
||||
<div v-show="contentShow" class="login-background">
|
||||
<div class="login-container">
|
||||
<el-row v-loading="loading" type="flex">
|
||||
<el-col :span="12">
|
||||
@ -64,12 +64,11 @@
|
||||
<script>
|
||||
|
||||
import { encrypt } from '@/utils/rsaEncrypt'
|
||||
import { ldapStatus, oidcStatus, getPublicKey } from '@/api/user'
|
||||
import { ldapStatus, oidcStatus, getPublicKey, pluginLoaded } from '@/api/user'
|
||||
import { getSysUI } from '@/utils/auth'
|
||||
import { initTheme } from '@/utils/ThemeUtil'
|
||||
import PluginCom from '@/views/system/plugin/PluginCom'
|
||||
import Cookies from 'js-cookie'
|
||||
import store from "@/store";
|
||||
export default {
|
||||
name: 'Login',
|
||||
components: { PluginCom },
|
||||
@ -92,7 +91,8 @@ export default {
|
||||
loginLogoUrl: null,
|
||||
axiosFinished: false,
|
||||
loginTypes: [0],
|
||||
themeLoaded: false
|
||||
isPluginLoaded: false,
|
||||
contentShow: false
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@ -109,8 +109,14 @@ export default {
|
||||
}
|
||||
},
|
||||
beforeCreate() {
|
||||
initTheme()
|
||||
this.themeLoaded = true
|
||||
pluginLoaded().then(res => {
|
||||
this.isPluginLoaded = res.success && res.data
|
||||
this.isPluginLoaded && initTheme()
|
||||
this.contentShow = true
|
||||
}).catch(() => {
|
||||
this.contentShow = true
|
||||
})
|
||||
|
||||
ldapStatus().then(res => {
|
||||
if (res.success && res.data) {
|
||||
this.loginTypes.push(1)
|
||||
@ -183,7 +189,7 @@ export default {
|
||||
password: encrypt(this.loginForm.password),
|
||||
loginType: this.loginForm.loginType
|
||||
}
|
||||
let publicKey = localStorage.getItem("publicKey");
|
||||
const publicKey = localStorage.getItem('publicKey')
|
||||
console.log(publicKey)
|
||||
this.$store.dispatch('user/login', user).then(() => {
|
||||
this.$router.push({ path: this.redirect || '/' })
|
||||
|
@ -12,7 +12,7 @@
|
||||
<el-radio v-model="panel.backgroundType" label="color" @change="onChangeType">{{ $t('chart.color') }}</el-radio>
|
||||
</el-col>
|
||||
<el-col :span="18">
|
||||
<el-color-picker v-model="panel.color" size="mini" style="cursor: pointer;z-index: 1004;" />
|
||||
<el-color-picker v-model="panel.color" size="mini" style="cursor: pointer;z-index: 1004;" @change="onChangeType"/>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row style="height: 60px;margin-top:10px;overflow: hidden">
|
||||
|
Loading…
Reference in New Issue
Block a user