Commit af6ad8c2 by Chao Sun

ydLife接口迁移对接

parent 3509b8f2
......@@ -19,7 +19,7 @@ export class AuthService {
redirectUrl: string;
// 经纪人登陆
login(loginInfo): Observable<any> {
const api = this.ydapi + '/ydapi/practitioner/login';
const api = this.ydapi + '/practitioner/login';
return this.http.post(api, JSON.stringify(loginInfo));
}
......@@ -53,7 +53,7 @@ export class AuthService {
//获取微信配置ydLife公众号
ydWxConfig(Currenturl) {
const url = this.ydapi + '/ydapi/wxConfig';
const url = this.ydapi + '/wxConfig';
const postUrl = {
url: Currenturl
};
......
import { Component, OnDestroy, OnInit } from '@angular/core';
import { NavigationExtras, Router } from '@angular/router';
import { AuthService } from '../auth.service';
import { LifeCommonService } from '../../common/life-common.service';
@Component({
selector: 'ydlife-login',
......@@ -21,7 +21,7 @@ export class LoginComponent implements OnInit, OnDestroy {
isNeedAlert: boolean;
dialogInfo: any;
redirect: any;
constructor(public authService: AuthService, public router: Router) {
constructor(public authService: AuthService, public router: Router, public lifeCommonService: LifeCommonService) {
}
ngOnInit() {
......@@ -54,14 +54,26 @@ export class LoginComponent implements OnInit, OnDestroy {
localStorage.setItem('lifeCustomerInfo', JSON.stringify(lifeCustomerInfo));
//如果有openId跳页由后端判断,没有的话根据登录次数前端判断跳页
if (response['data']['getOpenIdUrl']) {
window.location.href = response['data']['getOpenIdUrl'];
const deviceType = this.lifeCommonService.checkDeviceType()
if (deviceType == 3) {
window.location.href = response['data']['getOpenIdUrl'];
} else {
if (response['data']['loginTimes'] > 0) {
this.redirect = this.authService.redirectUrl ? this.router.parseUrl(this.authService.redirectUrl) : '/my';
this.router.navigateByUrl(this.redirect);
} else {
this.redirect = this.authService.redirectUrl ? this.router.parseUrl(this.authService.redirectUrl) : '/thanks';
this.router.navigateByUrl(this.redirect);
}
}
} else {
if (response['data']['loginTimes'] > 0) {
this.redirect = this.authService.redirectUrl ? this.router.parseUrl(this.authService.redirectUrl) : '/my';
this.router.navigateByUrl(this.redirect);
} else {
this.redirect = this.authService.redirectUrl ? this.router.parseUrl(this.authService.redirectUrl) : '/thanks';
this.router.navigateByUrl(this.redirect);
}
this.router.navigateByUrl(this.redirect);
}
// if (response['data']['loginTimes'] > 0) {
// this.redirect = this.authService.redirectUrl ? this.router.parseUrl(this.authService.redirectUrl) : '/my';
......
......@@ -137,7 +137,6 @@ export class MyBusinessDetailComponent implements OnInit {
this.myService.tagQuery({ tagType: 2, isActive: 1 }).subscribe((res) => {
if (res['success']) {
this.tagList = res['data']['tagVOs'];
}
})
}
......@@ -155,7 +154,6 @@ export class MyBusinessDetailComponent implements OnInit {
this.editBusiness.opportunityCustomerTags = this.tagList.filter((item) => {
return item.selected == true;
})
}
//选男女
......
......@@ -63,7 +63,7 @@ export class MyService {
//经纪人商机列表
ownOpportunityQuery(param) {
const url = this.API + "/practitioner/ownOpportunityQuery";
const url = this.ydapi + "/practitioner/ownOpportunityQuery";
return this.http.post(url, JSON.stringify(param)).pipe(res => {
return res;
});
......@@ -71,14 +71,14 @@ export class MyService {
//经纪人商机详情
ownOpportunityDetailQuery(param) {
const url = this.API + "/practitioner/ownOpportunityDetailQuery";
const url = this.ydapi + "/practitioner/ownOpportunityDetailQuery";
return this.http.post(url, JSON.stringify(param)).pipe(res => {
return res;
});
}
//经纪人修改商机跟进信息
ownOpportunityRecordSave(param) {
const url = this.API + "/practitioner/ownOpportunityRecordSave";
const url = this.ydapi + "/practitioner/ownOpportunityRecordSave";
return this.http.post(url, JSON.stringify(param)).pipe(res => {
return res;
});
......@@ -94,7 +94,7 @@ export class MyService {
//商机基本信息保存
ownOpportunityBasicInformationSave(param) {
const url = this.API + "/practitioner/ownOpportunityBasicInformationSave";
const url = this.ydapi + "/practitioner/ownOpportunityBasicInformationSave";
return this.http.post(url, JSON.stringify(param)).pipe(res => {
return res;
});
......@@ -135,32 +135,32 @@ export class MyService {
//下载多媒体文件接口
mediaGet(mediaId) {
const url = this.ydapi + '/ydapi/practitioner/mediaGet';
const url = this.ydapi + '/practitioner/mediaGet';
return this.http.post(url, JSON.stringify(mediaId));
}
//设置查询
mySettingQuery(practitionerId) {
const url = this.ydapi + '/ydapi/practitioner/settingQuery';
const url = this.ydapi + '/practitioner/settingQuery';
return this.http.post(url, JSON.stringify(practitionerId));
}
//我的设置保存
mySettingSave(param) {
const url = this.ydapi + '/ydapi/practitioner/settingSave';
const url = this.ydapi + '/practitioner/settingSave';
return this.http.post(url, JSON.stringify(param));
}
//删除生活照
myImgDelete(param) {
const url = this.ydapi + '/ydapi/practitioner/imgDelete';
const url = this.ydapi + '/practitioner/imgDelete';
return this.http.post(url, JSON.stringify(param));
}
//排行榜
rank(param) {
const url = this.ydapi + '/ydapi/practitioner/rank';
const url = this.ydapi + '/practitioner/rank';
return this.http
.post(url, JSON.stringify(param));
}
......
......@@ -69,6 +69,8 @@
margin-right: 1%;
position: relative;
margin-bottom: 5px;
overflow: hidden;
height: 30px;
li.icon .iconfont{
position: absolute;
}
......@@ -79,7 +81,7 @@
}
li:nth-child(2),li:nth-child(3){
width: 25%;
}
}
li:nth-child(4){
text-align: right;
color: #ff002a;
......
......@@ -116,6 +116,8 @@
margin-right: 1%;
position: relative;
margin-bottom: 5px;
overflow: hidden;
height: 30px;
li.icon .iconfont{
position: absolute;
}
......
export const environment = {
production: true,
BACKEND_URL_CONFIG_VALUE: 'https://m.zuihuibi.cn/api',
ORIGINNAME: 'https://m.zuihuibi.cn',
ORIGINNAME: 'https://m.zuihuibi.cn/ydapi',
BAIDU_TONGJI_CODE: '36b1eb7eec3b5dac9f97d887092b5b27'
};
......@@ -4,6 +4,6 @@
export const environment = {
production: true,
BACKEND_URL_CONFIG_VALUE: 'https://mstage.zuihuibi.cn/api',
ORIGINNAME: 'https://mstage.zuihuibi.cn',
ORIGINNAME: 'https://mstage.zuihuibi.cn/ydapi',
BAIDU_TONGJI_CODE: '84be9b9eaaca51048f32bb160ccad2e6'
};
......@@ -6,6 +6,6 @@
export const environment = {
production: false,
BACKEND_URL_CONFIG_VALUE: 'https://mdev.zuihuibi.cn/api',
ORIGINNAME: 'https://mdev.zuihuibi.cn',
ORIGINNAME: 'https://mdev.zuihuibi.cn/ydapi',
BAIDU_TONGJI_CODE: 'e8fa107d82e0471d097d545225aeed64'
};
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