revet: 去除系统免登录加密参数data
This commit is contained in:
@@ -186,7 +186,7 @@ function beforeRequest(options: OptionsType): OptionsType | Promise<any> {
|
|||||||
if (paramStr) {
|
if (paramStr) {
|
||||||
const separator = options.url.includes('?') ? '&' : '?';
|
const separator = options.url.includes('?') ? '&' : '?';
|
||||||
// 请求加密
|
// 请求加密
|
||||||
if (options.crypto && token !== '== Not Login Auth ==') {
|
if (options.crypto) {
|
||||||
const data = encryptAES(JSON.stringify(paramStr), APP_DATA_API_KEY);
|
const data = encryptAES(JSON.stringify(paramStr), APP_DATA_API_KEY);
|
||||||
options.url += `${separator}data=${encodeURIComponent(data)}`;
|
options.url += `${separator}data=${encodeURIComponent(data)}`;
|
||||||
} else {
|
} else {
|
||||||
@@ -198,7 +198,7 @@ function beforeRequest(options: OptionsType): OptionsType | Promise<any> {
|
|||||||
if (options.method === 'get') return options;
|
if (options.method === 'get') return options;
|
||||||
|
|
||||||
// 非get参数提交
|
// 非get参数提交
|
||||||
let body = options.data
|
let body = options.data;
|
||||||
if (body instanceof FormData) {
|
if (body instanceof FormData) {
|
||||||
options.body = body;
|
options.body = body;
|
||||||
} else if (body) {
|
} else if (body) {
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import NProgress from 'nprogress';
|
|||||||
import 'nprogress/nprogress.css';
|
import 'nprogress/nprogress.css';
|
||||||
import BasicLayout from '../layouts/BasicLayout.vue';
|
import BasicLayout from '../layouts/BasicLayout.vue';
|
||||||
import BlankLayout from '../layouts/BlankLayout.vue';
|
import BlankLayout from '../layouts/BlankLayout.vue';
|
||||||
import { getToken, setToken } from '@/plugins/auth-token';
|
import { getToken } from '@/plugins/auth-token';
|
||||||
import { validHttp } from '@/utils/regular-utils';
|
import { validHttp } from '@/utils/regular-utils';
|
||||||
import useUserStore from '@/store/modules/user';
|
import useUserStore from '@/store/modules/user';
|
||||||
import useAppStore from '@/store/modules/app';
|
import useAppStore from '@/store/modules/app';
|
||||||
@@ -187,7 +187,6 @@ router.beforeEach(async (to, from, next) => {
|
|||||||
// 免用户登录认证
|
// 免用户登录认证
|
||||||
if (!appStore.loginAuth) {
|
if (!appStore.loginAuth) {
|
||||||
token = '== Not Login Auth ==';
|
token = '== Not Login Auth ==';
|
||||||
setToken('== Not Login Auth ==');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 没有token
|
// 没有token
|
||||||
|
|||||||
Reference in New Issue
Block a user