longz
2026-06-29 9d4cbff7464ebfd7803c2ce53ded49d0f73fe011
yuyueMiniProgram/src/main.ts
@@ -3,6 +3,45 @@
import router from './router'
import 'uno.css'
if (typeof globalThis.TextEncoder === 'undefined') {
  class MiniTextEncoder {
    encode(input = '') {
      const bytes: number[] = []
      for (const char of input) {
        const codePoint = char.codePointAt(0) ?? 0
        if (codePoint <= 0x7F) {
          bytes.push(codePoint)
          continue
        }
        if (codePoint <= 0x7FF) {
          bytes.push(
            0xC0 | (codePoint >> 6),
            0x80 | (codePoint & 0x3F),
          )
          continue
        }
        if (codePoint <= 0xFFFF) {
          bytes.push(
            0xE0 | (codePoint >> 12),
            0x80 | ((codePoint >> 6) & 0x3F),
            0x80 | (codePoint & 0x3F),
          )
          continue
        }
        bytes.push(
          0xF0 | (codePoint >> 18),
          0x80 | ((codePoint >> 12) & 0x3F),
          0x80 | ((codePoint >> 6) & 0x3F),
          0x80 | (codePoint & 0x3F),
        )
      }
      return new Uint8Array(bytes)
    }
  }
  globalThis.TextEncoder = MiniTextEncoder as typeof TextEncoder
}
const pinia = createPinia()
pinia.use(persistPlugin)
export function createApp() {