Browse Source

cookie

master
maochaoying 2 years ago
parent
commit
19f7180c5b
  1. 1
      package.json
  2. 2
      src/components/Debug.vue
  3. 8
      src/pages/index.vue
  4. 1634
      yarn.lock

1
package.json

@ -11,6 +11,7 @@
"dependencies": { "dependencies": {
"autoprefixer": "^10.4.14", "autoprefixer": "^10.4.14",
"axios": "^1.3.4", "axios": "^1.3.4",
"js-cookie": "^3.0.5",
"moment": "^2.29.4", "moment": "^2.29.4",
"pinia": "^2.0.32", "pinia": "^2.0.32",
"postcss-px-to-viewport": "^1.1.1", "postcss-px-to-viewport": "^1.1.1",

2
src/components/Debug.vue

@ -346,6 +346,7 @@ const reconnect = () => {
const websocketonmessage = e => { const websocketonmessage = e => {
// //
const data = JSON.parse(e.data) const data = JSON.parse(e.data)
console.log('收到结果', e.data)
const { messageId, success } = data const { messageId, success } = data
if (success) { if (success) {
switch (messageId) { switch (messageId) {
@ -454,6 +455,7 @@ const handleExposureTime = value => {
} }
const handleSimulationBrightness = value => { const handleSimulationBrightness = value => {
console.log('发送调整亮度', setFlashBrightnessAnalog(value))
websocketsend(setFlashBrightnessAnalog(value)) websocketsend(setFlashBrightnessAnalog(value))
} }

8
src/pages/index.vue

@ -361,6 +361,7 @@ import {
} from '@/store' } from '@/store'
import socket from '@/utils/websocket' import socket from '@/utils/websocket'
import Cookie from '@/utils/cookie' import Cookie from '@/utils/cookie'
import Cookies from 'js-cookie'
import { MessagePlugin } from 'tdesign-vue-next' import { MessagePlugin } from 'tdesign-vue-next'
import { ref, onMounted, computed, onUnmounted } from 'vue' import { ref, onMounted, computed, onUnmounted } from 'vue'
import Excel from 'cpns/Excel' import Excel from 'cpns/Excel'
@ -667,6 +668,10 @@ const catCurrentTaskDetail = () => {
onUnmounted(() => { onUnmounted(() => {
websock.value.close() websock.value.close()
accountStore?.clearLoginInfo()
Cookies.remove('u')
Cookies.remove('t')
Cookies.remove('r')
Cookie.clearAllCookie() Cookie.clearAllCookie()
}) })
@ -787,6 +792,9 @@ const websocketsend = data => {
} }
const websocketclose = () => { const websocketclose = () => {
Cookies.remove('u')
Cookies.remove('t')
Cookies.remove('r')
reconnect() reconnect()
} }

1634
yarn.lock
File diff suppressed because it is too large
View File

Loading…
Cancel
Save