1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- export function idCardNoFn(data) {
- return new Promise(resolve => {
- const app = getApp();
- const {
- appPublicKey
- } = app.globalData;
- const value = (typeof data).toLocaleLowerCase() === 'string' ? data : JSON.stringify(data);
- const textValue = JSON.parse(value);
- const idCardNo = textValue.idCardNo || '';
- const params = {
- text: idCardNo,
- action: 'encrypt',
- key: appPublicKey
- };
- my.rsa({ ...params,
- fail: () => resolve(''),
- success: ({
- text
- }) => resolve(text)
- });
- });
- }
- export function mobileFn(data) {
- return new Promise(resolve => {
- const app = getApp();
- const {
- appPublicKey
- } = app.globalData;
- const value = (typeof data).toLocaleLowerCase() === 'string' ? data : JSON.stringify(data);
- const textValue = JSON.parse(value);
- const mobile = textValue.mobile || '';
- const params = {
- text: mobile,
- action: 'encrypt',
- key: appPublicKey
- };
- my.rsa({ ...params,
- fail: () => resolve(''),
- success: ({
- text
- }) => resolve(text)
- });
- });
- }
|