添加资源文件

This commit is contained in:
sgjj 2019-10-12 15:51:59 +08:00
parent 49c90cc0a0
commit 11717c3b6e
4 changed files with 20 additions and 4 deletions

View File

@ -55,6 +55,11 @@
<artifactId>ms-mpeople</artifactId> <artifactId>ms-mpeople</artifactId>
<version>1.0.10</version> <version>1.0.10</version>
</dependency> </dependency>
<dependency>
<groupId>net.mingsoft</groupId>
<artifactId>ms-upgrader</artifactId>
<version>1.0.11</version>
</dependency>
</dependencies> </dependencies>
<build> <build>
<resources> <resources>

View File

@ -1,7 +1,7 @@
(function() { (function() {
axios.defaults.timeout = 1000 * 60; axios.defaults.timeout = 1000 * 60;
axios.defaults.baseURL = ''; axios.defaults.baseURL = '';
//http request 拦截器 //http request 拦截器
axios.interceptors.request.use( axios.interceptors.request.use(
@ -28,7 +28,7 @@
axios.interceptors.response.use( axios.interceptors.response.use(
function(response) { function(response) {
//登录失效 //登录失效
if (response.data.bizCode == "401") { if (response.data.bizCode == "401" && ms.isLoginRedirect) {
window.parent.location.href = ms.base + "/" + ms.login + "?backurl=" + encodeURIComponent(window.parent.location.href); window.parent.location.href = ms.base + "/" + ms.login + "?backurl=" + encodeURIComponent(window.parent.location.href);
return; return;
} }
@ -79,8 +79,8 @@
} }
return new Promise(function(resolve, reject) { return new Promise(function(resolve, reject) {
ajax().get(url, { ajax().get(url, {
params: params params: params
}) })
.then(function(response) { .then(function(response) {
resolve(response.data); resolve(response.data);
}) })
@ -170,4 +170,5 @@
window.ms = {}; window.ms = {};
} }
window.ms.http = http; window.ms.http = http;
window.ms.isLoginRedirect = true;
}()); }());

View File

@ -20,6 +20,15 @@
log(e.message); log(e.message);
} }
} }
//树形数据组织
function treeData (source, id, parentId, children) {
let cloneData = JSON.parse(JSON.stringify(source))
return cloneData.filter(father => {
let branchArr = cloneData.filter(child => father[id] == child[parentId]);
branchArr.length > 0 ? father[children] = branchArr : ''
return father[parentId] == 0 // 如果第一层不是parentId=0请自行修改
})
}
//日期处理 //日期处理
var date = { var date = {

File diff suppressed because one or more lines are too long