|
@@ -2,10 +2,10 @@
|
|
|
import { defineStore } from "pinia";
|
|
|
// 接口引用
|
|
|
// 公共方法引用
|
|
|
-import storage from "@/utils/storage";
|
|
|
+import { storage } from "@/utils/storage";
|
|
|
import common from "@/plugins/common.plugins.js";
|
|
|
|
|
|
-const stystemStores = defineStore(`${storage.get("nickName") + storage.get("tenantId")}_storage-stystem`, {
|
|
|
+const stystemStores = defineStore(`${storage.get("userId")}_storage-stystem`, {
|
|
|
state: () => ({
|
|
|
homeList: {
|
|
|
swiperBool: false,
|
|
@@ -15,52 +15,14 @@ const stystemStores = defineStore(`${storage.get("nickName") + storage.get("tena
|
|
|
|
|
|
cuIconList: [],
|
|
|
recentlyUsed: [],
|
|
|
+
|
|
|
+ userId: storage.get("userId"),//用户ID
|
|
|
},
|
|
|
- infoList: {
|
|
|
-
|
|
|
- },
|
|
|
+ infoList: {},
|
|
|
}),
|
|
|
- unistorage: true,
|
|
|
+ // unistorage: true,
|
|
|
actions: {
|
|
|
- /**
|
|
|
- * @九宫格页面跳转
|
|
|
- */
|
|
|
- navItemClick(item) {
|
|
|
- if (item.path) {
|
|
|
- item.sort = 0;
|
|
|
-
|
|
|
- this.homeList.recentlyUsed.push(item);
|
|
|
- this.homeList.recentlyUsed = common.uniq(this.homeList.recentlyUsed, "path");
|
|
|
- this.homeList.recentlyUsed.filter((el) => {
|
|
|
- if (el.path === item.path) {
|
|
|
- el.meta.icon = item.meta.icon;
|
|
|
- el.sort++;
|
|
|
- }
|
|
|
- });
|
|
|
- this.homeList.recentlyUsed = common.sortEvent(this.homeList.recentlyUsed, 1);
|
|
|
|
|
|
- if (item.path.indexOf("http") != -1) {
|
|
|
- uni.navigateTo({
|
|
|
- url: "/pages/common/webview/index?url=" + item.path,
|
|
|
- });
|
|
|
- } else {
|
|
|
- uni.navigateTo({
|
|
|
- url: item.path,
|
|
|
- });
|
|
|
- }
|
|
|
- } else {
|
|
|
- uni.showModal({
|
|
|
- title: "Tips",
|
|
|
- content: "此模块开发中~",
|
|
|
- showCancel: false,
|
|
|
- success: function (res) {
|
|
|
- if (res.confirm) {
|
|
|
- } else if (res.cancel) {
|
|
|
- }
|
|
|
- },
|
|
|
- });
|
|
|
- }
|
|
|
- }
|
|
|
},
|
|
|
});
|
|
|
|