已支付订单列表:where.payStatus = 1;
This commit is contained in:
+42
@@ -0,0 +1,42 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../common/vendor.js");
|
||||
const uni_modules_wsCommon_api_layout_index = require("../../uni_modules/ws-common/api/layout/index.js");
|
||||
const useUserStore = common_vendor.defineStore({
|
||||
id: "user",
|
||||
state: () => ({
|
||||
// 当前登录用户的信息
|
||||
info: null,
|
||||
// 当前登录用户的菜单
|
||||
menus: null,
|
||||
// 当前登录用户的权限
|
||||
authorities: [],
|
||||
// 当前登录用户的角色
|
||||
roles: []
|
||||
}),
|
||||
getters: {},
|
||||
actions: {
|
||||
/**
|
||||
* 请求用户信息、权限、角色、菜单
|
||||
*/
|
||||
async fetchUserInfo() {
|
||||
var _a, _b, _c;
|
||||
const result = await uni_modules_wsCommon_api_layout_index.getUserInfo().catch(() => {
|
||||
});
|
||||
if (!result) {
|
||||
return {};
|
||||
}
|
||||
this.info = result;
|
||||
this.authorities = ((_b = (_a = result.authorities) == null ? void 0 : _a.filter((d) => !!d.authority)) == null ? void 0 : _b.map((d) => d.authority)) ?? [];
|
||||
this.roles = ((_c = result.roles) == null ? void 0 : _c.map((d) => d.roleCode)) ?? [];
|
||||
this.menus = [];
|
||||
return result;
|
||||
},
|
||||
/**
|
||||
* 更新用户信息
|
||||
*/
|
||||
setInfo(value) {
|
||||
this.info = value;
|
||||
}
|
||||
}
|
||||
});
|
||||
exports.useUserStore = useUserStore;
|
||||
Reference in New Issue
Block a user