From 79545e4252d32c5a4b9690757f6e12beaf7a6843 Mon Sep 17 00:00:00 2001
From: gaoshp <291585735@qq.com>
Date: 星期一, 07 十月 2024 00:31:18 +0800
Subject: [PATCH] update
---
src/views/login/components/passwordForm.vue | 43 +++++++++++++++++++++++++++++--------------
1 files changed, 29 insertions(+), 14 deletions(-)
diff --git a/src/views/login/components/passwordForm.vue b/src/views/login/components/passwordForm.vue
index 380479c..49a4acc 100644
--- a/src/views/login/components/passwordForm.vue
+++ b/src/views/login/components/passwordForm.vue
@@ -18,13 +18,15 @@
</template>
<script>
+//import io from 'socket.io-client';
export default {
data() {
return {
+ socket: null,
userType: 'admin',
form: {
- user: "admin",
- password: "123456",
+ user: "",
+ password: "",
autologin: false
},
rules: {
@@ -65,8 +67,11 @@
grant_type: "password",
scope: "all"
}
+ var isToken = false;
await this.$HTTP.postJ("/api/blade-auth/oauth/token?" + this.$TOOL.qsStringify(data)).then(res => {
+ this.islogin = false;
if (res.user_id) {
+ isToken = true;
//鑾峰彇token
this.$TOOL.cookie.set("TOKEN", res.access_token, {
expires: this.form.autologin ? 24 * 60 * 60 : 0
@@ -76,15 +81,15 @@
res.dashboard = "0";
res.userId = "1";
this.$TOOL.data.set("USER_INFO", res);
- this.islogin = false;
} else {
this.$message({
showClose: true,
- message: res.error_description,
+ message: res.msg || res.error_description,
type: 'error'
});
}
})
+ if (!isToken) return;
//鑾峰彇鑿滃崟
await this.$HTTP.get("/api/blade-system/menu/routes?" + this.$TOOL.qsStringify({ "appCode": "CPS" })).then(res => {
if (res.data.length == 0) {
@@ -109,16 +114,14 @@
// 濡傛灉娌℃湁 children 灞炴�э紝璇存槑鏄渶鍚庝竴绾э紝娣诲姞 component 瀵硅薄
var len = clonedItem.path.length;
if (item.name == "浠诲姟璋冨害") {
- //clonedItem.component = clonedItem.path; //鏈塩omponent涓嶅彲浠ヤ娇鐢╥frame
+ clonedItem.origin = item.path;
+ clonedItem.component = "myiframe/urlPath"; //鏈塩omponent涓嶅彲浠ヤ娇鐢╥frame
+ clonedItem.path = "/myiframe/urlPath";
} else {
clonedItem.component = clonedItem.path.substring(1, len);
}
}
- if (item.name == "浠诲姟璋冨害") {
- clonedItem.meta = { title: clonedItem.name, icon: "el-icon-takeaway-box", type: "iframe" }
- } else {
- clonedItem.meta = { title: clonedItem.name, icon: "el-icon-takeaway-box", type: "menu" }
- }
+ clonedItem.meta = { title: clonedItem.name, icon: "el-icon-takeaway-box", type: "menu" }
return clonedItem;
});
}
@@ -133,15 +136,27 @@
item.path = "/dashboard";
item.parentId = item.id;
})
- transformedArray[0].path = "/home";
- transformedArray[0].children = resp.data;
+ transformedArray.unshift({
+ children: resp.data,
+ code: "desk",
+ component: "console/desk",
+ id: "001",
+ meta: {title:聽'棣栭〉',聽icon:聽'el-icon-takeaway-box',聽type:聽'menu'},
+ name: "棣栭〉",
+ path: "/home"
+ });
+ transformedArray.forEach((item,index)=>{
+ if(item.name == "浠〃鏉�") {
+ transformedArray.splice(1,index);
+ }
+ })
var obj = {
- dashboardGrid: ["welcome", "ver", "time", "progress", "echarts", "about"],
+ dashboardGrid: ["Access", "deskNotice", "Entrance"],
menu: transformedArray,
permissions: ["list.add", "list.edit", "list.delete", "user.add", "user.edit", "user.delete"]
}
this.$TOOL.data.set("MENU", obj.menu);
- console.log(obj.menu,289)
+ console.log(obj.menu, 'menu')
this.$TOOL.data.set("PERMISSIONS", obj.permissions)
this.$TOOL.data.set("DASHBOARDGRID", obj.dashboardGrid)
--
Gitblit v1.9.3