navTo
This commit is contained in:
+33
-5
@@ -1,6 +1,7 @@
|
||||
import pageUrl from './pageUrl'
|
||||
import api from '../api/api.js'
|
||||
|
||||
function navTo(obj) {
|
||||
async function navTo(obj) {
|
||||
let token = '';
|
||||
if(process.env.UNI_PLATFORM =="h5"){
|
||||
if(window.location.href.indexOf('//casedata.igandan.com')>-1){
|
||||
@@ -18,11 +19,38 @@ function navTo(obj) {
|
||||
}
|
||||
if (!token) {
|
||||
if(process.env.UNI_PLATFORM =="h5"){
|
||||
let H5url = 'https://dev-wx.igandan.com';
|
||||
if(window.location.href.indexOf('//dev-casedata.igandan.com') == -1) {
|
||||
H5url = 'https://wx.igandan.com'
|
||||
let video_token =cookie.readCookie('video_token');
|
||||
console.log(video_token);
|
||||
if(video_token){
|
||||
const res = await api.h5Login({
|
||||
token: video_token
|
||||
});
|
||||
|
||||
let result = res.data.data;
|
||||
console.log(result);
|
||||
if (window.location.href.indexOf('//casedata.igandan.com')>-1) {
|
||||
uni.setStorageSync("AUTH_TOKEN_CASEDATA",result.token);
|
||||
} else {
|
||||
uni.setStorageSync("DEV_AUTH_TOKEN_CASEDATA",result.token);
|
||||
};
|
||||
uni.setStorageSync("userInfo",{
|
||||
avatar:result.avatar,
|
||||
user_id:result.user_id,
|
||||
status:result.status,
|
||||
user_name:result.user_name,
|
||||
doctor_id:result.doctor_id,
|
||||
});
|
||||
window.location.reload();
|
||||
|
||||
|
||||
|
||||
}else{
|
||||
let H5url = 'https://dev-wx.igandan.com';
|
||||
if(window.location.href.indexOf('//dev-casedata.igandan.com') == -1) {
|
||||
H5url = 'https://wx.igandan.com'
|
||||
}
|
||||
window.location.href = H5url + "/hcp/Signup2020online_tologin?back_url=" + encodeURIComponent(window.location.href);
|
||||
}
|
||||
window.location.href = H5url + "/hcp/Signup2020online_tologin?back_url=" + encodeURIComponent(window.location.href);
|
||||
}else{
|
||||
let page_url = pageUrl();
|
||||
uni.setStorageSync('redirectUrl', page_url);
|
||||
|
||||
Reference in New Issue
Block a user