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");
|
2024-10-01 09:15:35 +08:00
|
|
|
if (userRes.code === 200) {
|
2024-09-19 07:20:14 +08:00
|
|
|
store_user.useUserStore().setUserInfo(userRes.data);
|
|
|
|
return userRes.data;
|
|
|
|
}
|
|
|
|
return null;
|
|
|
|
} catch (e) {
|
|
|
|
console.log(e);
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
});
|
|
|
|
exports.getUserInfo = getUserInfo;
|