فهرست منبع

修改hk与cn网址

11wqe1 2 هفته پیش
والد
کامیت
b0cb10c431
3فایلهای تغییر یافته به همراه16 افزوده شده و 12 حذف شده
  1. 6 2
      src/api/user.js
  2. 1 1
      src/store/modules/user.js
  3. 9 9
      src/views/login/loginPage.vue

+ 6 - 2
src/api/user.js

@@ -3,8 +3,12 @@ import axios from '@/common/axios.config'
 import { baseApi } from '@/config'
 
 // 用户信息 post 方法
-export function eduGet() {
-    return axios.get('//beta.api.cocorobo.cn/api/getcookieuserid')
+export function eduGet(re='cn') {
+ 	let _result =
+		re == "hk"
+			? "https://cloud.api.cocorobo.hk/api/getcookieuserid"
+			: "//beta.api.cocorobo.cn/api/getcookieuserid";
+	return axios.get(_result);
 }
 // 获取组织
 export function GetSuffix(data) {

+ 1 - 1
src/store/modules/user.js

@@ -90,7 +90,7 @@ const actions = {
     return new Promise((resolve, reject) => {
       let loginType = window.topU ? window.topU.U.UF.Cookie.get("cocoroboLoginType") : window.parent.U.UF.Cookie.get("cocoroboLoginType");
       if(loginType != 1){
-        eduGet()
+        eduGet(this.$region)
           .then((response) => {
             console.log(response);
             var _user = response.data[0][0];

+ 9 - 9
src/views/login/loginPage.vue

@@ -402,13 +402,13 @@ export default {
 
 			return _result;
 		},
-		// userRequest() {
-		// 	console.log('this.$region',this.$region);
+		userRequest() {
+			console.log('this.$region',this.$region);
 
-		// 	let _result = this.$region == 'hk' ? 'https://cloud.api.cocorobo.hk/api/user' : 'https://beta.api.cocorobo.cn/api/user'
+			let _result = this.$region == 'hk' ? 'https://cloud.api.cocorobo.hk/api/user' : 'https://beta.api.cocorobo.cn/api/user'
 			
-		// 	return _result;
-		// },
+			return _result;
+		},
 	},
 	methods: {
 		...mapActions({
@@ -583,7 +583,7 @@ export default {
 				console.log("👇", this.prefixL);
 				// this.addOp3('1', "", { type:this.prefixL + "login" }, "success",'0c3735c9-a2ef-11ef-9b30-005056b86db5')
 				axios
-					.post("https://beta.api.cocorobo.cn/api/user", qs.stringify(params))
+					.post(this.userRequest, qs.stringify(params))
 					.then(async (res) => {
 						console.log("res", res);
 						let _data = res.data[0][0];
@@ -661,7 +661,7 @@ export default {
 				axios.defaults.withCredentials = true;
 				console.log("👇进入进行微信绑定环节");
 				axios
-					.post("https://beta.api.cocorobo.cn/api/user", qs.stringify(params))
+					.post(this.userRequest, qs.stringify(params))
 					.then(async (res) => {
 						console.log("res", res);
 						let _data = res.data[0][0];
@@ -866,7 +866,7 @@ export default {
 			this.openid = openid;
 			axios.defaults.withCredentials = true;
 			axios
-				.post("https://beta.api.cocorobo.cn/api/user", qs.stringify(params))
+				.post(this.userRequest, qs.stringify(params))
 				.then(async (res) => {
 					console.log("res", res);
 					let _data = res.data[0][0];
@@ -1065,7 +1065,7 @@ export default {
 				};
 				axios.defaults.withCredentials = true;
 				axios
-					.post("https://beta.api.cocorobo.cn/api/user", qs.stringify(params))
+					.post(this.userRequest, qs.stringify(params))
 					.then(async (res) => {
 							console.log("res", res);
 							this.loading = false;