李双庆 1 year ago
parent
commit
d33582186e
  1. 15
      pages/student/login/login.vue

15
pages/student/login/login.vue

@ -36,14 +36,14 @@
</template> </template>
<script> <script>
import medicationApi from '@/api/medication.js'; import medicationApi from '@/api/medication.js';
export default { export default {
data() { data() {
return { return {
password: true, password: true,
user: '',// user: '18888888888', //
password1: ''// password1: '123456' //
} }
}, },
onLoad() { onLoad() {
@ -70,20 +70,17 @@ import medicationApi from '@/api/medication.js';
// //
medicationApi.login(item).then(res => { medicationApi.login(item).then(res => {
if (res.code == 1) { if (res.code == 1) {
res.data.userType = 2
uni.setStorageSync('token', res.data.token); uni.setStorageSync('token', res.data.token);
uni.setStorageSync('userType', res.data.userType); uni.setStorageSync('userType', res.data.userType);
let url_path = '' let url_path = ''
switch (String(res.data.userType)) { switch (String(res.data.userType)) {
case '1':// case '1': //
url_path = '/pages/coach/home/index' url_path = '/pages/coach/home/index'
break; break;
case '2':// case '2': //
url_path = '/pages/market/index/index' url_path = '/pages/market/index/index'
break; break;
case '3':// case '3': //
url_path = '/pages/student/index/index' url_path = '/pages/student/index/index'
break; break;
default: default:

Loading…
Cancel
Save