update
This commit is contained in:
@@ -8,7 +8,7 @@ export default {
|
|||||||
onShow: function () {
|
onShow: function () {
|
||||||
// #ifndef MP-WEIXIN
|
// #ifndef MP-WEIXIN
|
||||||
const UserStore = useUserStore();
|
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');
|
toPage('/pages/login/index');
|
||||||
}
|
}
|
||||||
// #endif
|
// #endif
|
||||||
|
|||||||
@@ -411,6 +411,13 @@ const system = {
|
|||||||
data: data
|
data: data
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
passLogin: async (id) => {
|
||||||
|
return request({
|
||||||
|
method: MethodsENUM.POST,
|
||||||
|
url: "/login/passLogin",
|
||||||
|
data: {id}
|
||||||
|
});
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
export default system;
|
export default system;
|
||||||
|
|||||||
@@ -22,6 +22,13 @@
|
|||||||
"navigationStyle": "custom"
|
"navigationStyle": "custom"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"path": "pages/fastInput/index",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "快速进入",
|
||||||
|
"navigationStyle": "custom"
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"path": "pages/myTask/index",
|
"path": "pages/myTask/index",
|
||||||
"style": {
|
"style": {
|
||||||
|
|||||||
20
src/pages/fastInput/index.vue
Normal file
20
src/pages/fastInput/index.vue
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
<script setup>
|
||||||
|
import {onLoad} from "@dcloudio/uni-app";
|
||||||
|
import AESCrypto from "../../utils/AESCrypto.js";
|
||||||
|
import {useUserStore} from "../../pinia/UserStore/index.js";
|
||||||
|
|
||||||
|
const UserStore = useUserStore();
|
||||||
|
|
||||||
|
onLoad((options) => {
|
||||||
|
const {context, iv} = options;
|
||||||
|
const res = AESCrypto.decrypt(context, iv);
|
||||||
|
UserStore.passLogin(res);
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
|
||||||
|
</style>
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
import {defineStore} from "pinia";
|
import {defineStore} from "pinia";
|
||||||
import {ref, reactive} from "vue";
|
import {reactive, ref} from "vue";
|
||||||
import {clearObject, toPage} from "../../utils/uils.js";
|
import {clearObject, toPage} from "../../utils/uils.js";
|
||||||
import Api from "../../api/index.js";
|
import Api from "../../api/index.js";
|
||||||
|
|
||||||
@@ -20,6 +20,14 @@ export const useUserStore = defineStore('UserStore', () => {
|
|||||||
Object.assign(userInfo, data);
|
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) => {
|
const setToken = (value) => {
|
||||||
isLogin.value = true;
|
isLogin.value = true;
|
||||||
token.value = value;
|
token.value = value;
|
||||||
@@ -32,6 +40,7 @@ export const useUserStore = defineStore('UserStore', () => {
|
|||||||
logout,
|
logout,
|
||||||
setToken,
|
setToken,
|
||||||
getUserInfo,
|
getUserInfo,
|
||||||
|
passLogin,
|
||||||
}
|
}
|
||||||
}, {
|
}, {
|
||||||
persist: {
|
persist: {
|
||||||
|
|||||||
Reference in New Issue
Block a user