Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
W
wangxiaolu-promotion-wechat
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
sfa
wangxiaolu-promotion-wechat
Commits
97a410ce
提交
97a410ce
authored
4月 09, 2025
作者:
lidongxu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
'修复openId的字段名存储本地错误问题'
上级
e42a57db
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
14 行增加
和
6 行删除
+14
-6
login.vue
modules/otherModules/login.vue
+9
-4
register.vue
modules/otherModules/register.vue
+1
-1
user.js
store/modules/user.js
+3
-0
storage.js
utils/storage.js
+1
-1
没有找到文件。
modules/otherModules/login.vue
浏览文件 @
97a410ce
...
...
@@ -132,9 +132,14 @@ export default {
},
async
created
()
{
// 调用微信登录接口,获取 openID
const
openId
=
await
this
.
$store
.
dispatch
(
'getOpenId'
)
const
res
=
await
getPhoneNumberCountAPI
(
openId
)
this
.
maxSend
=
(
res
.
data
>
5
)
try
{
const
openId
=
await
this
.
$store
.
dispatch
(
'getOpenId'
)
const
res
=
await
getPhoneNumberCountAPI
(
openId
)
this
.
maxSend
=
(
res
.
data
>=
5
)
}
catch
(
err
)
{
this
.
$modal
.
msgError
(
err
.
message
)
}
},
computed
:
{
...
mapGetters
([
'wxOpenId'
])
...
...
@@ -142,7 +147,7 @@ export default {
methods
:
{
loginMark
()
{
if
(
this
.
maxSend
)
{
this
.
$modal
.
msgError
(
'
您已超出获取手机号登录次数上限,使用手动
输入手机号登录'
)
this
.
$modal
.
msgError
(
'
今日获取次数上限,请
输入手机号登录'
)
return
}
this
.
$modal
.
msgError
(
'请先勾选同意协议'
)
...
...
modules/otherModules/register.vue
浏览文件 @
97a410ce
...
...
@@ -110,7 +110,7 @@ export default {
// 手机号首次需要调用此接口注册-拿到后台 token(以后调用后台登录接口才能通过拿到 token)
await
submitUserInfoAPI
({
avatarUrl
:
this
.
formData
.
avatarUrl
,
openId
:
storage
.
get
(
constant
.
wxOpenId
)
,
openId
:
this
.
openId
,
name
:
this
.
formData
.
name
,
idenFrontPhotoUrl
:
this
.
formData
.
idenFrontUrl
,
idenReversePhotoUrl
:
this
.
formData
.
idenBackUrl
,
...
...
store/modules/user.js
浏览文件 @
97a410ce
...
...
@@ -59,6 +59,9 @@ const user = {
// 通过 code 获取永久唯一身份标识 openid
const
openRes
=
await
getOpenIdAPI
(
loginRes
.
code
)
if
(
!
openRes
.
data
.
openid
)
{
return
reject
(
new
Error
(
'获取 openId 失败'
))
}
commit
(
'SET_WXOPENID'
,
openRes
.
data
.
openid
)
resolve
(
openRes
.
data
.
openid
)
})
...
...
utils/storage.js
浏览文件 @
97a410ce
...
...
@@ -4,7 +4,7 @@ import constant from './constant'
let
storageKey
=
'storage_data'
// 存储节点变量名
let
storageNodeKeys
=
[
constant
.
avatar
,
constant
.
name
,
constant
.
roles
,
constant
.
permissions
,
constant
.
user
,
constant
.
location
,
constant
.
loginPhone
,
constant
.
login
OpenId
]
let
storageNodeKeys
=
[
constant
.
avatar
,
constant
.
name
,
constant
.
roles
,
constant
.
permissions
,
constant
.
user
,
constant
.
location
,
constant
.
loginPhone
,
constant
.
wx
OpenId
]
const
storage
=
{
set
:
function
(
key
,
value
)
{
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论