From b013a5f1ebbf1f2bb4e6c5d7019e7f19722a228b Mon Sep 17 00:00:00 2001
From: zouyu <2723363702@qq.com>
Date: 星期二, 06 一月 2026 22:30:25 +0800
Subject: [PATCH] 代码调整9
---
src/views/tideLogin.vue | 4 ++--
src/store/modules/user.js | 11 ++++++-----
index.html | 2 +-
.env.production | 2 +-
src/utils/auth.js | 9 ++++++---
5 files changed, 16 insertions(+), 12 deletions(-)
diff --git a/.env.production b/.env.production
index b8edcc8..afc6d30 100644
--- a/.env.production
+++ b/.env.production
@@ -1,5 +1,5 @@
# 椤甸潰鏍囬
-VITE_APP_TITLE = MIS锛堢鐞嗕俊鎭郴缁燂級
+VITE_APP_TITLE =鑺-鐢熶骇绠℃帶绯荤粺
# 鐢熶骇鐜閰嶇疆
VITE_APP_ENV = 'production'
diff --git a/index.html b/index.html
index 5b7efd4..d0fab04 100644
--- a/index.html
+++ b/index.html
@@ -7,7 +7,7 @@
<meta name="renderer" content="webkit">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<link rel="icon" href="/favicon.ico">
- <title>MIS锛堢鐞嗕俊鎭郴缁燂級</title>
+ <title>鑺-鐢熶骇绠℃帶绯荤粺</title>
<!--[if lt IE 11]><script>window.location.href='/html/ie.html';</script><![endif]-->
<style>
html,
diff --git a/src/store/modules/user.js b/src/store/modules/user.js
index 1c0d1d2..dc0eefe 100644
--- a/src/store/modules/user.js
+++ b/src/store/modules/user.js
@@ -109,15 +109,16 @@
})
})
},
- TideLogin({ commit }, code) {
+ TideLogin( code) {
return new Promise((resolve, reject) => {
tideLogin(code)
.then((res) => {
setToken(res.token);
- commit("SET_TOKEN", res.token);
- Vue.prototype.uploadHeader = {
- Authorization: "Bearer " + res.token,
- };
+ this.token = res.token
+ // commit("SET_TOKEN", res.token);
+ // Vue.prototype.uploadHeader = {
+ // Authorization: "Bearer " + res.token,
+ // };
resolve();
})
.catch((error) => {
diff --git a/src/utils/auth.js b/src/utils/auth.js
index 88d7b6c..3817d17 100644
--- a/src/utils/auth.js
+++ b/src/utils/auth.js
@@ -3,13 +3,16 @@
const TokenKey = 'Admin-Token'
export function getToken() {
- return Cookies.get(TokenKey)
+ // return Cookies.get(TokenKey)
+ return sessionStorage.getItem(TokenKey)
}
export function setToken(token) {
- return Cookies.set(TokenKey, token)
+ // return Cookies.set(TokenKey, token)
+ return sessionStorage.setItem(TokenKey, token)
}
export function removeToken() {
- return Cookies.remove(TokenKey)
+ // return Cookies.remove(TokenKey)
+ return sessionStorage.removeItem(TokenKey)
}
diff --git a/src/views/tideLogin.vue b/src/views/tideLogin.vue
index a96165e..c9ae3d4 100644
--- a/src/views/tideLogin.vue
+++ b/src/views/tideLogin.vue
@@ -2,7 +2,7 @@
<div></div>
</template>
<script>
-import store from "@/store";
+import useUserStore from '@/store/modules/user'
export default {
data() {
return {}
@@ -13,7 +13,7 @@
computed: {},
methods: {
goLogin() {
- store.dispatch('TideLogin', {code : this.$route.query.code}).then(() => {
+ useUserStore().TideLogin({code : this.$route.query.code}).then(() => {
this.$router.push({ path: this.redirect || "/" }).catch(() => { });
})
}
--
Gitblit v1.9.3