acdr-ui/dist/dev/mp-weixin/service/userService.js

40 lines
1.1 KiB
JavaScript
Raw Normal View History

2024-09-19 07:20:14 +08:00
"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;
//# sourceMappingURL=userService.js.map