Compare commits
No commits in common. "b17fe89b16cbc661a6b14409d68ad89feb5c1b6c" and "30251f503523f97a2d5bc5d604a3c630bf61819a" have entirely different histories.
b17fe89b16
...
30251f5035
|
|
@ -1,3 +0,0 @@
|
||||||
别名:store_manage
|
|
||||||
密码:123456a
|
|
||||||
包名:com.lottery.store
|
|
||||||
Binary file not shown.
Binary file not shown.
|
|
@ -4,13 +4,14 @@ import { useUserStoreWithOut } from '@/store/modules/user';
|
||||||
const { apiUrl } = useGlobSetting();
|
const { apiUrl } = useGlobSetting();
|
||||||
const systemInfo = uni.getSystemInfoSync();
|
const systemInfo = uni.getSystemInfoSync();
|
||||||
const http = new Request();
|
const http = new Request();
|
||||||
|
|
||||||
http.setConfig((config) => {
|
http.setConfig((config) => {
|
||||||
config.baseURL = apiUrl;
|
config.baseURL = apiUrl;
|
||||||
config.timeout = 10000;
|
config.timeout = 10000;
|
||||||
config.header = Object.assign({
|
config.header = Object.assign({
|
||||||
Accept: 'application/json',
|
Accept: 'application/json',
|
||||||
'app-cli-os': systemInfo.platform,
|
// 'app-cli-os': android/ios,
|
||||||
'app-cli-version': systemInfo.appVersionCode
|
// 'app-cli-version': 100
|
||||||
}, config.header);
|
}, config.header);
|
||||||
/* 设置全局配置 */
|
/* 设置全局配置 */
|
||||||
config.validateStatus = (statusCode) => {
|
config.validateStatus = (statusCode) => {
|
||||||
|
|
@ -50,7 +51,7 @@ http.interceptors.response.use(async (response) => {
|
||||||
// 处理响应结果
|
// 处理响应结果
|
||||||
const { statusCode, data } = response
|
const { statusCode, data } = response
|
||||||
if (statusCode >= 400) {
|
if (statusCode >= 400) {
|
||||||
if (statusCode === 401) {
|
if(statusCode === 401) {
|
||||||
const userStore = useUserStoreWithOut();
|
const userStore = useUserStoreWithOut();
|
||||||
userStore.logout();
|
userStore.logout();
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue