@tmsfe/tms-core 0.0.98 → 0.0.99
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/package.json +1 -1
- package/src/index-proxy.js +1 -1
- package/src/runtime/index.js +10 -0
package/package.json
CHANGED
package/src/index-proxy.js
CHANGED
|
@@ -66,7 +66,7 @@ const asyncFuncNames = [
|
|
|
66
66
|
// 这行是tms-ui的
|
|
67
67
|
'showDrawer', 'hideDrawer', 'showModal', 'hideModal',
|
|
68
68
|
// 这行是runtime的
|
|
69
|
-
'getPhone', 'registerPhone', 'login', 'getLoginInfo', 'getOpenId', 'getMycarPubOpenId', 'getSinanPubOpenId',
|
|
69
|
+
'getPhone', 'registerPhone', 'login', 'checkLogin', 'getLoginInfo', 'getOpenId', 'getMycarPubOpenId', 'getSinanPubOpenId',
|
|
70
70
|
// tms-core
|
|
71
71
|
'setAuthInfo', 'getConfig', 'getApolloConfig', 'navigateToWebview', 'callCloudFunc', 'getEncryptUserInfo',
|
|
72
72
|
'setUserLocation', 'getUserLocation', 'getMpOpenId', 'getOuterOpenId',
|
package/src/runtime/index.js
CHANGED
|
@@ -47,6 +47,15 @@ const loginInfoPromise = new Promise(resolver => __resolver__.getLoginInfo = res
|
|
|
47
47
|
*/
|
|
48
48
|
const getLoginInfo = () => loginInfoPromise;
|
|
49
49
|
|
|
50
|
+
/**
|
|
51
|
+
* @public
|
|
52
|
+
* @description 获取用户userId等登录信息
|
|
53
|
+
* @param autoLogin 未登录时是否自动登录(小程序中启动时就已登录,该参数用于uniapp的h5页面)
|
|
54
|
+
*/
|
|
55
|
+
const checkLogin = (autoLogin = false) => {
|
|
56
|
+
// uniapp的h5会覆盖checkLogin函数实现检查和自动登录功能
|
|
57
|
+
return getLoginInfo().then(() => true);
|
|
58
|
+
};
|
|
50
59
|
|
|
51
60
|
/**
|
|
52
61
|
* tms.getCarManager 用户获取小程序统一维护的车信息管理器
|
|
@@ -226,6 +235,7 @@ const api = {
|
|
|
226
235
|
getPhone,
|
|
227
236
|
registerPhone,
|
|
228
237
|
login,
|
|
238
|
+
checkLogin,
|
|
229
239
|
getLoginInfo,
|
|
230
240
|
getOpenId,
|
|
231
241
|
getMycarPubOpenId,
|