|
|
|
@ -1,5 +1,5 @@
|
|
|
|
|
import { makeAutoObservable, runInAction } from "mobx";
|
|
|
|
|
import { fetchJSON } from '@/utils/request';
|
|
|
|
|
import { fetchJSON, postForm } from '@/utils/request';
|
|
|
|
|
import { HT_HOST } from "@/config";
|
|
|
|
|
import { prepareUrl } from '@/utils/commons';
|
|
|
|
|
|
|
|
|
@ -10,13 +10,13 @@ class Auth {
|
|
|
|
|
this.root = root;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
valdateUserPassword(usr, pwd) {
|
|
|
|
|
const fetchUrl = prepareUrl(HT_HOST + '/service-Cooperate/Cooperate/Login')
|
|
|
|
|
.append('username', usr)
|
|
|
|
|
.append('password', pwd)
|
|
|
|
|
.build();
|
|
|
|
|
valdateUserPassword(usr, pwd) {
|
|
|
|
|
const formData = new FormData();
|
|
|
|
|
formData.append('username', usr);
|
|
|
|
|
formData.append('Password', pwd);
|
|
|
|
|
const postUrl = HT_HOST + '/service-CooperateSOA/Login';
|
|
|
|
|
|
|
|
|
|
return fetchJSON(fetchUrl)
|
|
|
|
|
return postForm(postUrl, formData)
|
|
|
|
|
.then(json => {
|
|
|
|
|
if (json.errcode == 0) {
|
|
|
|
|
return json.Result.WU_LMI_SN;
|
|
|
|
@ -27,7 +27,7 @@ class Auth {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
fetchUserDetail(userId) {
|
|
|
|
|
const fetchUrl = prepareUrl(HT_HOST + '/service-Cooperate/Cooperate/GetLinkManInfo')
|
|
|
|
|
const fetchUrl = prepareUrl(HT_HOST + '/service-CooperateSOA/GetLinkManInfo')
|
|
|
|
|
.append('LMI_SN', userId)
|
|
|
|
|
.build();
|
|
|
|
|
|
|
|
|
|