auth.ts 602 B

1234567891011121314151617181920212223242526
  1. /*
  2. * @Author: fxs bjnsfxs@163.com
  3. * @Date: 2024-08-21 11:12:21
  4. * @LastEditors: fxs bjnsfxs@163.com
  5. * @LastEditTime: 2024-10-16 14:27:56
  6. * @FilePath: \Quantity-Creation-Management-System\src\utils\axios\auth.ts
  7. * @Description:
  8. *
  9. */
  10. import {ElMessage} from 'element-plus'
  11. import {MessageType} from '@/types/axios'
  12. import {getLoginState} from '../localStorage/localStorage'
  13. export const authLogin = (): boolean => {
  14. const state = getLoginState()
  15. if (!state) {
  16. ElMessage({
  17. type: MessageType.Warning,
  18. message: '请先登录',
  19. duration: 1500,
  20. })
  21. }
  22. return state
  23. }