|
@@ -605,11 +605,7 @@ watch(
|
|
|
// 更新余额
|
|
|
clearInterval(timer.value);
|
|
|
timer.value = setInterval(() => {
|
|
|
- getChromeStorage('userInfo', (res) => {
|
|
|
- if (res && res.accessToken) {
|
|
|
- getCurrencyInfo();
|
|
|
- }
|
|
|
- });
|
|
|
+ getCurrencyInfo();
|
|
|
}, 10000)
|
|
|
} else {
|
|
|
clearInterval(timer.value);
|
|
@@ -1361,22 +1357,25 @@ const getLocalCurrencyInfoByCode = () => {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-const getCurrencyInfo = () => {
|
|
|
- getChromeStorage('selectCurrencyInfo', (res) => {
|
|
|
- if(res && res.currencyCode) {
|
|
|
- getCurrencyInfoByCode({
|
|
|
- params: {
|
|
|
- currencyCode: res.currencyCode
|
|
|
- }
|
|
|
- }).then(res => {
|
|
|
- if(res.code == 0 && res.data) {
|
|
|
- currentCurrencyInfo.value = res.data;
|
|
|
- tempCurrentCurrencyInfo.value = res.data;
|
|
|
- onIptSetErrorTxt();
|
|
|
- }
|
|
|
- });
|
|
|
- }
|
|
|
- })
|
|
|
+const getCurrencyInfo = async () => {
|
|
|
+ let {accessToken = ''} = await getChromeStorage('userInfo') || {};
|
|
|
+ if (accessToken) {
|
|
|
+ getChromeStorage('selectCurrencyInfo', (res) => {
|
|
|
+ if(res && res.currencyCode) {
|
|
|
+ getCurrencyInfoByCode({
|
|
|
+ params: {
|
|
|
+ currencyCode: res.currencyCode
|
|
|
+ }
|
|
|
+ }).then(res => {
|
|
|
+ if(res.code == 0 && res.data) {
|
|
|
+ currentCurrencyInfo.value = res.data;
|
|
|
+ tempCurrentCurrencyInfo.value = res.data;
|
|
|
+ onIptSetErrorTxt();
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
onMounted(() => {
|