merge(dev_jacy): fix H5 pay appid/openid and login input align
This commit is contained in:
@@ -18,7 +18,9 @@ function resolveApiBase(): string {
|
|||||||
export const API_BASE = resolveApiBase();
|
export const API_BASE = resolveApiBase();
|
||||||
const TOKEN_KEY = 'user_access_token';
|
const TOKEN_KEY = 'user_access_token';
|
||||||
const REFRESH_KEY = 'user_refresh_token';
|
const REFRESH_KEY = 'user_refresh_token';
|
||||||
export const CLIENT_APP = ClientApp.USER_MINI;
|
/** H5 产物走公众号体系(USER_H5);小程序原生走 USER_MINI。勿混用,否则 JSAPI 会出现 appid 与 openid 不匹配 */
|
||||||
|
export const CLIENT_APP =
|
||||||
|
process.env.TARO_ENV === 'h5' ? ClientApp.USER_H5 : ClientApp.USER_MINI;
|
||||||
|
|
||||||
export function getToken(): string {
|
export function getToken(): string {
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -2,11 +2,10 @@ import { createWeixinSdk, isWechatEnv } from '@dukang/weixin-sdk';
|
|||||||
import { API_BASE, CLIENT_APP, getToken } from './api';
|
import { API_BASE, CLIENT_APP, getToken } from './api';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* H5 公众号内 JSSDK(分享 / OAuth / 支付)须与业务 API 使用同一 X-Client-App。
|
* H5 与业务 API 共用 CLIENT_APP:
|
||||||
* mini-user 全端(含 H5 产物)统一为 USER_MINI,否则 OAuth 登录签发的 JWT
|
* - H5 → USER_H5(公众号 OAuth openId + 公众号支付 appId)
|
||||||
* 与本地请求头 USER_MINI 不匹配 → 401 清登录 → 反复拉起微信授权。
|
* - 小程序 → USER_MINI
|
||||||
*
|
* 须与 JWT 签发一致,才能同时避免「反复授权」与「appid/openid 不匹配」。
|
||||||
* (历史 h5-user 仍用 USER_H5;公众号能力由后端凭证配置,不依赖该 ClientApp 标签。)
|
|
||||||
*/
|
*/
|
||||||
export const weixinSdk = createWeixinSdk({
|
export const weixinSdk = createWeixinSdk({
|
||||||
apiBase: API_BASE,
|
apiBase: API_BASE,
|
||||||
|
|||||||
@@ -102,11 +102,13 @@
|
|||||||
border-bottom: 1px solid var(--color-surface-variant, #e8e4de);
|
border-bottom: 1px solid var(--color-surface-variant, #e8e4de);
|
||||||
padding-bottom: 8px;
|
padding-bottom: 8px;
|
||||||
margin-bottom: 16px;
|
margin-bottom: 16px;
|
||||||
|
min-height: 40px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.login-field-prefix {
|
.login-field-prefix {
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
|
line-height: 32px;
|
||||||
color: var(--color-on-surface);
|
color: var(--color-on-surface);
|
||||||
margin-right: 12px;
|
margin-right: 12px;
|
||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
@@ -119,9 +121,28 @@
|
|||||||
padding: 0;
|
padding: 0;
|
||||||
height: 32px;
|
height: 32px;
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
line-height: 24px;
|
line-height: 32px;
|
||||||
color: var(--color-on-surface);
|
color: var(--color-on-surface);
|
||||||
min-width: 0;
|
min-width: 0;
|
||||||
|
box-sizing: border-box;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.login-field-input input,
|
||||||
|
.login-field-input .taro-input,
|
||||||
|
.login-field-input .weui-input {
|
||||||
|
width: 100% !important;
|
||||||
|
height: 100% !important;
|
||||||
|
min-height: 0 !important;
|
||||||
|
padding: 0 !important;
|
||||||
|
margin: 0 !important;
|
||||||
|
border: none !important;
|
||||||
|
background: transparent !important;
|
||||||
|
box-sizing: border-box !important;
|
||||||
|
font-size: 16px !important;
|
||||||
|
line-height: normal !important;
|
||||||
|
color: inherit;
|
||||||
}
|
}
|
||||||
|
|
||||||
.login-get-code {
|
.login-get-code {
|
||||||
|
|||||||
Reference in New Issue
Block a user