consumerm模块完成度90%,完善消费者和商家端数据库表,商品、聊天、订单数据对接好了supabase,和商家端对接了聊天功能,安卓端编译通过了css样式,剩余几个页面在处理函数规范问题
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { AkReqUploadOptions, AkReqOptions, AkReqResponse, AkReqError } from './interface.uts';
|
||||
import { SUPA_URL } from '@/ak/config.uts';
|
||||
import { SUPA_URL, IS_TEST_MODE } from '@/ak/config.uts';
|
||||
|
||||
// token 持久化 key
|
||||
const ACCESS_TOKEN_KEY = 'akreq_access_token';
|
||||
@@ -231,8 +231,9 @@ export class AkReq {
|
||||
} catch (e) {}
|
||||
try {
|
||||
// 动态读取配置,避免 ak-req 模块与业务工程强耦合
|
||||
const cfg = require('@/ak/config.uts') as any
|
||||
const isTest = cfg != null ? (cfg.IS_TEST_MODE === true) : false
|
||||
// const cfg = require('@/ak/config.uts') as any
|
||||
// const isTest = cfg != null ? (cfg.IS_TEST_MODE === true) : false
|
||||
const isTest = IS_TEST_MODE
|
||||
// if (!isTest) {
|
||||
// uni.reLaunch({ url: '/pages/user/login' });
|
||||
// }
|
||||
|
||||
@@ -19,21 +19,29 @@ function t(key: string, values: UTSJSONObject | null = null, locale: string | nu
|
||||
}
|
||||
|
||||
// 创建响应式 locale 对象
|
||||
const localeObj = {
|
||||
get value(): string {
|
||||
return currentLocale
|
||||
},
|
||||
set value(newLocale: string) {
|
||||
currentLocale = newLocale
|
||||
class LocaleWrapper {
|
||||
get value(): string {
|
||||
return currentLocale
|
||||
}
|
||||
set value(newLocale: string) {
|
||||
currentLocale = newLocale
|
||||
}
|
||||
}
|
||||
const localeObj = new LocaleWrapper()
|
||||
|
||||
// I18n Global Context
|
||||
class I18nGlobal {
|
||||
t(key: string, values: UTSJSONObject | null = null, locale: string | null = null): string {
|
||||
return t(key, values, locale)
|
||||
}
|
||||
locale: LocaleWrapper = localeObj
|
||||
}
|
||||
|
||||
// 导出 i18n 对象(兼容 Vue I18n 的 API)
|
||||
const i18nInstance = {
|
||||
global: {
|
||||
t: t,
|
||||
locale: localeObj
|
||||
}
|
||||
// I18n Instance
|
||||
class I18nInstance {
|
||||
global: I18nGlobal = new I18nGlobal()
|
||||
}
|
||||
|
||||
export default i18nInstance
|
||||
// 导出 i18n 对象
|
||||
const i18n = new I18nInstance()
|
||||
export default i18n
|
||||
|
||||
Reference in New Issue
Block a user