This commit is contained in:
parent
abf7531d5a
commit
40f4661cac
|
@ -2,7 +2,7 @@ import axios from "axios";
|
||||||
import { ElMessage } from "element-plus";
|
import { ElMessage } from "element-plus";
|
||||||
import tools from "@/utils/tools";
|
import tools from "@/utils/tools";
|
||||||
import router from "../router";
|
import router from "../router";
|
||||||
// axios.defaults.baseURL = 'https://jzzf.longyou.gov.cn:998/'
|
axios.defaults.baseURL = 'https://jzzf.longyou.gov.cn:998/'
|
||||||
axios.defaults.timeout = 120000;
|
axios.defaults.timeout = 120000;
|
||||||
|
|
||||||
// HTTP request 拦截器
|
// HTTP request 拦截器
|
||||||
|
|
|
@ -253,6 +253,25 @@ const getData = () => {
|
||||||
if (res.code == 200) {
|
if (res.code == 200) {
|
||||||
data.tableData = res.data;
|
data.tableData = res.data;
|
||||||
pagination.total = res.count;
|
pagination.total = res.count;
|
||||||
|
function maskName(name) {
|
||||||
|
if (name.length === 2) {
|
||||||
|
// 两个字的姓名,第二个字替换为 *
|
||||||
|
return name[0] + "*";
|
||||||
|
} else if (name.length > 2) {
|
||||||
|
// 三个字或更多的姓名,替换中间的字符
|
||||||
|
return (
|
||||||
|
name[0] + "*".repeat(name.length - 2) + name[name.length - 1]
|
||||||
|
);
|
||||||
|
}
|
||||||
|
return name; // 返回原名
|
||||||
|
}
|
||||||
|
data.tableData = data.tableData.map((item) => {
|
||||||
|
return {
|
||||||
|
...item,
|
||||||
|
xm: maskName(item.xm),
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
ElMessage.warning({ message: res.message });
|
ElMessage.warning({ message: res.message });
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue