fix: 20230215 修改运行文档

main
ch 2 years ago
parent 824eb40e39
commit 1ffeaa8d0b

@ -6,6 +6,34 @@ node 16.15.1
2、安装依赖 npm install
3、运行h5端npm run dev:h5
## 修改请求前缀
## 修改请求前缀(服务端地址)
### APP或模拟器时
1、双击登录页的“飞滴出行一路畅行” 进入设置页
2、点击首页的设置进入设置页
### 运行h5端时
1、找到根目录vite.config.js
```js
...
// 浏览器本地开发代理配置
proxy: {
"/api": {
target: "http://192.168.40.193:8081",
changeOrigin: true,
rewrite: (path) => path.replace(/^\/api/, "/")
},
"/sseApi": {
target: "http://192.168.40.193:60001",
changeOrigin: true,
rewrite: (path) => path.replace(/^\/sseApi/, "/")
},
"/payApi": {
target: "http://192.168.40.193:9001",
changeOrigin: true,
rewrite: (path) => path.replace(/^\/payApi/, "/")
},
},
...
```

@ -17,6 +17,7 @@ import { _IsPhone } from '@gykeji/jsutil';
import {computed, onMounted, ref} from 'vue';
import {ApiGetVerifyCode, ApiPostVerifyCodeCheck} from '../api/user'
import {HandleApiError, ShowToast} from '../utils';
import { ApiGetUserInfo } from "./api/user";
import {useStore} from 'vuex';
const $store = useStore();
@ -60,9 +61,21 @@ const handleLogin = async () =>{
if(!HandleApiError(error)){
$store.commit('setToken', result.accessToken);
await getUserInfo()
uni.redirectTo({url:'/pages/index/index'});
}
}
/**
* @Description: 获取用户信息
* @return {*}
*/
const getUserInfo = async () => {
const { error, result } = await ApiGetUserInfo();
if (result) {
$store.commit("setUserInfo", result);
}
};
const calcTimer = () =>{
codeTimerNum.value--;
if(codeTimerNum.value === 0){

Binary file not shown.
Loading…
Cancel
Save