refactor: folders
This commit is contained in:
parent
bdbe9b8483
commit
6664ae8f7b
@ -1,4 +1,4 @@
|
|||||||
import request from '@/utils/http'
|
import { request } from '@/utils'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
getUser: () => request.get('/user'),
|
getUser: () => request.get('/user'),
|
||||||
|
@ -18,7 +18,7 @@ import { defineComponent, h } from 'vue'
|
|||||||
import { useLoadingBar, useDialog, useMessage, useNotification } from 'naive-ui'
|
import { useLoadingBar, useDialog, useMessage, useNotification } from 'naive-ui'
|
||||||
import { useCssVar } from '@vueuse/core'
|
import { useCssVar } from '@vueuse/core'
|
||||||
import { kebabCase } from 'lodash-es'
|
import { kebabCase } from 'lodash-es'
|
||||||
import { setupMessage, setupDialog } from '@/utils/common/naiveTools'
|
import { setupMessage, setupDialog } from '@/utils'
|
||||||
import { naiveThemeOverrides } from '~/settings'
|
import { naiveThemeOverrides } from '~/settings'
|
||||||
|
|
||||||
function setupCssVar() {
|
function setupCssVar() {
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
import { renderIcon, renderCustomIcon } from '@/utils/icon'
|
import { renderIcon, renderCustomIcon } from '@/utils'
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
icon: {
|
icon: {
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { isNullOrWhitespace } from '@/utils/is'
|
import { isNullOrWhitespace } from '@/utils'
|
||||||
|
|
||||||
defineProps({
|
defineProps({
|
||||||
label: {
|
label: {
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { isNullOrWhitespace } from '@/utils/is'
|
import { isNullOrWhitespace } from '@/utils'
|
||||||
|
|
||||||
const ACTIONS = {
|
const ACTIONS = {
|
||||||
view: '查看',
|
view: '查看',
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { useAppStore } from '@/store/modules/app'
|
import { useAppStore } from '@/store'
|
||||||
import { useRouter } from 'vue-router'
|
import { useRouter } from 'vue-router'
|
||||||
const appStore = useAppStore()
|
const appStore = useAppStore()
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { renderCustomIcon, renderIcon } from '@/utils/icon'
|
import { renderCustomIcon, renderIcon } from '@/utils'
|
||||||
|
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { useAppStore } from '@/store/modules/app'
|
import { useAppStore } from '@/store'
|
||||||
|
|
||||||
const appStore = useAppStore()
|
const appStore = useAppStore()
|
||||||
</script>
|
</script>
|
||||||
|
@ -8,8 +8,8 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { useUserStore } from '@/store/modules/user'
|
import { useUserStore } from '@/store'
|
||||||
import { renderIcon } from '@/utils/icon'
|
import { renderIcon } from '@/utils'
|
||||||
|
|
||||||
const userStore = useUserStore()
|
const userStore = useUserStore()
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { useAppStore } from '@/store/modules/app'
|
import { useAppStore } from '@/store'
|
||||||
const title = import.meta.env.VITE_TITLE
|
const title = import.meta.env.VITE_TITLE
|
||||||
|
|
||||||
const appStore = useAppStore()
|
const appStore = useAppStore()
|
||||||
|
@ -12,11 +12,8 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { usePermissionStore } from '@/store/modules/permission'
|
import { usePermissionStore, useAppStore } from '@/store'
|
||||||
|
import { renderCustomIcon, renderIcon, isExternal } from '@/utils'
|
||||||
import { isExternal } from '@/utils/is'
|
|
||||||
import { useAppStore } from '@/store/modules/app'
|
|
||||||
import { renderCustomIcon, renderIcon } from '@/utils/icon'
|
|
||||||
|
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
const curRoute = useRoute()
|
const curRoute = useRoute()
|
||||||
|
@ -11,9 +11,8 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { useTagsStore } from '@/store/modules/tags'
|
import { useTagsStore, useAppStore } from '@/store'
|
||||||
import { renderIcon } from '@/utils/icon'
|
import { renderIcon } from '@/utils'
|
||||||
import { useAppStore } from '@/store/modules/app'
|
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
show: {
|
show: {
|
||||||
|
@ -24,7 +24,7 @@
|
|||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import ContextMenu from './ContextMenu.vue'
|
import ContextMenu from './ContextMenu.vue'
|
||||||
import { useTagsStore } from '@/store/modules/tags'
|
import { useTagsStore } from '@/store'
|
||||||
import ScrollX from '@/components/common/ScrollX.vue'
|
import ScrollX from '@/components/common/ScrollX.vue'
|
||||||
|
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
|
@ -30,7 +30,7 @@ import AppHeader from './components/header/index.vue'
|
|||||||
import SideBar from './components/sidebar/index.vue'
|
import SideBar from './components/sidebar/index.vue'
|
||||||
import AppMain from './components/AppMain.vue'
|
import AppMain from './components/AppMain.vue'
|
||||||
import AppTags from './components/tags/index.vue'
|
import AppTags from './components/tags/index.vue'
|
||||||
import { useAppStore } from '@/store/modules/app'
|
import { useAppStore } from '@/store'
|
||||||
import { header, tags } from '~/settings'
|
import { header, tags } from '~/settings'
|
||||||
|
|
||||||
const appStore = useAppStore()
|
const appStore = useAppStore()
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
|
/** 重置样式 */
|
||||||
import '@/styles/reset.css'
|
import '@/styles/reset.css'
|
||||||
import '@/styles/index.scss'
|
|
||||||
import 'uno.css'
|
import 'uno.css'
|
||||||
|
import '@/styles/global.scss'
|
||||||
import 'virtual:svg-icons-register'
|
import 'virtual:svg-icons-register'
|
||||||
|
|
||||||
import { createApp } from 'vue'
|
import { createApp } from 'vue'
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
import { getToken, refreshAccessToken } from '@/utils/token'
|
import { getToken, refreshAccessToken, isNullOrWhitespace } from '@/utils'
|
||||||
import { isNullOrWhitespace } from '@/utils/is'
|
|
||||||
|
|
||||||
const WHITE_LIST = ['/login', '/404']
|
const WHITE_LIST = ['/login', '/404']
|
||||||
export function createPermissionGuard(router) {
|
export function createPermissionGuard(router) {
|
||||||
|
@ -1,10 +1,8 @@
|
|||||||
import { createRouter, createWebHistory, createWebHashHistory } from 'vue-router'
|
import { createRouter, createWebHistory, createWebHashHistory } from 'vue-router'
|
||||||
import { setupRouterGuard } from './guard'
|
import { setupRouterGuard } from './guard'
|
||||||
import { basicRoutes as routes, EMPTY_ROUTE, NOT_FOUND_ROUTE } from './routes'
|
import { basicRoutes as routes, EMPTY_ROUTE, NOT_FOUND_ROUTE } from './routes'
|
||||||
import { getToken } from '@/utils/token'
|
import { getToken, isNullOrWhitespace } from '@/utils'
|
||||||
import { isNullOrWhitespace } from '@/utils/is'
|
import { useUserStore, usePermissionStore } from '@/store'
|
||||||
import { useUserStore } from '@/store/modules/user'
|
|
||||||
import { usePermissionStore } from '@/store/modules/permission'
|
|
||||||
|
|
||||||
const isHash = import.meta.env.VITE_USE_HASH === 'true'
|
const isHash = import.meta.env.VITE_USE_HASH === 'true'
|
||||||
export const router = createRouter({
|
export const router = createRouter({
|
||||||
|
@ -3,3 +3,5 @@ import { createPinia } from 'pinia'
|
|||||||
export function setupStore(app) {
|
export function setupStore(app) {
|
||||||
app.use(createPinia())
|
app.use(createPinia())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export * from './modules'
|
||||||
|
4
src/store/modules/index.js
Normal file
4
src/store/modules/index.js
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
export * from './app'
|
||||||
|
export * from './permission'
|
||||||
|
export * from './tags'
|
||||||
|
export * from './user'
|
@ -1,4 +1,4 @@
|
|||||||
import { sStorage } from '@/utils/cache'
|
import { sStorage } from '@/utils'
|
||||||
|
|
||||||
export const activeTag = sStorage.get('activeTag')
|
export const activeTag = sStorage.get('activeTag')
|
||||||
export const tags = sStorage.get('tags')
|
export const tags = sStorage.get('tags')
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import { defineStore } from 'pinia'
|
import { defineStore } from 'pinia'
|
||||||
import { activeTag, tags, WITHOUT_TAG_PATHS } from './helpers'
|
import { activeTag, tags, WITHOUT_TAG_PATHS } from './helpers'
|
||||||
import { router } from '@/router'
|
import { router } from '@/router'
|
||||||
import { sStorage } from '@/utils/cache'
|
import { sStorage } from '@/utils'
|
||||||
|
|
||||||
export const useTagsStore = defineStore('tag', {
|
export const useTagsStore = defineStore('tag', {
|
||||||
state() {
|
state() {
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
import { defineStore } from 'pinia'
|
import { defineStore } from 'pinia'
|
||||||
import { removeToken } from '@/utils/token'
|
import { removeToken, toLogin } from '@/utils'
|
||||||
import { toLogin } from '@/utils/auth'
|
|
||||||
import api from '@/api'
|
import api from '@/api'
|
||||||
|
|
||||||
export const useUserStore = defineStore('user', {
|
export const useUserStore = defineStore('user', {
|
@ -1,14 +1,16 @@
|
|||||||
html {
|
|
||||||
font-size: 4px; // * 1rem = 4px 方便unocss计算:在unocss中 1字体单位 = 0.25rem,相当于 1等份 = 1px
|
|
||||||
}
|
|
||||||
|
|
||||||
html,
|
html,
|
||||||
body {
|
body {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
background-color: #f2f2f2;
|
}
|
||||||
font-family: 'Encode Sans Condensed', sans-serif;
|
|
||||||
|
html {
|
||||||
|
font-size: 4px; // * 1rem = 4px 方便unocss计算:在unocss中 1字体单位 = 0.25rem,相当于 1等份 = 1px
|
||||||
|
}
|
||||||
|
|
||||||
|
body {
|
||||||
|
font-size: 16px;
|
||||||
}
|
}
|
||||||
|
|
||||||
#app {
|
#app {
|
||||||
@ -16,7 +18,7 @@ body {
|
|||||||
height: 100%;
|
height: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* router view transition fade-slide */
|
/* transition fade-slide */
|
||||||
.fade-slide-leave-active,
|
.fade-slide-leave-active,
|
||||||
.fade-slide-enter-active {
|
.fade-slide-enter-active {
|
||||||
transition: all 0.3s;
|
transition: all 0.3s;
|
||||||
@ -32,7 +34,6 @@ body {
|
|||||||
transform: translateX(30px);
|
transform: translateX(30px);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 自定义滚动条样式 */
|
|
||||||
/* 自定义滚动条样式 */
|
/* 自定义滚动条样式 */
|
||||||
.cus-scroll {
|
.cus-scroll {
|
||||||
overflow: auto;
|
overflow: auto;
|
@ -33,8 +33,3 @@ textarea {
|
|||||||
border: none;
|
border: none;
|
||||||
resize: none;
|
resize: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
body {
|
|
||||||
font-size: 14px;
|
|
||||||
font-weight: 400;
|
|
||||||
}
|
|
||||||
|
2
src/utils/auth/index.js
Normal file
2
src/utils/auth/index.js
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
export * from './auth'
|
||||||
|
export * from './token'
|
@ -1,4 +1,4 @@
|
|||||||
import { lStorage } from './cache'
|
import { lStorage } from '@/utils'
|
||||||
import api from '@/api'
|
import api from '@/api'
|
||||||
|
|
||||||
const TOKEN_CODE = 'access_token'
|
const TOKEN_CODE = 'access_token'
|
76
src/utils/common/common.js
Normal file
76
src/utils/common/common.js
Normal file
@ -0,0 +1,76 @@
|
|||||||
|
import dayjs from 'dayjs'
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @desc 格式化时间
|
||||||
|
* @param {(Object|string|number)} time
|
||||||
|
* @param {string} format
|
||||||
|
* @returns {string | null}
|
||||||
|
*/
|
||||||
|
export function formatDateTime(time = undefined, format = 'YYYY-MM-DD HH:mm:ss') {
|
||||||
|
return dayjs(time).format(format)
|
||||||
|
}
|
||||||
|
|
||||||
|
export function formatDate(date = undefined, format = 'YYYY-MM-DD') {
|
||||||
|
return formatDateTime(date, format)
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @desc 函数节流
|
||||||
|
* @param {Function} fn
|
||||||
|
* @param {Number} wait
|
||||||
|
* @returns {Function}
|
||||||
|
*/
|
||||||
|
export function throttle(fn, wait) {
|
||||||
|
var context, args
|
||||||
|
var previous = 0
|
||||||
|
|
||||||
|
return function () {
|
||||||
|
var now = +new Date()
|
||||||
|
context = this
|
||||||
|
args = arguments
|
||||||
|
if (now - previous > wait) {
|
||||||
|
fn.apply(context, args)
|
||||||
|
previous = now
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @desc 函数防抖
|
||||||
|
* @param {Function} func
|
||||||
|
* @param {number} wait
|
||||||
|
* @param {boolean} immediate
|
||||||
|
* @return {*}
|
||||||
|
*/
|
||||||
|
export function debounce(method, wait, immediate) {
|
||||||
|
let timeout
|
||||||
|
return function (...args) {
|
||||||
|
let context = this
|
||||||
|
if (timeout) {
|
||||||
|
clearTimeout(timeout)
|
||||||
|
}
|
||||||
|
// 立即执行需要两个条件,一是immediate为true,二是timeout未被赋值或被置为null
|
||||||
|
if (immediate) {
|
||||||
|
/**
|
||||||
|
* 如果定时器不存在,则立即执行,并设置一个定时器,wait毫秒后将定时器置为null
|
||||||
|
* 这样确保立即执行后wait毫秒内不会被再次触发
|
||||||
|
*/
|
||||||
|
let callNow = !timeout
|
||||||
|
timeout = setTimeout(() => {
|
||||||
|
timeout = null
|
||||||
|
}, wait)
|
||||||
|
if (callNow) {
|
||||||
|
method.apply(context, args)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// 如果immediate为false,则函数wait毫秒后执行
|
||||||
|
timeout = setTimeout(() => {
|
||||||
|
/**
|
||||||
|
* args是一个类数组对象,所以使用fn.apply
|
||||||
|
* 也可写作method.call(context, ...args)
|
||||||
|
*/
|
||||||
|
method.apply(context, args)
|
||||||
|
}, wait)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
4
src/utils/common/index.js
Normal file
4
src/utils/common/index.js
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
export * from './common'
|
||||||
|
export * from './is'
|
||||||
|
export * from './icon'
|
||||||
|
export * from './naiveTools'
|
@ -1,4 +1,4 @@
|
|||||||
import { isNullOrUndef } from '@/utils/is'
|
import { isNullOrUndef } from '@/utils'
|
||||||
|
|
||||||
export function setupMessage(NMessage) {
|
export function setupMessage(NMessage) {
|
||||||
let loadingMessage = null
|
let loadingMessage = null
|
||||||
|
@ -1,7 +1,5 @@
|
|||||||
import { useUserStore } from '@/store/modules/user'
|
import { useUserStore } from '@/store'
|
||||||
import { isNullOrUndef } from '@/utils/is'
|
import { isNullOrUndef, removeToken, toLogin } from '@/utils'
|
||||||
import { removeToken } from '@/utils/token'
|
|
||||||
import { toLogin } from '@/utils/auth'
|
|
||||||
|
|
||||||
export function addBaseParams(params) {
|
export function addBaseParams(params) {
|
||||||
if (!params.userId) {
|
if (!params.userId) {
|
||||||
|
@ -14,6 +14,6 @@ export function createAxios(options = {}) {
|
|||||||
return service
|
return service
|
||||||
}
|
}
|
||||||
|
|
||||||
export default createAxios({
|
export const request = createAxios({
|
||||||
baseURL: import.meta.env.VITE_BASE_API,
|
baseURL: import.meta.env.VITE_BASE_API,
|
||||||
})
|
})
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
import { getToken } from '@/utils/token'
|
import { getToken, toLogin } from '@/utils'
|
||||||
import { toLogin } from '@/utils/auth'
|
|
||||||
import { resolveResError } from './helpers'
|
import { resolveResError } from './helpers'
|
||||||
|
|
||||||
export function reqResolve(config) {
|
export function reqResolve(config) {
|
||||||
|
@ -1,76 +1,4 @@
|
|||||||
import dayjs from 'dayjs'
|
export * from './common'
|
||||||
|
export * from './storage'
|
||||||
/**
|
export * from './http'
|
||||||
* @desc 格式化时间
|
export * from './auth'
|
||||||
* @param {(Object|string|number)} time
|
|
||||||
* @param {string} format
|
|
||||||
* @returns {string | null}
|
|
||||||
*/
|
|
||||||
export function formatDateTime(time = undefined, format = 'YYYY-MM-DD HH:mm:ss') {
|
|
||||||
return dayjs(time).format(format)
|
|
||||||
}
|
|
||||||
|
|
||||||
export function formatDate(date = undefined, format = 'YYYY-MM-DD') {
|
|
||||||
return formatDateTime(date, format)
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @desc 函数节流
|
|
||||||
* @param {Function} fn
|
|
||||||
* @param {Number} wait
|
|
||||||
* @returns {Function}
|
|
||||||
*/
|
|
||||||
export function throttle(fn, wait) {
|
|
||||||
var context, args
|
|
||||||
var previous = 0
|
|
||||||
|
|
||||||
return function () {
|
|
||||||
var now = +new Date()
|
|
||||||
context = this
|
|
||||||
args = arguments
|
|
||||||
if (now - previous > wait) {
|
|
||||||
fn.apply(context, args)
|
|
||||||
previous = now
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @desc 函数防抖
|
|
||||||
* @param {Function} func
|
|
||||||
* @param {number} wait
|
|
||||||
* @param {boolean} immediate
|
|
||||||
* @return {*}
|
|
||||||
*/
|
|
||||||
export function debounce(method, wait, immediate) {
|
|
||||||
let timeout
|
|
||||||
return function (...args) {
|
|
||||||
let context = this
|
|
||||||
if (timeout) {
|
|
||||||
clearTimeout(timeout)
|
|
||||||
}
|
|
||||||
// 立即执行需要两个条件,一是immediate为true,二是timeout未被赋值或被置为null
|
|
||||||
if (immediate) {
|
|
||||||
/**
|
|
||||||
* 如果定时器不存在,则立即执行,并设置一个定时器,wait毫秒后将定时器置为null
|
|
||||||
* 这样确保立即执行后wait毫秒内不会被再次触发
|
|
||||||
*/
|
|
||||||
let callNow = !timeout
|
|
||||||
timeout = setTimeout(() => {
|
|
||||||
timeout = null
|
|
||||||
}, wait)
|
|
||||||
if (callNow) {
|
|
||||||
method.apply(context, args)
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
// 如果immediate为false,则函数wait毫秒后执行
|
|
||||||
timeout = setTimeout(() => {
|
|
||||||
/**
|
|
||||||
* args是一个类数组对象,所以使用fn.apply
|
|
||||||
* 也可写作method.call(context, ...args)
|
|
||||||
*/
|
|
||||||
method.apply(context, args)
|
|
||||||
}, wait)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { isNullOrUndef } from '@/utils/is'
|
import { isNullOrUndef } from '@/utils'
|
||||||
|
|
||||||
class Storage {
|
class Storage {
|
||||||
constructor(option) {
|
constructor(option) {
|
@ -1,4 +1,4 @@
|
|||||||
import request from '@/utils/http'
|
import { request } from '@/utils'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
getPosts: (params = {}) => request.get('posts', { params }),
|
getPosts: (params = {}) => request.get('posts', { params }),
|
||||||
|
@ -82,11 +82,9 @@
|
|||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { NButton, NSwitch } from 'naive-ui'
|
import { NButton, NSwitch } from 'naive-ui'
|
||||||
import { formatDateTime } from '@/utils'
|
import { formatDateTime, renderIcon, isNullOrUndef } from '@/utils'
|
||||||
import { renderIcon } from '@/utils/icon'
|
|
||||||
import { useCRUD } from '@/composables'
|
import { useCRUD } from '@/composables'
|
||||||
import api from './api'
|
import api from './api'
|
||||||
import { isNullOrUndef } from '@/utils/is'
|
|
||||||
|
|
||||||
defineOptions({ name: 'CrudTable' })
|
defineOptions({ name: 'CrudTable' })
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import request from '@/utils/http'
|
import { request } from '@/utils'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
login: (data) => request.post('/auth/login', data, { noNeedToken: true }),
|
login: (data) => request.post('/auth/login', data, { noNeedToken: true }),
|
||||||
|
@ -46,8 +46,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { lStorage } from '@/utils/cache'
|
import { lStorage, setToken } from '@/utils'
|
||||||
import { setToken } from '@/utils/token'
|
|
||||||
import { useStorage } from '@vueuse/core'
|
import { useStorage } from '@vueuse/core'
|
||||||
import bgImg from '@/assets/images/login_bg.webp'
|
import bgImg from '@/assets/images/login_bg.webp'
|
||||||
import api from './api'
|
import api from './api'
|
||||||
|
@ -52,7 +52,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { useUserStore } from '@/store/modules/user'
|
import { useUserStore } from '@/store'
|
||||||
|
|
||||||
const userStore = useUserStore()
|
const userStore = useUserStore()
|
||||||
</script>
|
</script>
|
||||||
|
Loading…
Reference in New Issue
Block a user