From cfff1b4062302cda7089136fb9b67aff10cf0991 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=A4=9A=E5=95=A6C=E6=A2=A6?= <15709267061@163.com>
Date: Thu, 26 Jun 2025 20:25:32 +0800
Subject: [PATCH] update
---
src/App.vue | 2 +-
src/api/system/index.js | 7 +++++++
src/pages.json | 7 +++++++
src/pages/fastInput/index.vue | 20 ++++++++++++++++++++
src/pinia/UserStore/index.js | 11 ++++++++++-
5 files changed, 45 insertions(+), 2 deletions(-)
create mode 100644 src/pages/fastInput/index.vue
diff --git a/src/App.vue b/src/App.vue
index 8d4f6eb..a911e20 100644
--- a/src/App.vue
+++ b/src/App.vue
@@ -8,7 +8,7 @@ export default {
onShow: function () {
// #ifndef MP-WEIXIN
const UserStore = useUserStore();
- if (!UserStore.isLogin && window.location.href.indexOf('/pages/register/index') < 0) {
+ if (!UserStore.isLogin && window.location.href.indexOf('/pages/register/index') < 0 && window.location.href.indexOf('/pages/fastInput/index') < 0) {
toPage('/pages/login/index');
}
// #endif
diff --git a/src/api/system/index.js b/src/api/system/index.js
index a561d0e..c69e0b5 100644
--- a/src/api/system/index.js
+++ b/src/api/system/index.js
@@ -411,6 +411,13 @@ const system = {
data: data
});
},
+ passLogin: async (id) => {
+ return request({
+ method: MethodsENUM.POST,
+ url: "/login/passLogin",
+ data: {id}
+ });
+ },
}
export default system;
diff --git a/src/pages.json b/src/pages.json
index ad674a3..b826efe 100644
--- a/src/pages.json
+++ b/src/pages.json
@@ -22,6 +22,13 @@
"navigationStyle": "custom"
}
},
+ {
+ "path": "pages/fastInput/index",
+ "style": {
+ "navigationBarTitleText": "快速进入",
+ "navigationStyle": "custom"
+ }
+ },
{
"path": "pages/myTask/index",
"style": {
diff --git a/src/pages/fastInput/index.vue b/src/pages/fastInput/index.vue
new file mode 100644
index 0000000..e3fa081
--- /dev/null
+++ b/src/pages/fastInput/index.vue
@@ -0,0 +1,20 @@
+
+
+
+
+
+
diff --git a/src/pinia/UserStore/index.js b/src/pinia/UserStore/index.js
index af3acd9..027516c 100644
--- a/src/pinia/UserStore/index.js
+++ b/src/pinia/UserStore/index.js
@@ -1,5 +1,5 @@
import {defineStore} from "pinia";
-import {ref, reactive} from "vue";
+import {reactive, ref} from "vue";
import {clearObject, toPage} from "../../utils/uils.js";
import Api from "../../api/index.js";
@@ -20,6 +20,14 @@ export const useUserStore = defineStore('UserStore', () => {
Object.assign(userInfo, data);
}
+ const passLogin = async (id) => {
+ const {data} = await Api.system.passLogin(id);
+ Object.assign(userInfo, data);
+ isLogin.value = true;
+ token.value = data.token;
+ await toPage('/pages/user/index');
+ }
+
const setToken = (value) => {
isLogin.value = true;
token.value = value;
@@ -32,6 +40,7 @@ export const useUserStore = defineStore('UserStore', () => {
logout,
setToken,
getUserInfo,
+ passLogin,
}
}, {
persist: {