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 = { ...@@ -2,10 +2,10 @@ module.exports = {
dev: { dev: {
'/CityInterface': { '/CityInterface': {
// target: 'http://192.168.10.151:8055', // 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: '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.10.150:8050',
// target: 'http://192.168.19.103:8112', // target: 'http://192.168.19.103:8112',
// target: 'http://192.168.12.8:8098', // target: 'http://192.168.12.8:8098',
...@@ -21,9 +21,9 @@ module.exports = { ...@@ -21,9 +21,9 @@ module.exports = {
'/cityinterface': { '/cityinterface': {
// target: 'http://192.168.10.151:8055', // target: 'http://192.168.10.151:8055',
// target: 'http://192.168.10.150:8050', // 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: '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.12.8:8098',
// target: 'http://192.168.10.20:8888', // target: 'http://192.168.10.20:8888',
changeOrigin: true, changeOrigin: true,
...@@ -52,9 +52,9 @@ module.exports = { ...@@ -52,9 +52,9 @@ module.exports = {
// target: 'http://192.168.12.8:8098', // target: 'http://192.168.12.8:8098',
// target: 'http://192.168.10.20:8888', // target: 'http://192.168.10.20:8888',
// target: 'http://192.168.10.151:8055', // 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: '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.10.150:8050',
changeOrigin: true, changeOrigin: true,
headers: { headers: {
......
...@@ -7237,9 +7237,9 @@ ...@@ -7237,9 +7237,9 @@
} }
}, },
"@wisdom-utils/utils": { "@wisdom-utils/utils": {
"version": "0.0.25", "version": "0.0.26",
"resolved": "https://g.civnet.cn:4873/@wisdom-utils%2futils/-/utils-0.0.25.tgz", "resolved": "https://g.civnet.cn:4873/@wisdom-utils%2futils/-/utils-0.0.26.tgz",
"integrity": "sha512-TIr8ik6laFs+L40vqKEEELj86l9qawiRjB3TNvdBNkez7geIp2LhIljo/uMJp7DegImxTZRSZJ3cULcLZtelBQ==", "integrity": "sha512-O3PVT0tX4fng0Jee02ArzcIZrRhvQGbD8iVVjRKuahuWPKQtR1jFIHS7Y1W0gJz9bW+4ECUUlkcev8OXE668Zw==",
"requires": { "requires": {
"axios": "^0.21.1", "axios": "^0.21.1",
"cookie": "^0.4.1", "cookie": "^0.4.1",
...@@ -86,7 +86,7 @@ ...@@ -86,7 +86,7 @@
"@babel/polyfill": "7.4.3", "@babel/polyfill": "7.4.3",
"@babel/runtime": "^7.10.5", "@babel/runtime": "^7.10.5",
"@wisdom-utils/components": "0.0.6", "@wisdom-utils/components": "0.0.6",
"@wisdom-utils/utils": "0.0.25", "@wisdom-utils/utils": "0.0.26",
"animate.css": "^4.1.1", "animate.css": "^4.1.1",
"chalk": "2.4.2", "chalk": "2.4.2",
"compression": "1.7.4", "compression": "1.7.4",
......
import { service, jsonp } from '@wisdom-utils/utils'; import { service, jsonp, request } from '@wisdom-utils/utils';
import constants from '../constants'; import constants from '../constants';
export const API = { export const API = {
AUTHORIZATION_TOKEN: '/Publish/Identity/AuthorizationToken', AUTHORIZATION_TOKEN: '/Publish/Identity/AuthorizationToken',
...@@ -45,17 +45,6 @@ const services = service({ ...@@ -45,17 +45,6 @@ const services = service({
method: constants.REQUEST_METHOD_GET, method: constants.REQUEST_METHOD_GET,
type: constants.REQUEST_HTTP, 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: { generatetokenByqrcode: {
url: API.GENERATE_QRCODE, url: API.GENERATE_QRCODE,
method: constants.REQUEST_METHOD_GET, method: constants.REQUEST_METHOD_GET,
...@@ -115,16 +104,6 @@ const services = service({ ...@@ -115,16 +104,6 @@ const services = service({
method: constants.REQUEST_METHOD_GET, method: constants.REQUEST_METHOD_GET,
type: constants.REQUEST_HTTP, 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: { getVersion: {
url: API.GET_VERSION, url: API.GET_VERSION,
method: constants.REQUEST_METHOD_GET, method: constants.REQUEST_METHOD_GET,
...@@ -135,6 +114,24 @@ const services = service({ ...@@ -135,6 +114,24 @@ const services = service({
method: constants.REQUEST_METHOD_GET, method: constants.REQUEST_METHOD_GET,
type: constants.REQUEST_HTTP, 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 => { export const searchAutoCity = keywords => {
......
...@@ -13,14 +13,15 @@ import { ...@@ -13,14 +13,15 @@ import {
import Cookies from 'js-cookie'; import Cookies from 'js-cookie';
import { withRouter } from 'react-router-dom'; import { withRouter } from 'react-router-dom';
import styles from './index.less'; import styles from './index.less';
import services from '../../api/service/base'; import services, { changePassword } from '../../api/service/base';
const formItemLayout = { const formItemLayout = {
labelCol: { labelCol: {
xs: { span: 4 }, xs: { span: 4 },
sm: { 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 */ /* eslint-disable */
const getIOT = () => const getIOT = () =>
window.globalConfig.loginTemplate === 'Dark - IOTMultiLogin.html'; window.globalConfig.loginTemplate === 'Dark - IOTMultiLogin.html';
...@@ -113,7 +114,7 @@ class AvatarDropdown extends React.Component { ...@@ -113,7 +114,7 @@ class AvatarDropdown extends React.Component {
newpassword: res.newPwd, newpassword: res.newPwd,
token: window.globalConfig.token, token: window.globalConfig.token,
}; };
services.changePassword(params) changePassword(params)
.then(res => { .then(res => {
if (res.success) { if (res.success) {
message.success('修改密码成功'); message.success('修改密码成功');
......
...@@ -472,6 +472,7 @@ class Login { ...@@ -472,6 +472,7 @@ class Login {
const password = decode(pwd.substring(0, pwd.length - 3)); const password = decode(pwd.substring(0, pwd.length - 3));
const self = this; const self = this;
// eslint-disable-next-line no-undef // eslint-disable-next-line no-undef
services services
.generateToken({ .generateToken({
f: 'json', f: 'json',
...@@ -640,14 +641,7 @@ class Login { ...@@ -640,14 +641,7 @@ class Login {
login(usr, pwd, userPhone, isRememberPWD) { login(usr, pwd, userPhone, isRememberPWD) {
this.events.removeAllListeners('loginError'); this.events.removeAllListeners('loginError');
const self = this; const self = this;
// eslint-disable-next-line no-undef debugger
// services.authorizationToken({
// loginName: usr,
// password: pwd ? sha1(pwd).toUpperCase() : '',
// type: "database"
// }).then(res => {
// console.log(res)
// })
services.generateToken( services.generateToken(
{ {
f: 'json', 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