Commit e28f73cf by Chao Sun

接口对接

parent 077afdfc
{
"hash": "ad4518f9",
"browserHash": "8a04698b",
"optimized": {
"nanoid": {
"src": "../../node_modules/nanoid/index.browser.js",
"file": "nanoid.js",
"fileHash": "e6fe08a1",
"needsInterop": false
}
},
"chunks": {}
}
\ No newline at end of file
// E:/work/sfp-program/node_modules/nanoid/url-alphabet/index.js
var urlAlphabet = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
// E:/work/sfp-program/node_modules/nanoid/index.browser.js
var random = (bytes) => crypto.getRandomValues(new Uint8Array(bytes));
var customRandom = (alphabet, defaultSize, getRandom) => {
let mask = (2 << Math.log(alphabet.length - 1) / Math.LN2) - 1;
let step = -~(1.6 * mask * defaultSize / alphabet.length);
return (size = defaultSize) => {
let id = "";
while (true) {
let bytes = getRandom(step);
let j = step;
while (j--) {
id += alphabet[bytes[j] & mask] || "";
if (id.length === size)
return id;
}
}
};
};
var customAlphabet = (alphabet, size = 21) => customRandom(alphabet, size, random);
var nanoid = (size = 21) => crypto.getRandomValues(new Uint8Array(size)).reduce((id, byte) => {
byte &= 63;
if (byte < 36) {
id += byte.toString(36);
} else if (byte < 62) {
id += (byte - 26).toString(36).toUpperCase();
} else if (byte > 62) {
id += "-";
} else {
id += "_";
}
return id;
}, "");
export {
customAlphabet,
customRandom,
nanoid,
random,
urlAlphabet
};
//# sourceMappingURL=nanoid.js.map
{
"version": 3,
"sources": ["../../node_modules/nanoid/url-alphabet/index.js", "../../node_modules/nanoid/index.browser.js"],
"sourcesContent": ["export const urlAlphabet =\n 'useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict'\n", "export { urlAlphabet } from './url-alphabet/index.js'\nexport let random = bytes => crypto.getRandomValues(new Uint8Array(bytes))\nexport let customRandom = (alphabet, defaultSize, getRandom) => {\n let mask = (2 << (Math.log(alphabet.length - 1) / Math.LN2)) - 1\n let step = -~((1.6 * mask * defaultSize) / alphabet.length)\n return (size = defaultSize) => {\n let id = ''\n while (true) {\n let bytes = getRandom(step)\n let j = step\n while (j--) {\n id += alphabet[bytes[j] & mask] || ''\n if (id.length === size) return id\n }\n }\n }\n}\nexport let customAlphabet = (alphabet, size = 21) =>\n customRandom(alphabet, size, random)\nexport let nanoid = (size = 21) =>\n crypto.getRandomValues(new Uint8Array(size)).reduce((id, byte) => {\n byte &= 63\n if (byte < 36) {\n id += byte.toString(36)\n } else if (byte < 62) {\n id += (byte - 26).toString(36).toUpperCase()\n } else if (byte > 62) {\n id += '-'\n } else {\n id += '_'\n }\n return id\n }, '')\n"],
"mappings": ";AAAO,IAAM,cACX;;;ACAK,IAAI,SAAS,WAAS,OAAO,gBAAgB,IAAI,WAAW,KAAK,CAAC;AAClE,IAAI,eAAe,CAAC,UAAU,aAAa,cAAc;AAC9D,MAAI,OAAQ,MAAM,KAAK,IAAI,SAAS,SAAS,CAAC,IAAI,KAAK,OAAQ;AAC/D,MAAI,OAAO,CAAC,CAAG,OAAM,OAAO,cAAe,SAAS;AACpD,SAAO,CAAC,OAAO,gBAAgB;AAC7B,QAAI,KAAK;AACT,WAAO,MAAM;AACX,UAAI,QAAQ,UAAU,IAAI;AAC1B,UAAI,IAAI;AACR,aAAO,KAAK;AACV,cAAM,SAAS,MAAM,KAAK,SAAS;AACnC,YAAI,GAAG,WAAW;AAAM,iBAAO;AAAA,MACjC;AAAA,IACF;AAAA,EACF;AACF;AACO,IAAI,iBAAiB,CAAC,UAAU,OAAO,OAC5C,aAAa,UAAU,MAAM,MAAM;AAC9B,IAAI,SAAS,CAAC,OAAO,OAC1B,OAAO,gBAAgB,IAAI,WAAW,IAAI,CAAC,EAAE,OAAO,CAAC,IAAI,SAAS;AAChE,UAAQ;AACR,MAAI,OAAO,IAAI;AACb,UAAM,KAAK,SAAS,EAAE;AAAA,EACxB,WAAW,OAAO,IAAI;AACpB,UAAO,QAAO,IAAI,SAAS,EAAE,EAAE,YAAY;AAAA,EAC7C,WAAW,OAAO,IAAI;AACpB,UAAM;AAAA,EACR,OAAO;AACL,UAAM;AAAA,EACR;AACA,SAAO;AACT,GAAG,EAAE;",
"names": []
}
...@@ -4,12 +4,17 @@ import App from './App' ...@@ -4,12 +4,17 @@ import App from './App'
// #ifndef VUE3 // #ifndef VUE3
import Vue from 'vue' import Vue from 'vue'
import axios from 'axios' import axios from 'axios'
import api from '@api/api.ts'
Vue.config.productionTip = false;
Vue.prototype.axios = axios;
Vue.prototype.$api = api;
Vue.config.productionTip = false
Vue.prototype.axios = axios
App.mpType = 'app' App.mpType = 'app'
const app = new Vue({ const app = new Vue({
...App api,
...App,
}) })
app.$mount() app.$mount()
// #endif // #endif
......
#!/bin/sh
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
case `uname` in
*CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
esac
if [ -x "$basedir/node" ]; then
"$basedir/node" "$basedir/../nanoid/bin/nanoid.js" "$@"
ret=$?
else
node "$basedir/../nanoid/bin/nanoid.js" "$@"
ret=$?
fi
exit $ret
@ECHO off
SETLOCAL
CALL :find_dp0
IF EXIST "%dp0%\node.exe" (
SET "_prog=%dp0%\node.exe"
) ELSE (
SET "_prog=node"
SET PATHEXT=%PATHEXT:;.JS;=;%
)
"%_prog%" "%dp0%\..\nanoid\bin\nanoid.js" %*
ENDLOCAL
EXIT /b %errorlevel%
:find_dp0
SET dp0=%~dp0
EXIT /b
#!/usr/bin/env pwsh
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
$exe=""
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
# Fix case when both the Windows and Linux builds of Node
# are installed in the same directory
$exe=".exe"
}
$ret=0
if (Test-Path "$basedir/node$exe") {
& "$basedir/node$exe" "$basedir/../nanoid/bin/nanoid.js" $args
$ret=$LASTEXITCODE
} else {
& "node$exe" "$basedir/../nanoid/bin/nanoid.js" $args
$ret=$LASTEXITCODE
}
exit $ret
The MIT License (MIT)
Copyright 2017 Andrey Sitnik <andrey@sitnik.ru>
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
# Nano ID
<img src="https://ai.github.io/nanoid/logo.svg" align="right"
alt="Nano ID logo by Anton Lovchikov" width="180" height="94">
**English** | [Русский](./README.ru.md) | [简体中文](./README.zh-CN.md) | [Bahasa Indonesia](./README.id-ID.md)
A tiny, secure, URL-friendly, unique string ID generator for JavaScript.
> “An amazing level of senseless perfectionism,
> which is simply impossible not to respect.”
* **Small.** 130 bytes (minified and gzipped). No dependencies.
[Size Limit] controls the size.
* **Fast.** It is 2 times faster than UUID.
* **Safe.** It uses hardware random generator. Can be used in clusters.
* **Short IDs.** It uses a larger alphabet than UUID (`A-Za-z0-9_-`).
So ID size was reduced from 36 to 21 symbols.
* **Portable.** Nano ID was ported
to [20 programming languages](#other-programming-languages).
```js
import { nanoid } from 'nanoid'
model.id = nanoid() //=> "V1StGXR8_Z5jdHi6B-myT"
```
Supports modern browsers, IE [with Babel], Node.js and React Native.
[online tool]: https://gitpod.io/#https://github.com/ai/nanoid/
[with Babel]: https://developer.epages.com/blog/coding/how-to-transpile-node-modules-with-babel-and-webpack-in-a-monorepo/
[Size Limit]: https://github.com/ai/size-limit
<a href="https://evilmartians.com/?utm_source=nanoid">
<img src="https://evilmartians.com/badges/sponsored-by-evil-martians.svg"
alt="Sponsored by Evil Martians" width="236" height="54">
</a>
## Docs
Read **[full docs](https://github.com/ai/nanoid#readme)** on GitHub.
export let random = async bytes => crypto.getRandomValues(new Uint8Array(bytes))
export let customAlphabet = (alphabet, defaultSize = 21) => {
let mask = (2 << (Math.log(alphabet.length - 1) / Math.LN2)) - 1
let step = -~((1.6 * mask * defaultSize) / alphabet.length)
return async (size = defaultSize) => {
let id = ''
while (true) {
let bytes = crypto.getRandomValues(new Uint8Array(step))
let i = step
while (i--) {
id += alphabet[bytes[i] & mask] || ''
if (id.length === size) return id
}
}
}
}
export let nanoid = async (size = 21) => {
let id = ''
let bytes = crypto.getRandomValues(new Uint8Array(size))
while (size--) {
let byte = bytes[size] & 63
if (byte < 36) {
id += byte.toString(36)
} else if (byte < 62) {
id += (byte - 26).toString(36).toUpperCase()
} else if (byte < 63) {
id += '_'
} else {
id += '-'
}
}
return id
}
/**
* Generate secure URL-friendly unique ID. The non-blocking version.
*
* By default, the ID will have 21 symbols to have a collision probability
* similar to UUID v4.
*
* ```js
* import { nanoid } from 'nanoid/async'
* nanoid().then(id => {
* model.id = id
* })
* ```
*
* @param size Size of the ID. The default size is 21.
* @returns A promise with a random string.
*/
export function nanoid(size?: number): Promise<string>
/**
* A low-level function.
* Generate secure unique ID with custom alphabet. The non-blocking version.
*
* Alphabet must contain 256 symbols or less. Otherwise, the generator
* will not be secure.
*
* @param alphabet Alphabet used to generate the ID.
* @param defaultSize Size of the ID. The default size is 21.
* @returns A function that returns a promise with a random string.
*
* ```js
* import { customAlphabet } from 'nanoid/async'
* const nanoid = customAlphabet('0123456789абвгдеё', 5)
* nanoid().then(id => {
* model.id = id //=> "8ё56а"
* })
* ```
*/
export function customAlphabet(
alphabet: string,
defaultSize?: number
): (size?: number) => Promise<string>
/**
* Generate an array of random bytes collected from hardware noise.
*
* ```js
* import { random } from 'nanoid/async'
* random(5).then(bytes => {
* bytes //=> [10, 67, 212, 67, 89]
* })
* ```
*
* @param bytes Size of the array.
* @returns A promise with a random bytes array.
*/
export function random(bytes: number): Promise<Uint8Array>
import { randomFill } from 'crypto'
import { urlAlphabet } from '../url-alphabet/index.js'
export let random = bytes =>
new Promise((resolve, reject) => {
randomFill(Buffer.allocUnsafe(bytes), (err, buf) => {
if (err) {
reject(err)
} else {
resolve(buf)
}
})
})
export let customAlphabet = (alphabet, defaultSize = 21) => {
let mask = (2 << (31 - Math.clz32((alphabet.length - 1) | 1))) - 1
let step = Math.ceil((1.6 * mask * defaultSize) / alphabet.length)
let tick = (id, size = defaultSize) =>
random(step).then(bytes => {
let i = step
while (i--) {
id += alphabet[bytes[i] & mask] || ''
if (id.length === size) return id
}
return tick(id, size)
})
return size => tick('', size)
}
export let nanoid = (size = 21) =>
random(size).then(bytes => {
let id = ''
while (size--) {
id += urlAlphabet[bytes[size] & 63]
}
return id
})
import { getRandomBytesAsync } from 'expo-random'
import { urlAlphabet } from '../url-alphabet/index.js'
export let random = getRandomBytesAsync
export let customAlphabet = (alphabet, defaultSize = 21) => {
let mask = (2 << (31 - Math.clz32((alphabet.length - 1) | 1))) - 1
let step = Math.ceil((1.6 * mask * defaultSize) / alphabet.length)
let tick = (id, size = defaultSize) =>
random(step).then(bytes => {
let i = step
while (i--) {
id += alphabet[bytes[i] & mask] || ''
if (id.length === size) return id
}
return tick(id, size)
})
return size => tick('', size)
}
export let nanoid = (size = 21) =>
random(size).then(bytes => {
let id = ''
while (size--) {
id += urlAlphabet[bytes[size] & 63]
}
return id
})
#!/usr/bin/env node
import { nanoid, customAlphabet } from '../index.js'
function print(msg) {
process.stdout.write(msg + '\n')
}
function error(msg) {
process.stderr.write(msg + '\n')
process.exit(1)
}
if (process.argv.includes('--help') || process.argv.includes('-h')) {
print(`
Usage
$ nanoid [options]
Options
-s, --size Generated ID size
-a, --alphabet Alphabet to use
-h, --help Show this help
Examples
$ nanoid --s 15
S9sBF77U6sDB8Yg
$ nanoid --size 10 --alphabet abc
bcabababca`)
process.exit()
}
let alphabet, size
for (let i = 2; i < process.argv.length; i++) {
let arg = process.argv[i]
if (arg === '--size' || arg === '-s') {
size = Number(process.argv[i + 1])
i += 1
if (Number.isNaN(size) || size <= 0) {
error('Size must be positive integer')
}
} else if (arg === '--alphabet' || arg === '-a') {
alphabet = process.argv[i + 1]
i += 1
} else {
error('Unknown argument ' + arg)
}
}
if (alphabet) {
let customNanoid = customAlphabet(alphabet, size)
print(customNanoid())
} else {
print(nanoid(size))
}
export { urlAlphabet } from './url-alphabet/index.js'
export let random = bytes => crypto.getRandomValues(new Uint8Array(bytes))
export let customRandom = (alphabet, defaultSize, getRandom) => {
let mask = (2 << (Math.log(alphabet.length - 1) / Math.LN2)) - 1
let step = -~((1.6 * mask * defaultSize) / alphabet.length)
return (size = defaultSize) => {
let id = ''
while (true) {
let bytes = getRandom(step)
let j = step
while (j--) {
id += alphabet[bytes[j] & mask] || ''
if (id.length === size) return id
}
}
}
}
export let customAlphabet = (alphabet, size = 21) =>
customRandom(alphabet, size, random)
export let nanoid = (size = 21) =>
crypto.getRandomValues(new Uint8Array(size)).reduce((id, byte) => {
byte &= 63
if (byte < 36) {
id += byte.toString(36)
} else if (byte < 62) {
id += (byte - 26).toString(36).toUpperCase()
} else if (byte > 62) {
id += '-'
} else {
id += '_'
}
return id
}, '')
/**
* Generate secure URL-friendly unique ID.
*
* By default, the ID will have 21 symbols to have a collision probability
* similar to UUID v4.
*
* ```js
* import { nanoid } from 'nanoid'
* model.id = nanoid() //=> "Uakgb_J5m9g-0JDMbcJqL"
* ```
*
* @param size Size of the ID. The default size is 21.
* @returns A random string.
*/
export function nanoid(size?: number): string
/**
* Generate secure unique ID with custom alphabet.
*
* Alphabet must contain 256 symbols or less. Otherwise, the generator
* will not be secure.
*
* @param alphabet Alphabet used to generate the ID.
* @param defaultSize Size of the ID. The default size is 21.
* @returns A random string generator.
*
* ```js
* const { customAlphabet } = require('nanoid')
* const nanoid = customAlphabet('0123456789абвгдеё', 5)
* nanoid() //=> "8ё56а"
* ```
*/
export function customAlphabet(
alphabet: string,
defaultSize?: number
): (size?: number) => string
/**
* Generate unique ID with custom random generator and alphabet.
*
* Alphabet must contain 256 symbols or less. Otherwise, the generator
* will not be secure.
*
* ```js
* import { customRandom } from 'nanoid/format'
*
* const nanoid = customRandom('abcdef', 5, size => {
* const random = []
* for (let i = 0; i < size; i++) {
* random.push(randomByte())
* }
* return random
* })
*
* nanoid() //=> "fbaef"
* ```
*
* @param alphabet Alphabet used to generate a random string.
* @param size Size of the random string.
* @param random A random bytes generator.
* @returns A random string generator.
*/
export function customRandom(
alphabet: string,
size: number,
random: (bytes: number) => Uint8Array
): () => string
/**
* URL safe symbols.
*
* ```js
* import { urlAlphabet } from 'nanoid'
* const nanoid = customAlphabet(urlAlphabet, 10)
* nanoid() //=> "Uakgb_J5m9"
* ```
*/
export const urlAlphabet: string
/**
* Generate an array of random bytes collected from hardware noise.
*
* ```js
* import { customRandom, random } from 'nanoid'
* const nanoid = customRandom("abcdef", 5, random)
* ```
*
* @param bytes Size of the array.
* @returns An array of random bytes.
*/
export function random(bytes: number): Uint8Array
import { randomFillSync } from 'crypto'
import { urlAlphabet } from './url-alphabet/index.js'
export { urlAlphabet }
const POOL_SIZE_MULTIPLIER = 128
let pool, poolOffset
let fillPool = bytes => {
if (!pool || pool.length < bytes) {
pool = Buffer.allocUnsafe(bytes * POOL_SIZE_MULTIPLIER)
randomFillSync(pool)
poolOffset = 0
} else if (poolOffset + bytes > pool.length) {
randomFillSync(pool)
poolOffset = 0
}
poolOffset += bytes
}
export let random = bytes => {
fillPool((bytes -= 0))
return pool.subarray(poolOffset - bytes, poolOffset)
}
export let customRandom = (alphabet, defaultSize, getRandom) => {
let mask = (2 << (31 - Math.clz32((alphabet.length - 1) | 1))) - 1
let step = Math.ceil((1.6 * mask * defaultSize) / alphabet.length)
return (size = defaultSize) => {
let id = ''
while (true) {
let bytes = getRandom(step)
let i = step
while (i--) {
id += alphabet[bytes[i] & mask] || ''
if (id.length === size) return id
}
}
}
}
export let customAlphabet = (alphabet, size = 21) =>
customRandom(alphabet, size, random)
export let nanoid = (size = 21) => {
fillPool((size -= 0))
let id = ''
for (let i = poolOffset - size; i < poolOffset; i++) {
id += urlAlphabet[pool[i] & 63]
}
return id
}
export let nanoid=(t=21)=>crypto.getRandomValues(new Uint8Array(t)).reduce(((t,e)=>t+=(e&=63)<36?e.toString(36):e<62?(e-26).toString(36).toUpperCase():e>62?"-":"_"),"");
\ No newline at end of file
/**
* Generate URL-friendly unique ID. This method uses the non-secure
* predictable random generator with bigger collision probability.
*
* ```js
* import { nanoid } from 'nanoid/non-secure'
* model.id = nanoid() //=> "Uakgb_J5m9g-0JDMbcJqL"
* ```
*
* @param size Size of the ID. The default size is 21.
* @returns A random string.
*/
export function nanoid(size?: number): string
/**
* Generate a unique ID based on a custom alphabet.
* This method uses the non-secure predictable random generator
* with bigger collision probability.
*
* @param alphabet Alphabet used to generate the ID.
* @param defaultSize Size of the ID. The default size is 21.
* @returns A random string generator.
*
* ```js
* import { customAlphabet } from 'nanoid/non-secure'
* const nanoid = customAlphabet('0123456789абвгдеё', 5)
* model.id = //=> "8ё56а"
* ```
*/
export function customAlphabet(
alphabet: string,
defaultSize?: number
): (size?: number) => string
let urlAlphabet =
'useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict'
export let customAlphabet = (alphabet, defaultSize = 21) => {
return (size = defaultSize) => {
let id = ''
let i = size
while (i--) {
id += alphabet[(Math.random() * alphabet.length) | 0]
}
return id
}
}
export let nanoid = (size = 21) => {
let id = ''
let i = size
while (i--) {
id += urlAlphabet[(Math.random() * 64) | 0]
}
return id
}
{
"_from": "nanoid",
"_id": "nanoid@4.0.0",
"_inBundle": false,
"_integrity": "sha512-IgBP8piMxe/gf73RTQx7hmnhwz0aaEXYakvqZyE302IXW3HyVNhdNGC+O2MwMAVhLEnvXlvKtGbtJf6wvHihCg==",
"_location": "/nanoid",
"_phantomChildren": {},
"_requested": {
"type": "tag",
"registry": true,
"raw": "nanoid",
"name": "nanoid",
"escapedName": "nanoid",
"rawSpec": "",
"saveSpec": null,
"fetchSpec": "latest"
},
"_requiredBy": [
"#USER",
"/"
],
"_resolved": "https://registry.npmmirror.com/nanoid/-/nanoid-4.0.0.tgz",
"_shasum": "6e144dee117609232c3f415c34b0e550e64999a5",
"_spec": "nanoid",
"_where": "E:\\work\\sfp-program",
"author": {
"name": "Andrey Sitnik",
"email": "andrey@sitnik.ru"
},
"bin": {
"nanoid": "bin/nanoid.js"
},
"browser": {
"./index.js": "./index.browser.js",
"./async/index.js": "./async/index.browser.js",
"./async/index.cjs": "./async/index.browser.cjs"
},
"bugs": {
"url": "https://github.com/ai/nanoid/issues"
},
"bundleDependencies": false,
"deprecated": false,
"description": "A tiny (116 bytes), secure URL-friendly unique string ID generator",
"engines": {
"node": "^14 || ^16 || >=18"
},
"exports": {
".": {
"browser": "./index.browser.js",
"default": "./index.js"
},
"./async": {
"browser": "./async/index.browser.js",
"default": "./async/index.js"
},
"./non-secure": "./non-secure/index.js",
"./package.json": "./package.json"
},
"homepage": "https://github.com/ai/nanoid#readme",
"keywords": [
"uuid",
"random",
"id",
"url"
],
"license": "MIT",
"name": "nanoid",
"react-native": {
"./async/index.js": "./async/index.native.js"
},
"repository": {
"type": "git",
"url": "git+https://github.com/ai/nanoid.git"
},
"sideEffects": false,
"type": "module",
"types": "./index.d.ts",
"version": "4.0.0"
}
export const urlAlphabet =
'useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict'
...@@ -56,6 +56,11 @@ ...@@ -56,6 +56,11 @@
"requires": { "requires": {
"mime-db": "1.52.0" "mime-db": "1.52.0"
} }
},
"nanoid": {
"version": "4.0.0",
"resolved": "https://registry.npmmirror.com/nanoid/-/nanoid-4.0.0.tgz",
"integrity": "sha512-IgBP8piMxe/gf73RTQx7hmnhwz0aaEXYakvqZyE302IXW3HyVNhdNGC+O2MwMAVhLEnvXlvKtGbtJf6wvHihCg=="
} }
} }
} }
.batchCalculateContent{
display: flex;
flex-direction: column;
align-items: center;
}
.claimInfomationContent{
margin-bottom: 40rpx;
}
.radioButton{
position: relative;
width: 40rpx;
height: 40rpx;
border-radius: 50%;
border: 1px solid #CEB07D;
}
.radioButton.selected::after{
content: '';
position: absolute;
left: 0;
top: 0;
width: 20rpx;
height: 20rpx;
transform: translate(10rpx,10rpx);
border-radius: 50%;
background: linear-gradient(135deg, #CEB07D 0%, #FFDDA9 56%, #FED495 100%, #FED495 100%);
}
.logo {
width: 100%;
}
.banner{
height: 400rpx;
}
.banner img{
max-width: 100%;
}
.tabTitle{
display: flex;
justify-content: space-around;
font-size: 16px;
font-family: Source Han Sans CN-Regular, Source Han Sans CN;
font-weight: 400;
color: #333333;
}
.tabTitle text{
position: relative;
}
.tabTitle text.actived::after{
position: absolute;
bottom: -4rpx;
left: 0;
content: '';
width: 100%;
height: 4rpx;
background: linear-gradient(125deg,#CEB07D,#FED597);
}
.formInfoContainer{
background: #fff;
margin-top: -32rpx;
position: relative;
z-index: 2;
border-top-right-radius: 30rpx;
border-top-left-radius: 30rpx;
padding: 30rpx;
box-sizing: border-box;
font-size: 30rpx;
color: #333333;
}
.title{
display: flex;
justify-content: space-between;
align-items: center;
color: #CEB07D;
font-weight: bold;
font-size: 32rpx;
position: relative;
padding-left: 28rpx;
margin: 20rpx 0;
height: 50rpx;
}
.title::before{
content: '';
position: absolute;
left: 0;
top: 15rpx;
width: 6rpx;
height: 20rpx;
background-color: #CEB07D;
border-radius: 8rpx;
}
.inputItem{
display: flex;
justify-content: space-between;
align-items: center;
height: 88rpx;
border-bottom: 1px solid #E4E4E4;
}
.inputItem .inputContent{
display: flex;
align-items: center;
justify-content: flex-end;
flex: 0 0 51%;
}
.inputContent .uni-input{
margin-right: 20rpx;
text-align: right;
}
.inputItem text{
flex: 0 0 49%;
}
.simpleDataResult{
background: #FFFFFF;
box-shadow: 0rpx 0rpx 11rpx 0rpx rgba(0,0,0,0.1);
border-radius: 5rpx;
opacity: 1;
margin: 30rpx 15rpx 56rpx;
padding: 15rpx 17rpx;
}
.simpleDataResult .resultTitle{
font-size: 32rpx;
font-weight: bold;
color: #CEB07D;
}
.simpleDataResult .calcNumber{
text-align: right;
}
.simpleDataResult .inputItem:last-child{
border:none;
}
.simpleDataResult .inputItem .title{
color: #CEB07D;
font-weight: bold;
}
.reduceInsuranceContent .tableTh,.reduceInsuranceContent .tableTd{
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 16rpx;
}
.reduceInsuranceContent .tableTh text{
flex: 1;
}
.reduceInsuranceContent .tableTh text.withdrawNumber,.reduceInsuranceContent .tableTd text.withdrawNumber{
flex: 2;
}
.reduceInsuranceContent .tableTd .uni-input,.reduceInsuranceContent .tableTh text{
text-align: center;
border-bottom: 1px solid #E4E4E4;
padding: 6rpx 24rpx;
margin-right: 20rpx;
}
.reduceInsuranceContent .tableTh text{
border:none;
white-space: nowrap;
color: #333;
}
.reduceInsuranceContent .tableTd:last-child{
margin-bottom: 20rpx;
}
.resultContent{
margin-bottom: 60rpx;
padding-bottom: 60rpx;
}
.optionContent{
position: fixed;
bottom: 0;
left: 0;
width: 100%;
display: flex;
justify-content: center;
align-items: center;
background-color: #fff;
}
.optionContent button{
flex: 0 0 46%;
border:2rpx solid #e7c793;
font-size: 36rpx;
}
.btn{
background: linear-gradient(135deg, #CEB07D 0%, #FFDDA9 56%, #FED495 100%, #FED495 100%);
border: none;
color: #6B4000;
}
.batchDataResult{
box-shadow: 0px 0px 11px 0px rgba(0,0,0,0.1);
margin-top: 32rpx;
}
.batchDataResult .resultTh{
height: 60rpx;
line-height: 60rpx;
background: linear-gradient(135deg, #CEB07D 0%, #FFDDA9 56%, #FED495 100%, #FED495 100%);
border-top-left-radius: 12rpx;
border-top-right-radius: 12rpx;
color: #6B4000;
font-weight: bold;
display: flex;
}
.batchDataResult .resultTd{
display: flex;
height: 60rpx;
align-items: center;
border-bottom: 1px solid #E4E4E4;
}
.batchDataResult .resultTd:last-child{
border-bottom: none;
}
.batchDataResult .resultTh text,.batchDataResult .resultTd text{
flex: 1;
text-align: center;
font-weight: bold;
color: #333333;
}
.batchDataResult .resultTd text.resultNumber{
color: #CEB07D;
}
.cashValueContent{
margin-top: 80rpx;
}
.cashValueContent .title button{
background-color: transparent;
font-size: 30rpx;
color: #333333;
box-sizing: border-box;
line-height: initial;
}
.cashValueContent .title button::after{
border: 1px solid #CEB07D;
border-radius: 12rpx;
}
.cashValueContent .title button:first-child{
margin-right: 40rpx;
}
.cashValueContent .title button.actived{
background: linear-gradient(135deg, #CEB07D 0%, #FFDDA9 56%, #FED495 100%, #FED495 100%);
color: #6B4000;
}
.reduceInsuranceContent text{
display: inline-block;
width: 40rpx!important;
height: 40rpx!important;
line-height: 40rpx!important;
text-align: center;
border:3rpx #CEB07D solid;
color: #CEB07D;
border-radius: 50%;
font-size: 24rpx;
}
\ No newline at end of file
import api from "../api/api"; import api from "../api/api";
import {baseURL,apiURL,sfpURL} from "../environments/environment"; import {baseURL,apiURL,sfpURL} from "../environments/environment";
// 白名单,不需要携带token就允许被访问的接口 // 白名单,不需要携带token就允许被访问的接口
const whiteApiList = [`${baseURL}/api/authorize/obtainToken`] const whiteApiList = ['/api/authorize/obtainToken']
export const interceptor = () => { export const interceptor = () => {
...@@ -10,17 +10,16 @@ export const interceptor = () => { ...@@ -10,17 +10,16 @@ export const interceptor = () => {
// 请求拦截器 // 请求拦截器
invoke(args) { invoke(args) {
console.log('请求拦截器',args); // console.log('请求拦截器',args);
// 加载loading // 加载loading
uni.showLoading({ uni.showLoading({
title: '加载中...' title: '加载中...'
}) })
console.log(!whiteApiList.includes(args.url))
// 当本地没有token,并且接口地址没在白名单内,需要重新获取token // 当本地没有token,并且接口地址没在白名单内,需要重新获取token
if (!uni.getStorageSync('uni-token') && !whiteApiList.includes(args.url)) { if (!uni.getStorageSync('uni-token') && !whiteApiList.includes(args.url)) {
return new Promise((resolve, reject)=>{ return new Promise((resolve, reject)=>{
uni.request({ uni.request({
url: baseURL + '/api/authorize/obtainToken', url: '/api/authorize/obtainToken',
method:'POST', method:'POST',
data:{ticket: 'uni-app'}, data:{ticket: 'uni-app'},
success: (res) => { success: (res) => {
...@@ -28,7 +27,7 @@ export const interceptor = () => { ...@@ -28,7 +27,7 @@ export const interceptor = () => {
uni.setStorageSync('uni-token',res.data['data']['token']); uni.setStorageSync('uni-token',res.data['data']['token']);
window.location.href = window.location.href + '?' + 't_reload=' + new Date().getTime(); window.location.href = window.location.href + '?' + 't_reload=' + new Date().getTime();
} }
console.log(res) // console.log(res)
},fail(err) { },fail(err) {
reject(err); reject(err);
}, },
...@@ -44,7 +43,7 @@ export const interceptor = () => { ...@@ -44,7 +43,7 @@ export const interceptor = () => {
'content-type': args.method === 'POST' ? 'application/json' : 'application/x-www-form-urlencoded', 'content-type': args.method === 'POST' ? 'application/json' : 'application/x-www-form-urlencoded',
'X-Authorization': uni.getStorageSync('uni-token') 'X-Authorization': uni.getStorageSync('uni-token')
} }
console.log(args.header) // console.log(args.header)
}, },
// 响应拦截器,可以对数据进行预处理 // 响应拦截器,可以对数据进行预处理
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment