@indfnd/common-mobile 0.0.16 → 0.0.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +11 -0
- package/dist/ind-common-mobile.es.js +68 -24
- package/dist/ind-common-mobile.umd.cjs +19 -19
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,17 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
### [0.0.18](http://git.inspur.com/imp-ec/ind-front/ind-common-mobile-front/compare/v0.0.17...v0.0.18) (2024-04-17)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* 保留小数位数 ([96ab224](http://git.inspur.com/imp-ec/ind-front/ind-common-mobile-front/commit/96ab22400cbdd8532797732359ef21e43e900b39))
|
|
11
|
+
* 升级依赖 ([99fea61](http://git.inspur.com/imp-ec/ind-front/ind-common-mobile-front/commit/99fea61eb47003fbbc82cf21d5d5fd33527d5fe9))
|
|
12
|
+
* 移动端单点登录 ([c9f9344](http://git.inspur.com/imp-ec/ind-front/ind-common-mobile-front/commit/c9f9344e26c378890d75e14aaeda9fd3c2e3c651))
|
|
13
|
+
|
|
14
|
+
### [0.0.17](http://git.inspur.com/imp-ec/ind-front/ind-common-mobile-front/compare/v0.0.16...v0.0.17) (2024-04-13)
|
|
15
|
+
|
|
5
16
|
### [0.0.16](http://git.inspur.com/imp-ec/ind-front/ind-common-mobile-front/compare/v0.0.15...v0.0.16) (2024-04-11)
|
|
6
17
|
|
|
7
18
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { getQuarterNum, getHalfYearNum, getHalfYear, formatDate, checkIdCard, checkVehicleNo, checkPhone, getDictMapApi, axios, useConfig, getLocalStorage, getCaptchaURL, guid, setLocalStorage, clearSessionStorage, cryptor, listComTreeApi, config as config$1, getSessionStorage, getToken, setToken, loginApi, clearUserInfoCache, clearPermissionCache, logoutApi, getUserInfoCache,
|
|
1
|
+
import { getQuarterNum, getHalfYearNum, getHalfYear, formatDate, checkIdCard, checkVehicleNo, checkPhone, getDictMapApi, axios, useConfig, getLocalStorage, getCaptchaURL, guid, setLocalStorage, clearSessionStorage, cryptor, listComTreeApi, config as config$1, getSessionStorage, getToken, getUserInfoApi, setToken as setToken$1, loginApi, clearUserInfoCache, clearPermissionCache, logoutApi, getUserInfoCache, setUserInfoCache, setSessionStorage, getAppListApi, getPermissionCache, getPermissionApi, setPermissionCache, menuHistoryApi, addMenuCollectApi, removeMenuCollectApi } from "@indfnd/utils";
|
|
2
2
|
import { DropdownMenu as DropdownMenu$1, DropdownItem as DropdownItem$1, Message, LoadingBar, Spin } from "view-design";
|
|
3
3
|
import Vue$1 from "vue";
|
|
4
4
|
const name = "@indfnd/common-mobile";
|
|
5
|
-
const version$1 = "0.0.
|
|
5
|
+
const version$1 = "0.0.17";
|
|
6
6
|
const author = "huxuetong";
|
|
7
7
|
const publishConfig = {
|
|
8
8
|
registry: "https://registry.npmjs.org/"
|
|
@@ -52,7 +52,7 @@ const dependencies = {
|
|
|
52
52
|
"xlsx-populate": "^1.11.0"
|
|
53
53
|
};
|
|
54
54
|
const devDependencies = {
|
|
55
|
-
"@indfnd/utils": "^0.
|
|
55
|
+
"@indfnd/utils": "^0.1.4",
|
|
56
56
|
eslint: "^3.19.0",
|
|
57
57
|
"eslint-config-prettier": "^8.5.0",
|
|
58
58
|
"eslint-plugin-prettier": "^4.2.1",
|
|
@@ -6590,7 +6590,7 @@ var FormImpl = {
|
|
|
6590
6590
|
props: {
|
|
6591
6591
|
placeholder: `\u8BF7\u8F93\u5165\u6570\u5B57`,
|
|
6592
6592
|
...d.props,
|
|
6593
|
-
value:
|
|
6593
|
+
value: text,
|
|
6594
6594
|
disabled,
|
|
6595
6595
|
type: "number"
|
|
6596
6596
|
},
|
|
@@ -68970,27 +68970,47 @@ function addRouterGuards({ router, store: store2, microType, allowPermissionList
|
|
|
68970
68970
|
}
|
|
68971
68971
|
}
|
|
68972
68972
|
}
|
|
68973
|
-
|
|
68974
|
-
|
|
68975
|
-
|
|
68976
|
-
|
|
68977
|
-
|
|
68978
|
-
|
|
68979
|
-
|
|
68980
|
-
|
|
68981
|
-
|
|
68982
|
-
|
|
68983
|
-
|
|
68984
|
-
|
|
68985
|
-
|
|
68986
|
-
})
|
|
68987
|
-
|
|
68988
|
-
|
|
68989
|
-
|
|
68973
|
+
console.log("typeof window.Code", typeof window.Code);
|
|
68974
|
+
async function _renderRoutes() {
|
|
68975
|
+
if (!store2.state.user.userName) {
|
|
68976
|
+
Spin.show();
|
|
68977
|
+
try {
|
|
68978
|
+
await renderRoutes({
|
|
68979
|
+
router,
|
|
68980
|
+
store: store2,
|
|
68981
|
+
microType,
|
|
68982
|
+
allowPermissionList,
|
|
68983
|
+
routerOptionsBak
|
|
68984
|
+
});
|
|
68985
|
+
next2({ ...to, replace: true });
|
|
68986
|
+
} catch (error) {
|
|
68987
|
+
next2({ name: LOGIN_PAGE_NAME });
|
|
68988
|
+
}
|
|
68989
|
+
Spin.hide();
|
|
68990
|
+
} else {
|
|
68991
|
+
next2();
|
|
68992
|
+
}
|
|
68993
|
+
}
|
|
68994
|
+
if (typeof window.Code != "undefined") {
|
|
68995
|
+
if (!token) {
|
|
68996
|
+
token = await pluginLogin();
|
|
68997
|
+
store2.dispatch("loginSuccess", token);
|
|
68998
|
+
await _renderRoutes();
|
|
68999
|
+
} else {
|
|
69000
|
+
if (!await checkLogin()) {
|
|
69001
|
+
token = await pluginLogin();
|
|
69002
|
+
store2.dispatch("loginSuccess", token);
|
|
69003
|
+
}
|
|
69004
|
+
await _renderRoutes();
|
|
68990
69005
|
}
|
|
68991
|
-
Spin.hide();
|
|
68992
69006
|
} else {
|
|
68993
|
-
|
|
69007
|
+
if (!token && to.name !== LOGIN_PAGE_NAME) {
|
|
69008
|
+
next2({ name: LOGIN_PAGE_NAME });
|
|
69009
|
+
} else if (to.name === LOGIN_PAGE_NAME) {
|
|
69010
|
+
next2();
|
|
69011
|
+
} else {
|
|
69012
|
+
await _renderRoutes();
|
|
69013
|
+
}
|
|
68994
69014
|
}
|
|
68995
69015
|
});
|
|
68996
69016
|
router.afterEach((to) => {
|
|
@@ -68998,6 +69018,30 @@ function addRouterGuards({ router, store: store2, microType, allowPermissionList
|
|
|
68998
69018
|
window.scrollTo(0, 0);
|
|
68999
69019
|
});
|
|
69000
69020
|
}
|
|
69021
|
+
const pluginLogin = () => {
|
|
69022
|
+
return new Promise((resolve, reject) => {
|
|
69023
|
+
Code.postMessage("");
|
|
69024
|
+
window.getCode = function(res) {
|
|
69025
|
+
console.log("getCode res", res);
|
|
69026
|
+
axios.get("/ind-uc-ext-server/sso/ssoAppLogin?code=" + res).then((resp) => {
|
|
69027
|
+
setToken(resp.token);
|
|
69028
|
+
resolve(resp.token);
|
|
69029
|
+
}).catch((e) => {
|
|
69030
|
+
console.log("\u83B7\u53D6token\u5F02\u5E38", e);
|
|
69031
|
+
reject(0);
|
|
69032
|
+
});
|
|
69033
|
+
};
|
|
69034
|
+
});
|
|
69035
|
+
};
|
|
69036
|
+
const checkLogin = async () => {
|
|
69037
|
+
try {
|
|
69038
|
+
const resp = await getUserInfoApi();
|
|
69039
|
+
return resp.code == 1;
|
|
69040
|
+
} catch (e) {
|
|
69041
|
+
console.log("getLoginData e", e);
|
|
69042
|
+
return false;
|
|
69043
|
+
}
|
|
69044
|
+
};
|
|
69001
69045
|
const routerOptions = {
|
|
69002
69046
|
mode: "history",
|
|
69003
69047
|
base: "ind-mobile"
|
|
@@ -69021,7 +69065,7 @@ var user = {
|
|
|
69021
69065
|
},
|
|
69022
69066
|
setToken(state, token) {
|
|
69023
69067
|
state.token = token;
|
|
69024
|
-
setToken(token);
|
|
69068
|
+
setToken$1(token);
|
|
69025
69069
|
}
|
|
69026
69070
|
},
|
|
69027
69071
|
actions: {
|