Skip to content

Commit

Permalink
Merge pull request #845 from WeBankBlockchain/dev
Browse files Browse the repository at this point in the history
fix web of front 1.5.5
  • Loading branch information
CodingCattwo authored Apr 19, 2023
2 parents 45a05f8 + f9e016f commit b9267e7
Show file tree
Hide file tree
Showing 18 changed files with 216 additions and 183 deletions.
31 changes: 31 additions & 0 deletions src/main/java/com/webank/webase/front/util/JsonUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,21 @@
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.SerializationFeature;
import com.fasterxml.jackson.datatype.jdk8.Jdk8Module;
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateDeserializer;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalTimeDeserializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateSerializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalTimeSerializer;
import com.fasterxml.jackson.module.paramnames.ParameterNamesModule;
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.LocalTime;
import java.time.format.DateTimeFormatter;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;

Expand All @@ -26,6 +39,8 @@
@Slf4j
public class JsonUtils {
private static final String STANDARD_FORMAT = "yyyy-MM-dd HH:mm:ss";
public static final String DEFAULT_DATE_FORMAT = "yyyy-MM-dd";
public static final String DEFAULT_TIME_FORMAT = "HH:mm:ss";
/**
* 设置一些通用的属性
*/
Expand All @@ -45,6 +60,22 @@ public class JsonUtils {
objectMapper.configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, false);
// date format
objectMapper.setDateFormat(new SimpleDateFormat(STANDARD_FORMAT));
// LocalDate format
JavaTimeModule javaTimeModule = new JavaTimeModule();
javaTimeModule.addSerializer(LocalDateTime.class, new LocalDateTimeSerializer(
DateTimeFormatter.ofPattern(STANDARD_FORMAT)));
javaTimeModule.addSerializer(LocalDate.class,
new LocalDateSerializer(DateTimeFormatter.ofPattern(DEFAULT_DATE_FORMAT)));
javaTimeModule.addSerializer(LocalTime.class,
new LocalTimeSerializer(DateTimeFormatter.ofPattern(DEFAULT_TIME_FORMAT)));
javaTimeModule.addDeserializer(LocalDateTime.class, new LocalDateTimeDeserializer(
DateTimeFormatter.ofPattern(STANDARD_FORMAT)));
javaTimeModule.addDeserializer(LocalDate.class,
new LocalDateDeserializer(DateTimeFormatter.ofPattern(DEFAULT_DATE_FORMAT)));
javaTimeModule.addDeserializer(LocalTime.class,
new LocalTimeDeserializer(DateTimeFormatter.ofPattern(DEFAULT_TIME_FORMAT)));
objectMapper.registerModule(javaTimeModule).registerModule(new ParameterNamesModule())
.registerModule(new Jdk8Module());
return objectMapper;
});

Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/static/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
vertical-align: -0.15em;
fill: currentColor;
overflow: hidden;
}</style></head><body><body><div id=app style="height: 100% !important;"></div><script type=text/javascript src=./static/js/0.9ced0b292ec03ed1744c.js></script><script type=text/javascript src=./static/js/3.34a08117298a8ed8fafb.js></script><script type=text/javascript src=./static/js/runtime.fb27fb486bbce2be0182.js></script><script type=text/javascript src=./static/js/5.4fd886a4fb01bd5c33e2.js></script></body><script>if (self == top) {
}</style></head><body><body><div id=app style="height: 100% !important;"></div><script type=text/javascript src=./static/js/0.72a8638be3f2578f2c89.js></script><script type=text/javascript src=./static/js/3.c3f8a26693a51e8f4a0e.js></script><script type=text/javascript src=./static/js/runtime.6d624c115cb59024f6fe.js></script><script type=text/javascript src=./static/js/5.4fd886a4fb01bd5c33e2.js></script></body><script>if (self == top) {
var antiClickjack = document.getElementById("antiClickjack");
antiClickjack.parentNode.removeChild(antiClickjack);
} else {
Expand Down
59 changes: 59 additions & 0 deletions src/main/resources/static/static/js/0.72a8638be3f2578f2c89.js

Large diffs are not rendered by default.

Binary file not shown.
59 changes: 0 additions & 59 deletions src/main/resources/static/static/js/0.9ced0b292ec03ed1744c.js

This file was deleted.

Binary file not shown.

This file was deleted.

Binary file not shown.

Large diffs are not rendered by default.

Binary file not shown.
14 changes: 14 additions & 0 deletions src/main/resources/static/static/js/6.72e85f85990d18eee042.js

Large diffs are not rendered by default.

Binary file not shown.
14 changes: 0 additions & 14 deletions src/main/resources/static/static/js/6.effadb4883a2d8821466.js

This file was deleted.

Binary file not shown.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

211 changes: 105 additions & 106 deletions web/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,125 +14,124 @@
* limitations under the License.
*/
<template>
<div id="app" class="web-font" v-loading='loading'>
<!-- <div v-if="!show" >页面加载中...</div> -->
<router-view v-if="show"></router-view>
</div>
<div id="app" class="web-font" v-loading='loading'>
<!-- <div v-if="!show" >页面加载中...</div> -->
<router-view v-if="show"></router-view>
</div>
</template>

<script>
import { VueLoading } from 'vue-loading-template'
import {
queryGroup
} from "@/util/api";
import { VueLoading } from "vue-loading-template";
import { queryGroup } from "@/util/api";
export default {
name: "App",
components: {
VueLoading
},
data() {
return {
group: null,
groupName: '',
groupList: [],
load: this.$root.load,
show: false,
loading: false,
userForm: {
password: ""
},
rules: {
password: [
{
required: true,
message: "请输入组织名称",
trigger: "blur"
},
{
min: 1,
max: 12,
message: "长度在 1 到 12 个字符",
trigger: "blur"
}
]
name: "App",
components: {
VueLoading,
},
data() {
return {
group: null,
groupName: "",
groupList: [],
load: this.$root.load,
show: false,
loading: false,
userForm: {
password: "",
},
rules: {
password: [
{
required: true,
message: "请输入组织名称",
trigger: "blur",
},
{
min: 1,
max: 12,
message: "长度在 1 到 12 个字符",
trigger: "blur",
},
],
},
};
},
mounted() {
this.getGroup();
console.log(this.$chooseLang(201014));
// window.addEventListener('click',function(e){
// console.log(e)
// })
},
methods: {
getGroup() {
this.loading = true;
queryGroup()
.then((res) => {
this.loading = false;
const { data, status, statusText } = res;
if (status === 200 && data && data.length) {
let arr = data.sort((a, b) => {
return a - b;
}),
list = [];
for (let i = 0; i < arr.length; i++) {
list.push({
group: arr[i],
groupName: `group${arr[i]}`,
});
}
};
},
mounted() {
this.getGroup();
// window.addEventListener('click',function(e){
// console.log(e)
// })
this.groupList = list;
if (!this.group) {
this.group = this.groupList[0].group;
this.groupName = this.groupList[0].groupName;
} else {
}
localStorage.setItem("groupName", this.groupName);
localStorage.setItem("groupId", this.group);
this.show = true;
localStorage.setItem("cluster", JSON.stringify(list));
} else {
this.show = true;
localStorage.setItem("groupName", "");
localStorage.setItem("groupId", "");
if (res.data.code) {
this.$message({
type: "error",
message: this.$chooseLang(res.data.code),
});
}
}
})
.catch((err) => {
console.log(err);
this.loading = false;
this.show = true;
localStorage.setItem("groupName", "");
localStorage.setItem("groupId", "");
this.$message({
type: "error",
message: err.data || this.$t("text.systemError"),
});
});
},
methods: {
getGroup() {
this.loading = true
queryGroup()
.then(res => {
this.loading = false
const { data, status, statusText } = res;
if (status === 200 && data && data.length) {
let arr = data.sort((a, b) => {
return a - b
}),
list = [];
for (let i = 0; i < arr.length; i++) {
list.push({
group: arr[i],
groupName: `group${arr[i]}`
});
}
this.groupList = list;
if (!this.group) {
this.group = this.groupList[0].group;
this.groupName = this.groupList[0].groupName;
} else {
}
localStorage.setItem("groupName", this.groupName)
localStorage.setItem('groupId', this.group);
this.show = true
localStorage.setItem("cluster", JSON.stringify(list));
} else {
this.show = true
localStorage.setItem("groupName", "")
localStorage.setItem('groupId', "");
if(res.data.code){
this.$message({
type: "error",
message: this.$chooseLang(res.data.code)
});
}
}
})
.catch(err => {
console.log(err)
this.loading = false
this.show = true
localStorage.setItem("groupName", "")
localStorage.setItem('groupId', "");
this.$message({
type: "error",
message: err.data || this.$t('text.systemError')
});
});
},
}
},
};
</script>

<style>
#app {
height: 100%;
margin: 0;
padding: 0;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
color: #2c3e50;
background-color: #20293c;
height: 100%;
margin: 0;
padding: 0;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
color: #2c3e50;
background-color: #20293c;
}
ul,
li {
list-style: none;
list-style: none;
}
</style>
2 changes: 1 addition & 1 deletion web/src/components/sendTransaction.vue
Original file line number Diff line number Diff line change
Expand Up @@ -652,7 +652,7 @@ export default {
this.creatUserNameVisible = false;
},
checkFunction(item) {
return (item.stateMutability==='view'||item.stateMutability==='cosntant'||item.stateMutability==='pure') ? false : true;
return (item.stateMutability==='view'||item.stateMutability==='constant'||item.stateMutability==='pure') ? false : true;
},
},
};
Expand Down
3 changes: 3 additions & 0 deletions web/src/views/chaincode/components/code.vue
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,8 @@ export default {
created() {},
beforeMount() {},
mounted: function () {
console.log(this.$chooseLang(201014))
this.initEditor();
Bus.$on("select", (data) => {
this.codeShow = true;
Expand Down Expand Up @@ -1084,6 +1086,7 @@ export default {
message: this.$chooseLang(res.data.code),
type: "error",
});
console.log(this.$chooseLang(res.data.code))
if (res.data.code === 201151||res.data.code === 201014) {
setTimeout(() => {
this.$notify({
Expand Down

0 comments on commit b9267e7

Please sign in to comment.