整合前端仓库并保留提交历史
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
import type { LocationQueryRaw } from 'vue-router'
|
||||
import storage from '@/utils/storage'
|
||||
|
||||
export function useLogin() {
|
||||
/**
|
||||
* 设置登录返回页
|
||||
*/
|
||||
const setLoginBack = (route: LocationQueryRaw) => {
|
||||
storage.set({
|
||||
key: 'loginBack',
|
||||
data: {
|
||||
path: route.path,
|
||||
query: route.query
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 执行登录后跳转
|
||||
*/
|
||||
const handleLoginBack = (callbak:any) => {
|
||||
if(callbak) callbak()
|
||||
}
|
||||
|
||||
return {
|
||||
setLoginBack,
|
||||
handleLoginBack
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user