acdr-ui/dist/dev/mp-weixin/service/userService.js
2024-10-01 09:15:35 +08:00

39 lines
1.0 KiB
JavaScript

"use strict";
var __async = (__this, __arguments, generator) => {
return new Promise((resolve, reject) => {
var fulfilled = (value) => {
try {
step(generator.next(value));
} catch (e) {
reject(e);
}
};
var rejected = (value) => {
try {
step(generator.throw(value));
} catch (e) {
reject(e);
}
};
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
step((generator = generator.apply(__this, __arguments)).next());
});
};
require("../store/index.js");
const utils_http = require("../utils/http.js");
const store_user = require("../store/user.js");
const getUserInfo = () => __async(exports, null, function* () {
try {
const userRes = yield utils_http.httpGet("/user/userinfo");
if (userRes.code === 200) {
store_user.useUserStore().setUserInfo(userRes.data);
return userRes.data;
}
return null;
} catch (e) {
console.log(e);
return null;
}
});
exports.getUserInfo = getUserInfo;