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: {