Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
W
wecom-sidebar
Project
Project
Details
Activity
Releases
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
wanghuihui
wecom-sidebar
Commits
dd83dbe3
Commit
dd83dbe3
authored
Jan 05, 2022
by
Aivs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:报错问题解决 签名的时候url传的参数要去掉#
parent
e4bdbaf3
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
41 additions
and
41 deletions
+41
-41
App.tsx
src/App.tsx
+1
-1
index.ts
src/api/index.ts
+3
-2
Home.tsx
src/pages/Home.tsx
+28
-29
findCustom.tsx
src/pages/findCustom.tsx
+9
-9
No files found.
src/App.tsx
View file @
dd83dbe3
import
React
,
{
FC
}
from
'react'
import
{
HashRouter
}
from
"react-router-dom"
;
import
Nav
from
"./components/Nav"
;
//
import Nav from "./components/Nav";
import
RouterConfig
from
"./components/RouterConfig"
;
const
App
:
FC
=
()
=>
{
...
...
src/api/index.ts
View file @
dd83dbe3
...
...
@@ -60,12 +60,13 @@ export const fetchUserId = async (code: string) => {
}
// 获取签名
export
const
fetchSignatures
=
async
()
=>
{
export
const
fetchSignatures
=
async
()
=>
{
const
response
=
await
api
.
get
(
'/user_center/signatures'
,
{
params
:
{
url
:
window
.
location
.
href
url
:
window
.
location
.
href
.
split
(
"#"
)[
0
]
}
})
// alert(window.location.href.split("#")[0])
// alert(JSON.stringify(response))
return
response
.
data
.
data
;
}
...
...
src/pages/Home.tsx
View file @
dd83dbe3
import
React
,
{
FC
,
useEffect
,
useState
}
from
"react"
;
import
Cookies
from
"js-cookie"
;
import
{
fetchUser
,
getBaseInfoByWxId
,
addWxLabel
,
getWxLabel
,
deleteWxLabel
,
updateBaseInfoFromCompanyWx
}
from
"../api"
;
import
{
getBaseInfoByWxId
,
addWxLabel
,
getWxLabel
,
deleteWxLabel
,
updateBaseInfoFromCompanyWx
}
from
"../api"
;
import
{
Spin
,
Form
,
Input
,
Button
,
Select
,
Radio
,
Tag
}
from
"antd"
;
import
{
SearchOutlined
,
DownOutlined
,
UpOutlined
}
from
'@ant-design/icons'
;
import
'./../css/home.css'
import
jt
from
'./../assets/images/jt.png'
import
{
jsSdk
}
from
"../index"
import
{
Link
}
from
"react-router-dom"
;
const
{
TextArea
}
=
Input
const
Home
:
FC
=
()
=>
{
const
[
loading
,
setLoading
]
=
useState
<
boolean
>
(
false
);
const
[
loading
]
=
useState
<
boolean
>
(
false
);
const
[
userId
,
setUserId
]
=
useState
<
any
>
(
''
);
const
[
customInfoEdit
,
setCustomInfoEdit
]
=
useState
<
boolean
>
(
false
);
const
[
labelValue
,
setlabelValue
]
=
useState
<
string
>
(
''
);
...
...
@@ -56,35 +55,35 @@ const layout = {
labelCol
:
{
span
:
8
},
wrapperCol
:
{
span
:
16
},
};
const
tailLayout
=
{
wrapperCol
:
{
offset
:
8
,
span
:
16
},
};
//
const tailLayout = {
//
wrapperCol: { offset: 8, span: 16 },
//
};
const
[
form
]
=
Form
.
useForm
();
const
onGenderChange
=
(
value
:
string
)
=>
{
switch
(
value
)
{
case
'male'
:
form
.
setFieldsValue
({
note
:
'Hi, man!'
});
return
;
case
'female'
:
form
.
setFieldsValue
({
note
:
'Hi, lady!'
});
return
;
case
'other'
:
form
.
setFieldsValue
({
note
:
'Hi there!'
});
}
};
//
const onGenderChange = (value: string) => {
//
switch (value) {
//
case 'male':
//
form.setFieldsValue({ note: 'Hi, man!' });
//
return;
//
case 'female':
//
form.setFieldsValue({ note: 'Hi, lady!' });
//
return;
//
case 'other':
//
form.setFieldsValue({ note: 'Hi there!' });
//
}
//
};
const
onFinish
=
(
values
:
any
)
=>
{
console
.
log
(
values
);
};
const
onReset
=
()
=>
{
form
.
resetFields
();
};
//
const onReset = () => {
//
form.resetFields();
//
};
const
onFill
=
()
=>
{
console
.
log
(
customInfo
)
debugger
};
//
const onFill = () => {
//
console.log(customInfo)
//
debugger
//
};
const
updown
=
()
=>
(
e
:
any
)
=>
{
console
.
log
(
e
)
debugger
...
...
@@ -166,12 +165,12 @@ const tailLayout = {
}
}
}
const
onChange
=
()
=>
{
//
const onChange=()=>{
}
const
onSearch
=
()
=>
{
//
}
//
const onSearch=()=>{
}
//
}
useEffect
(()
=>
{
getUserInfo
();
...
...
src/pages/findCustom.tsx
View file @
dd83dbe3
...
...
@@ -102,16 +102,16 @@ const Actions: React.FC = () => {
setListData
([...
data
])
}
}
const
sendMsg
=
useCallback
(
async
()
=>
{
if
(
!
msg
)
alert
(
'消息不能为空'
)
//
const sendMsg = useCallback(async () => {
//
if (!msg) alert('消息不能为空')
await
jsSdk
.
invoke
(
'sendChatMessage'
,
{
msgtype
:
'text'
,
text
:
{
content
:
msg
}
});
},
[
msg
])
//
await jsSdk.invoke('sendChatMessage', {
//
msgtype: 'text',
//
text: {
//
content: msg
//
}
//
});
//
}, [msg])
const
getUserBase
=
async
()
=>
{
const
res
=
await
jsSdk
.
invoke
<
{
userId
?:
string
}
>
(
'getCurExternalContact'
,
{})
console
.
log
(
res
)
...
...
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