|
@@ -8,6 +8,8 @@ import 'normalize.css'
|
|
|
import '../styles/index.less'
|
|
|
import { promisefiyPostMessage } from '@/helpers/native-message';
|
|
|
import { setAuth } from './music-group/layout/utils';
|
|
|
+import { browser } from '@/helpers/utils';
|
|
|
+import { state } from '@/state';
|
|
|
|
|
|
// 获取token
|
|
|
promisefiyPostMessage({ api: 'getToken' }).then((res: any) => {
|
|
@@ -18,6 +20,26 @@ promisefiyPostMessage({ api: 'getToken' }).then((res: any) => {
|
|
|
}
|
|
|
})
|
|
|
|
|
|
+const paymentType = (window as any).paymentType // 浏览器设置
|
|
|
+if (browser().isTeacher || paymentType === 'TEACHER') {
|
|
|
+ state.platformType = 'TEACHER'
|
|
|
+} else if (browser().isStudent || paymentType === 'STUDENT') {
|
|
|
+ state.platformType = 'STUDENT'
|
|
|
+} else if (browser().isSchool || paymentType === 'SCHOOL') {
|
|
|
+ state.platformType = 'SCHOOL'
|
|
|
+} else {
|
|
|
+ state.platformType = 'STUDENT'
|
|
|
+}
|
|
|
+if (state.platformType === 'TEACHER') {
|
|
|
+ state.platformApi = '/api-teacher'
|
|
|
+} else if (state.platformType === 'SCHOOL') {
|
|
|
+ state.platformApi = '/api-school'
|
|
|
+} else if (state.platformType === 'STUDENT') {
|
|
|
+ state.platformApi = '/api-student'
|
|
|
+} else {
|
|
|
+ state.platformApi = '/api-student'
|
|
|
+}
|
|
|
+
|
|
|
|
|
|
// import Vconsole from 'vconsole'
|
|
|
// const vconsole = new Vconsole()
|