🔧 config: 重新配置统一登陆环境域名

This commit is contained in:
wangsongsole 2023-05-09 11:14:53 +08:00
parent ca07160d51
commit b399dfa2ec
2 changed files with 12 additions and 11 deletions

View File

@ -4,31 +4,32 @@ import { Notify } from 'zent';
// const Version = "v1.3.0";
// window.baseurl = 'http://pre.marketapi.1688sup.com'
let baseurl = '';
let unifiedApi = '';
let download_url = 'https://ewm.83323.cn';
// 测试环境
if (process.env.NODE_ENV == 'test' || process.env.NODE_ENV == 'development') {
if (process.env.NODE_ENV == 'test') {
baseurl = 'http://test.marketapi.1688sup.com';
window.baseurl = 'http://test.marketapi.1688sup.com';
window.unifiedUrl = 'http://test.user.1688sup.com/';
unifiedApi = 'http://api.test.user.1688sup.com/v1/';
window.unifiedUrl = 'http://test.user.1688sup.com/#/login';
}
// 生产环境
if (process.env.NODE_ENV == 'production') {
baseurl = 'https://marketapi.1688sup.com';
window.baseurl = 'https://marketapi.1688sup.com';
window.unifiedUrl = 'https://user.1688sup.com/';
unifiedApi = 'https://api.user.1688sup.com/v1/';
window.unifiedUrl = 'https://user.1688sup.com/#/login';
}
/* 开发环境 */
if (process.env.NODE_ENV == 'development') {
window.unifiedUrl = 'http://192.168.7.200:8888/';
baseurl = 'http://test.marketapi.1688sup.com';
window.baseurl = 'http://test.marketapi.1688sup.com';
unifiedApi = 'http://192.168.7.127:8000/v1/';
window.unifiedUrl = 'http://192.168.7.200:8888/#/login';
}
const ApiUrl =
process.env.NODE_ENV === 'development'
? 'http://192.168.7.127:8000'
: window.unifiedUrl + 'api';
const upload = (method, url, params, responseType) => {
let obj = {
method: method,
@ -649,7 +650,7 @@ export const postLoginStandby = (data) => {
//获取权限codes
export const getCodes = () => {
return req('get', `${ApiUrl}/v1/menu/myCodes?systemId=2`);
return req('get', `${unifiedApi}/menu/myCodes?systemId=2`);
};
// logout退出登录

View File

@ -41,7 +41,7 @@ export default class App extends Component {
/* 跳转统一登录平台 */
toUnifiedLogin() {
setTimeout(() => {
window.location.href = `${window.unifiedUrl}#/?url=${encodeURIComponent(
window.location.href = `${window.unifiedUrl}?url=${encodeURIComponent(
window.location.href
)}`;
}, 1500);