Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
corporateCulture-qd
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
王立鹏
corporateCulture-qd
Commits
0f51d9b6
Commit
0f51d9b6
authored
Dec 23, 2025
by
lijiabin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
【需求 17679】 perf: 优化类型删除无用代码等
parent
8e1b042a
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
17 additions
and
37 deletions
+17
-37
index.ts
src/api/login/index.ts
+2
-2
types.ts
src/api/login/types.ts
+8
-0
route.ts
src/router/route.ts
+0
-5
test.tsx
src/test.tsx
+0
-3
test.vue
src/test.vue
+0
-7
axios.ts
src/utils/request/axios.ts
+1
-6
error.ts
src/utils/request/error.ts
+2
-2
index.ts
src/utils/wxUtil/index.ts
+2
-2
initWXConfig.ts
src/utils/wxUtil/initWXConfig.ts
+2
-2
test.vue
src/views/test.vue
+0
-8
No files found.
src/api/login/index.ts
View file @
0f51d9b6
import
service
from
'@/utils/request/index'
import
type
{
LoginParams
,
LoginResponseDto
}
from
'./types'
import
type
{
LoginParams
,
LoginResponseDto
,
GetWxSignatureResponseDto
}
from
'./types'
import
{
app_config
}
from
'@/config'
/**
...
...
@@ -60,7 +60,7 @@ export const generateLoginKey = (data: GenerateLoginKeyData) => {
*/
export
const
getWxSignature
=
(
url
:
string
)
=>
{
const
loginType
=
app_config
[
import
.
meta
.
env
.
MODE
]?.
loginType
return
service
.
request
({
return
service
.
request
<
GetWxSignatureResponseDto
>
({
url
:
'/api/auth/getSign'
,
method
:
'POST'
,
data
:
{
...
...
src/api/login/types.ts
View file @
0f51d9b6
...
...
@@ -31,3 +31,11 @@ export interface LoginResponseDto {
hiddenName
:
string
signature
:
string
}
export
interface
GetWxSignatureResponseDto
{
timestamp
:
string
nonceStr
:
string
signature
:
string
corpid
:
string
agentid
:
string
}
src/router/route.ts
View file @
0f51d9b6
...
...
@@ -180,11 +180,6 @@ export const constantsRoute = [
],
},
{
path
:
'/test'
,
name
:
'Test'
,
component
:
()
=>
import
(
'@/test.vue'
),
},
{
path
:
'/backend'
,
name
:
'Backend'
,
component
:
()
=>
import
(
'@/views/backend/index.vue'
),
...
...
src/test.tsx
deleted
100644 → 0
View file @
8e1b042a
export
default
function
Test
()
{
return
<
el
-
button
>
测试
</
el
-
button
>
}
src/test.vue
deleted
100644 → 0
View file @
8e1b042a
<
template
>
<el-button>
111111
{{
a
}}
</el-button>
</
template
>
<
script
setup
lang=
"ts"
>
const
a
=
33
console
.
log
(
a
)
</
script
>
src/utils/request/axios.ts
View file @
0f51d9b6
import
axios
,
{
type
AxiosInstance
,
type
AxiosRequestConfig
,
type
AxiosRequestHeaders
,
type
InternalAxiosRequestConfig
,
}
from
'axios'
import
axios
,
{
type
AxiosInstance
,
type
AxiosRequestConfig
}
from
'axios'
import
{
handleBackendError
,
handleRequestError
,
handleResponseError
}
from
'./error'
import
type
{
BackendServiceResult
}
from
'./types'
import
{
useUserStore
}
from
'@/stores/user'
...
...
src/utils/request/error.ts
View file @
0f51d9b6
...
...
@@ -15,7 +15,7 @@ import type { AxiosError, AxiosResponse } from 'axios'
* 后端逻辑code报错处理
* @param backendServiceResult 后端传来错误信息
*/
export
function
handleBackendError
(
backendServiceResult
:
BackendServiceResult
)
{
export
function
handleBackendError
<
T
>
(
backendServiceResult
:
BackendServiceResult
<
T
>
)
{
const
error
:
RequestServiceError
=
{
type
:
'backend'
,
code
:
backendServiceResult
.
code
||
DEFAULT_REQUEST_ERROR_CODE
,
...
...
@@ -53,7 +53,7 @@ export function handleResponseError(response: AxiosResponse) {
* 处理请求失败
*/
type
ErrorStatus
=
keyof
typeof
ERROR_STATUS
export
function
handleRequestError
(
axiosError
:
AxiosError
<
BackendServiceResult
>
)
{
export
function
handleRequestError
<
T
>
(
axiosError
:
AxiosError
<
BackendServiceResult
<
T
>
>
)
{
const
error
:
RequestServiceError
=
{
type
:
'axios'
,
code
:
DEFAULT_REQUEST_ERROR_CODE
,
...
...
src/utils/wxUtil/index.ts
View file @
0f51d9b6
...
...
@@ -24,9 +24,9 @@ interface IShareWxOption {
// }
// })
// }
export
function
wxShare
(
option
:
IShareWxOption
)
{
export
async
function
wxShare
(
option
:
IShareWxOption
)
{
const
url
=
location
.
href
.
split
(
'#'
)[
0
]
option
.
link
=
ww
.
shareAppMessage
({
await
ww
.
shareAppMessage
({
title
:
'测试一下'
,
desc
:
'让每个企业都有自己的微信'
,
link
:
url
+
'#'
+
option
.
link
,
...
...
src/utils/wxUtil/initWXConfig.ts
View file @
0f51d9b6
...
...
@@ -30,8 +30,8 @@ import * as ww from '@wecom/jssdk'
// }
export
async
function
initWxConfig
()
{
const
url
=
location
.
href
.
split
(
'#'
)[
0
]
const
response
=
await
getWxSignature
(
url
)
console
.
log
(
'response'
,
response
)
const
response
=
await
getWxSignature
(
url
!
)
//
console.log('response', response)
const
timestamp
=
response
.
data
.
timestamp
//时间戳
const
nonceStr
=
response
.
data
.
nonceStr
//随机字符串
const
signature
=
response
.
data
.
signature
//签名
...
...
src/views/test.vue
deleted
100644 → 0
View file @
8e1b042a
<
template
>
<el-button>
{{
count
}}
</el-button>
<ElButton>
{{
count
}}
</ElButton>
</
template
>
<
script
setup
lang=
"ts"
>
import
{
ref
}
from
'vue'
const
count
=
ref
(
0
)
</
script
>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment