Browse Source

refactor: save

dev
zyronon 1 year ago
parent
commit
c3b544503d
  1. 1
      src/App.vue
  2. 0
      src/api/user.ts
  3. 0
      src/api/videos.ts
  4. 2
      src/components/Comment.vue
  5. 2
      src/store/pinia.js
  6. 6
      src/utils/request.ts

1
src/App.vue

@ -89,7 +89,6 @@ onMounted(() => {
width: 100%; width: 100%;
position: relative; position: relative;
font-size: 14rem; font-size: 14rem;
color: white;
} }
.guide { .guide {

0
src/api/user.js → src/api/user.ts

0
src/api/videos.js → src/api/videos.ts

2
src/components/Comment.vue

@ -355,6 +355,7 @@ export default {
z-index: 9; z-index: 9;
svg { svg {
color: #000;
background: rgb(242, 242, 242); background: rgb(242, 242, 242);
padding: 4rem; padding: 4rem;
font-size: 16rem; font-size: 16rem;
@ -368,6 +369,7 @@ export default {
} }
.comment { .comment {
color: #000;
width: 100vw; width: 100vw;
height: v-bind(height); height: v-bind(height);
background: #fff; background: #fff;

2
src/store/pinia.js

@ -1,5 +1,5 @@
import { defineStore } from 'pinia' import { defineStore } from 'pinia'
import { friends, panel } from '@/api/user.js' import { friends, panel } from '@/api/user.ts'
import enums from '@/utils/enums' import enums from '@/utils/enums'
import resource from '@/assets/data/resource' import resource from '@/assets/data/resource'

6
src/utils/request.js → src/utils/request.ts

@ -31,7 +31,7 @@ axiosInstance.interceptors.response.use(
/* /*
* data作处理datadata字段response.data的内容合并到data里面 * data作处理datadata字段response.data的内容合并到data里面
* */ * */
let { data } = response const { data } = response
// console.log(response) // console.log(response)
if (data === undefined || data === null || data === '') { if (data === undefined || data === null || data === '') {
globalMethods.$notice('请求失败,请稍后重试!') globalMethods.$notice('请求失败,请稍后重试!')
@ -89,12 +89,12 @@ axiosInstance.interceptors.response.use(
if (error.response.status === 401) { if (error.response.status === 401) {
return { success: false, code: 401, msg: '用户名或密码不正确', data: [] } return { success: false, code: 401, msg: '用户名或密码不正确', data: [] }
} else { } else {
let { data } = error.response const { data } = error.response
if (data === null || data === undefined) { if (data === null || data === undefined) {
globalMethods.$notice('请求失败,请稍后重试!') globalMethods.$notice('请求失败,请稍后重试!')
return { success: true, code: 200, data: [] } return { success: true, code: 200, data: [] }
} else { } else {
let resCode = data.code const resCode = data.code
if (data.data === undefined || data.data === null) { if (data.data === undefined || data.data === null) {
data.data = { ...data } data.data = { ...data }
} }
Loading…
Cancel
Save