Commit 5bcdf471 authored by 邓晓峰's avatar 邓晓峰

perf: updrage request http

parent ff1a7375
Pipeline #22439 passed with stages
in 28 minutes 38 seconds
......@@ -2,10 +2,10 @@ module.exports = {
dev: {
'/CityInterface': {
// target: 'http://192.168.10.151:8055',
target: 'https://panda-water.cn',
// target: 'https://panda-water.cn',
// target: 'http://192.168.19.102:8055',
// target: 'https://panda-water.com',
target: 'https://panda-water.com',
// target: 'http://192.168.10.150:8050',
// target: 'http://192.168.19.103:8112',
// target: 'http://192.168.12.8:8098',
......@@ -21,9 +21,9 @@ module.exports = {
'/cityinterface': {
// target: 'http://192.168.10.151:8055',
// target: 'http://192.168.10.150:8050',
target: 'https://panda-water.cn',
// target: 'https://panda-water.cn',
// target: 'http://192.168.19.102:8055',
// target: 'https://panda-water.com',
target: 'https://panda-water.com',
// target: 'http://192.168.12.8:8098',
// target: 'http://192.168.10.20:8888',
changeOrigin: true,
......@@ -52,9 +52,9 @@ module.exports = {
// target: 'http://192.168.12.8:8098',
// target: 'http://192.168.10.20:8888',
// target: 'http://192.168.10.151:8055',
target: 'https://panda-water.cn',
// target: 'https://panda-water.cn',
// target: 'http://192.168.19.102:8055',
// target: 'https://panda-water.com',
target: 'https://panda-water.com',
// target: 'http://192.168.10.150:8050',
changeOrigin: true,
headers: {
......
......@@ -7237,9 +7237,9 @@
}
},
"@wisdom-utils/utils": {
"version": "0.0.25",
"resolved": "https://g.civnet.cn:4873/@wisdom-utils%2futils/-/utils-0.0.25.tgz",
"integrity": "sha512-TIr8ik6laFs+L40vqKEEELj86l9qawiRjB3TNvdBNkez7geIp2LhIljo/uMJp7DegImxTZRSZJ3cULcLZtelBQ==",
"version": "0.0.26",
"resolved": "https://g.civnet.cn:4873/@wisdom-utils%2futils/-/utils-0.0.26.tgz",
"integrity": "sha512-O3PVT0tX4fng0Jee02ArzcIZrRhvQGbD8iVVjRKuahuWPKQtR1jFIHS7Y1W0gJz9bW+4ECUUlkcev8OXE668Zw==",
"requires": {
"axios": "^0.21.1",
"cookie": "^0.4.1",
......@@ -86,7 +86,7 @@
"@babel/polyfill": "7.4.3",
"@babel/runtime": "^7.10.5",
"@wisdom-utils/components": "0.0.6",
"@wisdom-utils/utils": "0.0.25",
"@wisdom-utils/utils": "0.0.26",
"animate.css": "^4.1.1",
"chalk": "2.4.2",
"compression": "1.7.4",
......
import { service, jsonp } from '@wisdom-utils/utils';
import { service, jsonp, request } from '@wisdom-utils/utils';
import constants from '../constants';
export const API = {
AUTHORIZATION_TOKEN: '/Publish/Identity/AuthorizationToken',
......@@ -45,17 +45,6 @@ const services = service({
method: constants.REQUEST_METHOD_GET,
type: constants.REQUEST_HTTP,
},
generateToken: {
url:
(window.globalConfig && window.globalConfig.loginTemplate) ===
'Dark - IOTMultiLogin.html'
? API.GENERATE_IOT_TOKEN
: API.GENERATE_TOKEN,
method: constants.REQUEST_METHOD_GET,
type: constants.REQUEST_HTTP,
},
generatetokenByqrcode: {
url: API.GENERATE_QRCODE,
method: constants.REQUEST_METHOD_GET,
......@@ -115,16 +104,6 @@ const services = service({
method: constants.REQUEST_METHOD_GET,
type: constants.REQUEST_HTTP,
},
changePassword: {
url:
(window.globalConfig && window.globalConfig.loginTemplate) ===
'Dark - IOTMultiLogin.html'
? API.IOT_CHANGE_PASSWORD
: API.CHANGE_PASSWORD,
method: constants.REQUEST_METHOD_GET,
type: constants.REQUEST_HTTP,
},
getVersion: {
url: API.GET_VERSION,
method: constants.REQUEST_METHOD_GET,
......@@ -135,6 +114,24 @@ const services = service({
method: constants.REQUEST_METHOD_GET,
type: constants.REQUEST_HTTP,
},
generateToken: {
url: () =>
window.globalConfig &&
window.globalConfig.loginTemplate === 'Dark - IOTMultiLogin.html'
? API.GENERATE_IOT_TOKEN
: API.GENERATE_TOKEN,
method: constants.REQUEST_METHOD_GET,
type: constants.REQUEST_HTTP,
},
changePassword: {
url: () =>
window.globalConfig &&
window.globalConfig.loginTemplate === 'Dark - IOTMultiLogin.html'
? API.IOT_CHANGE_PASSWORD
: API.CHANGE_PASSWORD,
method: constants.REQUEST_METHOD_GET,
type: constants.REQUEST_HTTP,
},
});
export const searchAutoCity = keywords => {
......
......@@ -13,14 +13,15 @@ import {
import Cookies from 'js-cookie';
import { withRouter } from 'react-router-dom';
import styles from './index.less';
import services from '../../api/service/base';
import services, { changePassword } from '../../api/service/base';
const formItemLayout = {
labelCol: {
xs: { span: 4 },
sm: { span: 4 },
},
};
const UPLOAD_FILE_URL = "/cityinterface/rest/services/filedownload.svc/uploadfile/个人信息/{path}/{filename}";
const UPLOAD_FILE_URL =
'/cityinterface/rest/services/filedownload.svc/uploadfile/个人信息/{path}/{filename}';
/* eslint-disable */
const getIOT = () =>
window.globalConfig.loginTemplate === 'Dark - IOTMultiLogin.html';
......@@ -113,7 +114,7 @@ class AvatarDropdown extends React.Component {
newpassword: res.newPwd,
token: window.globalConfig.token,
};
services.changePassword(params)
changePassword(params)
.then(res => {
if (res.success) {
message.success('修改密码成功');
......
......@@ -472,6 +472,7 @@ class Login {
const password = decode(pwd.substring(0, pwd.length - 3));
const self = this;
// eslint-disable-next-line no-undef
services
.generateToken({
f: 'json',
......@@ -640,14 +641,7 @@ class Login {
login(usr, pwd, userPhone, isRememberPWD) {
this.events.removeAllListeners('loginError');
const self = this;
// eslint-disable-next-line no-undef
// services.authorizationToken({
// loginName: usr,
// password: pwd ? sha1(pwd).toUpperCase() : '',
// type: "database"
// }).then(res => {
// console.log(res)
// })
debugger
services.generateToken(
{
f: 'json',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment