|
|
|
@ -1,7 +1,7 @@
|
|
|
|
|
import { makeAutoObservable, runInAction } from "mobx";
|
|
|
|
|
import { fetchJSON, postForm } from '@/utils/request';
|
|
|
|
|
import { HT_HOST } from "@/config";
|
|
|
|
|
import { prepareUrl } from '@/utils/commons';
|
|
|
|
|
import { isNotEmpty, prepareUrl } from '@/utils/commons';
|
|
|
|
|
|
|
|
|
|
const KEY_LOGIN_TOKEN = 'KEY_LOGIN_TOKEN';
|
|
|
|
|
|
|
|
|
@ -11,6 +11,9 @@ class Auth {
|
|
|
|
|
makeAutoObservable(this, { rootStore: false });
|
|
|
|
|
this.root = root;
|
|
|
|
|
this.login.token = root.getSession(KEY_LOGIN_TOKEN);
|
|
|
|
|
if (isNotEmpty(this.login.token)) {
|
|
|
|
|
this.fetchUserDetail();
|
|
|
|
|
}
|
|
|
|
|
setInterval(() => {
|
|
|
|
|
// console.info('Auth.check.token.');
|
|
|
|
|
}, 10000);
|
|
|
|
@ -34,7 +37,7 @@ class Auth {
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
fetchUserDetail(userId) {
|
|
|
|
|
fetchUserDetail() {
|
|
|
|
|
const fetchUrl = prepareUrl(HT_HOST + '/service-CooperateSOA/GetLinkManInfo')
|
|
|
|
|
.append('token', this.login.token)
|
|
|
|
|
.build();
|
|
|
|
|