CodeVar icon indicating copy to clipboard operation
CodeVar copied to clipboard

建议把 build 命令写到package.json里面

Open shzjj8882 opened this issue 1 year ago • 1 comments

修改 src/config.js 文件

去有道字典申请账号

yarn add crypto-js uuid

'use strict';

const alfy = require('alfy');
const { v4:uuid } = require('uuid');
const CryptoJS = require('crypto-js')
module.exports = {
    youDaoApi: 'https://openapi.youdao.com/api',
    getParams: function () {
        const salt = uuid();
        const curtime = Math.round(new Date().getTime()/1000);
        const key = '应用密钥'
        const appKey = "应用ID";
        const q = alfy.input
        const sign = CryptoJS.SHA256(`${appKey}${q}${salt}${curtime}${key}`).toString(CryptoJS.enc.Hex)
        return {
            query: {
                appKey,
                salt,
                curtime,
                sign,
                signType:'v3',
                q,
                from:'auto',
                to:'auto',
            }
        }
    },
    filter: {
        prep: [
            'and', 'or', 'the', 'a', 'at', 'of'
        ],
        prefix: [],
        suffix: [
            'ing', 'ed', 'ly'
        ],
        verb: [
            'was'
        ]
    }
};

shzjj8882 avatar Jul 21 '23 09:07 shzjj8882

请问如何打包生成 CodeVar.alfredworkflow

vitaminx avatar Aug 15 '23 17:08 vitaminx