refactor user and app service

This commit is contained in:
2024-03-12 00:34:58 +08:00
parent 9c6cbd91ff
commit eaa22dcaa5
3 changed files with 37 additions and 27 deletions
+2 -11
View File
@@ -1,7 +1,6 @@
import { AtList, AtListItem, AtToast } from 'taro-ui';
import { Component, ReactNode } from 'react';
import { View, Picker, Image, Text } from '@tarojs/components';
import { getUrl } from '@/service';
import Taro from '@tarojs/taro';
import type CustomTabBar from '@/custom-tab-bar';
import PageFooter from '@/components/PageFooter/PageFooter';
@@ -9,6 +8,7 @@ import aboutIcon from '@/assets/icons/AboutPage/about.svg';
import pt, { Lang } from '@/plain-text';
import wechatUser from '@/wechat';
import logo from '@/assets/images/UserPage/logo.png';
import { setLocaleData } from '@/service/localeData';
import './user.scss';
const listLangInterval = 20;
@@ -70,16 +70,7 @@ export default class UserPage extends Component {
});
let currentLang = this.showLangDict[this.state.selector[e.detail.value]];
pt.setLang(currentLang);
Taro.request({
url: getUrl('/user/locale/update'),
method: 'POST',
data: {
token: 'token_test',
lang: currentLang,
},
}).then(res => {
console.log(res.data);
});
setLocaleData(currentLang);
Taro.reLaunch({
url: '/pages/user/user',
});