Merge branch '20230725-渗透测试' into 'release_20230728'
20230725 渗透测试 See merge request eshop/fe_service_ebtp_frontend!316
This commit is contained in:
@ -8,7 +8,7 @@ module.exports = {
|
||||
REACT_APP_MALL_V2_URL: false,
|
||||
//各系统跳转参数
|
||||
REACT_APP_CLIENT_KEY: true,
|
||||
REACT_APP_CLIENT_SECRET: true,
|
||||
// REACT_APP_CLIENT_SECRET: true,
|
||||
//密码加密参数
|
||||
REACT_APP_PASSWORD_CIPHERMODE: true,
|
||||
REACT_APP_PASSWORD_PUBLICKEY: true,
|
||||
|
@ -8,7 +8,7 @@ export default defineConfig({
|
||||
|
||||
//各系统跳转参数
|
||||
REACT_APP_CLIENT_KEY : 'KgPEkttG',
|
||||
REACT_APP_CLIENT_SECRET :'ae5bdb183c502355d2055b3de73300aa73cbfdf3',
|
||||
// REACT_APP_CLIENT_SECRET :'ae5bdb183c502355d2055b3de73300aa73cbfdf3',
|
||||
|
||||
//密码加密参数
|
||||
REACT_APP_PASSWORD_CIPHERMODE:'1',
|
||||
|
@ -8,7 +8,7 @@ export default defineConfig({
|
||||
|
||||
//各系统跳转参数
|
||||
REACT_APP_CLIENT_KEY: 'KgPEkttG',
|
||||
REACT_APP_CLIENT_SECRET: 'ae5bdb183c502355d2055b3de73300aa73cbfdf3',
|
||||
// REACT_APP_CLIENT_SECRET: 'ae5bdb183c502355d2055b3de73300aa73cbfdf3',
|
||||
|
||||
//密码加密参数
|
||||
REACT_APP_PASSWORD_CIPHERMODE: '1',
|
||||
|
@ -8,7 +8,7 @@ export default defineConfig({
|
||||
|
||||
//各系统跳转参数
|
||||
REACT_APP_CLIENT_KEY : 'KgPEkttG',
|
||||
REACT_APP_CLIENT_SECRET :'ae5bdb183c502355d2055b3de73300aa73cbfdf3',
|
||||
// REACT_APP_CLIENT_SECRET :'ae5bdb183c502355d2055b3de73300aa73cbfdf3',
|
||||
|
||||
//密码加密参数
|
||||
REACT_APP_PASSWORD_CIPHERMODE:'1',
|
||||
|
@ -8,7 +8,7 @@ export default defineConfig({
|
||||
|
||||
//各系统跳转参数
|
||||
REACT_APP_CLIENT_KEY: 'KgPEkttG',
|
||||
REACT_APP_CLIENT_SECRET: 'ae5bdb183c502355d2055b3de73300aa73cbfdf3',
|
||||
// REACT_APP_CLIENT_SECRET: 'ae5bdb183c502355d2055b3de73300aa73cbfdf3',
|
||||
|
||||
//密码加密参数
|
||||
REACT_APP_PASSWORD_CIPHERMODE: '1',
|
||||
|
@ -22,15 +22,15 @@ const Loading: React.FC<{}> = () => {
|
||||
clientId: REACT_APP_CLIENT_KEY,
|
||||
scope: getUserScope()
|
||||
}
|
||||
const params = {
|
||||
grant_type: "refresh_token",
|
||||
refresh_token: getUserRefreshToken(),
|
||||
client_id: REACT_APP_CLIENT_KEY,
|
||||
client_secret: REACT_APP_CLIENT_SECRET,
|
||||
}
|
||||
const header = {
|
||||
clientId: REACT_APP_CLIENT_KEY,
|
||||
}
|
||||
// const params = {
|
||||
// grant_type: "refresh_token",
|
||||
// refresh_token: getUserRefreshToken(),
|
||||
// client_id: REACT_APP_CLIENT_KEY,
|
||||
// client_secret: REACT_APP_CLIENT_SECRET,
|
||||
// }
|
||||
// const header = {
|
||||
// clientId: REACT_APP_CLIENT_KEY,
|
||||
// }
|
||||
if (userType == '0') {//联通用户
|
||||
await cloudReloadToken('', headers)
|
||||
await getUserData(token, url, extra, 1)
|
||||
@ -138,11 +138,9 @@ const Loading: React.FC<{}> = () => {
|
||||
//获取协议部分 http: https:
|
||||
const protocol = window.location.protocol
|
||||
const grant_type = 'authorization_code';
|
||||
const client_id = REACT_APP_CLIENT_KEY;
|
||||
const client_secret = REACT_APP_CLIENT_SECRET;
|
||||
const redirect_uri = `${protocol}//${host}/redirect${e}`;
|
||||
let token = '';
|
||||
await getTokenByCode({ grant_type, client_id, client_secret, redirect_uri, code }).then(res => {
|
||||
await getTokenByCode({ grant_type, redirect_uri, code }).then(res => {
|
||||
if (res?.success == true) {
|
||||
sessionStorage.setItem('Authorization', res?.data?.value)
|
||||
token = 'Bearer ' + res?.data?.value;
|
||||
|
@ -18,7 +18,7 @@ export async function fgetUserMsg(params: any) {
|
||||
* @returns
|
||||
*/
|
||||
export async function getTokenByCode(params: any) {
|
||||
return request('/api/auth/oauth/token', {
|
||||
return request('/api/core-service-ebtp-userinfo/v1/auth/oauth/token', {
|
||||
method: 'POST',
|
||||
params: params,
|
||||
});
|
||||
|
@ -62,13 +62,9 @@ const Login: React.FC<LoginProps> = (props) => {
|
||||
const params = {
|
||||
grant_type: "refresh_token",
|
||||
refresh_token: data?.refreshToken?.value,
|
||||
client_id: REACT_APP_CLIENT_KEY,
|
||||
client_secret: REACT_APP_CLIENT_SECRET,
|
||||
old_token: data?.value,
|
||||
}
|
||||
const header = {
|
||||
clientId: REACT_APP_CLIENT_KEY,
|
||||
}
|
||||
await refreshTokenApi(params, header).then(res => {
|
||||
await refreshTokenApi(params).then(res => {
|
||||
if (res?.success == true) {
|
||||
sessionStorage.setItem('Authorization', res?.data?.value);
|
||||
// sessionStorage.setItem('refreshToken', res?.data?.refreshToken.value);
|
||||
|
@ -63,13 +63,9 @@ const Login: React.FC<LoginProps> = (props) => {
|
||||
const params = {
|
||||
grant_type: "refresh_token",
|
||||
refresh_token: data?.refreshToken?.value,
|
||||
client_id: REACT_APP_CLIENT_KEY,
|
||||
client_secret: REACT_APP_CLIENT_SECRET,
|
||||
old_token: data?.value,
|
||||
}
|
||||
const header = {
|
||||
clientId: REACT_APP_CLIENT_KEY,
|
||||
}
|
||||
await refreshTokenApi(params, header).then(res => {
|
||||
await refreshTokenApi(params).then(res => {
|
||||
if (res?.success == true) {
|
||||
sessionStorage.setItem('Authorization', res?.data?.value);
|
||||
// sessionStorage.setItem('refreshToken', res?.data?.refreshToken.value);
|
||||
|
@ -62,13 +62,9 @@ const Login: React.FC<LoginProps> = (props) => {
|
||||
const params = {
|
||||
grant_type: "refresh_token",
|
||||
refresh_token: data?.refreshToken?.value,
|
||||
client_id: REACT_APP_CLIENT_KEY,
|
||||
client_secret: REACT_APP_CLIENT_SECRET,
|
||||
old_token: data?.value,
|
||||
}
|
||||
const header = {
|
||||
clientId: REACT_APP_CLIENT_KEY,
|
||||
}
|
||||
await refreshTokenApi(params, header).then(res => {
|
||||
await refreshTokenApi(params).then(res => {
|
||||
if (res?.success == true) {
|
||||
sessionStorage.setItem('Authorization', res?.data?.value);
|
||||
// sessionStorage.setItem('refreshToken', res?.data?.refreshToken.value);
|
||||
|
@ -228,13 +228,9 @@ const Index: React.FC<{}> = () => {
|
||||
const params = {
|
||||
grant_type: "refresh_token",
|
||||
refresh_token: data?.refreshToken?.value,
|
||||
client_id: REACT_APP_CLIENT_KEY,
|
||||
client_secret: REACT_APP_CLIENT_SECRET,
|
||||
old_token: data?.value,
|
||||
}
|
||||
const header = {
|
||||
clientId: REACT_APP_CLIENT_KEY,
|
||||
}
|
||||
await refreshTokenApi(params, header).then(res => {
|
||||
await refreshTokenApi(params).then(res => {
|
||||
if (res?.success == true) {
|
||||
sessionStorage.setItem('Authorization', res?.data?.value);
|
||||
// sessionStorage.setItem('refreshToken', res?.data?.refreshToken.value);
|
||||
|
@ -95,12 +95,11 @@ export async function CloudfakeAccountLogin(params: LoginParamsType) {
|
||||
* @param params
|
||||
* @returns
|
||||
*/
|
||||
export async function refreshTokenApi(params: any, headers: any) {
|
||||
return request('/api/auth/oauth/token', {
|
||||
export async function refreshTokenApi(params: any) {
|
||||
return request('/api/core-service-ebtp-userinfo/v1/auth/oauth/token', {
|
||||
method: 'POST',
|
||||
requestType: 'form',
|
||||
data: params,
|
||||
headers: headers
|
||||
});
|
||||
}
|
||||
|
||||
|
2
src/typings.d.ts
vendored
2
src/typings.d.ts
vendored
@ -45,7 +45,7 @@ declare const REACT_APP_MALL_V2_URL: string
|
||||
/**ENV-系统跳转参数KEY */
|
||||
declare const REACT_APP_CLIENT_KEY: string
|
||||
/**ENV-系统跳转参数SECRET */
|
||||
declare const REACT_APP_CLIENT_SECRET: string
|
||||
// declare const REACT_APP_CLIENT_SECRET: string
|
||||
/**ENV-密码加密参数CIPHERMODE */
|
||||
declare const REACT_APP_PASSWORD_CIPHERMODE: string
|
||||
/**ENV-密码加密参数PUBLICKEY */
|
||||
|
Reference in New Issue
Block a user