feat: 为兼容旧版本,保留 userPhone 字段并更新请求头中的 phone 字段
This commit is contained in:
parent
8e98e3d63a
commit
15e307dbea
|
|
@ -82,6 +82,10 @@ const storeSetup = () => {
|
|||
});
|
||||
setToken(result.data.token);
|
||||
setUserInfos({ ...result.data });
|
||||
|
||||
// 为了兼容之前的版本,暂时保留 userPhone 字段
|
||||
Session.set("userPhone", data.phone);
|
||||
|
||||
uni.showToast({
|
||||
title: "登录成功",
|
||||
icon: "success",
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ service.interceptors.request.use(
|
|||
// 在发送请求之前做些什么 token
|
||||
if (Session.get("token")) {
|
||||
config.headers!["auth-token"] = `${Session.get("token")}`;
|
||||
config.headers!["phone"] = `${Session.get("userInfos").phone}`;
|
||||
config.headers!["phone"] = `${Session.get("userPhone")}`;
|
||||
}
|
||||
return config;
|
||||
},
|
||||
|
|
|
|||
Loading…
Reference in New Issue